Skip to main content

Module mpo

Module mpo 

Source
Expand description

MPO (Matrix Product Operator) contraction algorithms

This module provides algorithms for contracting two Matrix Product Operators (MPOs), which are tensor trains with 4D site tensors of shape (left_bond, site_dim_1, site_dim_2, right_bond).

§Main Types

  • MPO: Basic Matrix Product Operator representation
  • SiteMPO: Center-canonical form with orthogonality center
  • VidalMPO: Vidal canonical form with explicit singular values
  • InverseMPO: Inverse form for efficient local updates

§Contraction Algorithms

§Example

use tensor4all_simplett::mpo::{MPO, contract_naive, ContractionOptions};

let mpo_a = MPO::constant(&[(2, 2), (2, 2)], 1.0_f64);
let mpo_b = MPO::constant(&[(2, 2), (2, 2)], 2.0_f64);
let result = contract_naive(&mpo_a, &mpo_b, Some(ContractionOptions::default())).unwrap();

assert_eq!(result.len(), 2);
assert_eq!(result.site_dims(), vec![(2, 2), (2, 2)]);

Re-exports§

pub use contract_fit::contract_fit;
pub use contract_fit::FitOptions;
pub use contract_naive::contract_naive;
pub use contract_zipup::contract_zipup;
pub use contraction::Contraction;
pub use contraction::ContractionOptions;
pub use dispatch::contract;
pub use dispatch::ContractionAlgorithm;
pub use error::MPOError;
pub use error::Result;
pub use factorize::factorize;
pub use factorize::FactorizeMethod;
pub use factorize::FactorizeOptions;
pub use factorize::FactorizeResult;
pub use inverse_mpo::InverseMPO;
pub use mpo::MPO;
pub use site_mpo::SiteMPO;
pub use types::tensor4_from_data;
pub use types::tensor4_zeros;
pub use types::Tensor4;
pub use types::Tensor4Ops;
pub use vidal_mpo::VidalMPO;

Modules§

contract_fit
Variational fitting algorithm for MPO contraction
contract_naive
Naive MPO contraction algorithm
contract_zipup
Zip-up MPO contraction algorithm
contraction
Contraction struct with caching for efficient MPO evaluation
dispatch
Algorithm dispatch for MPO contraction
environment
Environment computation for MPO contractions
error
Error types for MPO contraction operations
factorize
Factorization methods for MPO tensors
inverse_mpo
InverseMPO - Inverse form of MPO
mpo
MPO (Matrix Product Operator) implementation
site_mpo
SiteMPO - Center-canonical form of MPO
tt_contraction
Contraction operations for tensor trains (TT-TT)
types
Core types for MPO (Matrix Product Operator) operations
vidal_mpo
VidalMPO - Vidal canonical form of MPO

Type Aliases§

Matrix2
Type alias for 2D matrix.