Skip to main content

contract_naive

Function contract_naive 

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

Perform naive 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).

The naive algorithm:

  1. Contract each pair of site tensors
  2. Optionally compress the result

§Arguments

  • mpo_a - First MPO
  • mpo_b - Second MPO
  • options - Optional compression options

§Returns

The contracted MPO C with dimensions:

  • s1: from A
  • s2: from B
  • bond dimensions: product of input bond dimensions (before compression)