Skip to main content

contract_zipup

Function contract_zipup 

Source
pub fn contract_zipup<T: SVDScalar>(
    mpo_a: &MPO<T>,
    mpo_b: &MPO<T>,
    options: &ContractionOptions,
) -> Result<MPO<T>>
where <T as ComplexFloat>::Real: Into<f64>,
Expand description

Perform zip-up contraction of two MPOs

This computes C = A * B where the contraction is over the shared physical index (s2 of A contracts with s1 of B), with on-the-fly compression at each step.

The zip-up algorithm:

  1. Start from the left with a remainder tensor R = [[1]]
  2. At each site: a. Contract R with A[i] and B[i] b. Reshape to matrix c. Factorize into left and right factors d. Store left factor as result tensor e. Use right factor as new remainder R
  3. At the last site, just store the contracted tensor

§Arguments

  • mpo_a - First MPO
  • mpo_b - Second MPO
  • options - Contraction options (tolerance, max_bond_dim, method)

§Returns

The contracted and compressed MPO C