Skip to main content

contract_fit

Function contract_fit 

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

Perform variational fitting contraction of two MPOs

This computes C = A * B using a variational (DMRG-like) algorithm that alternates between sweeping left-to-right and right-to-left, optimizing two sites at a time.

§Arguments

  • mpo_a - First MPO
  • mpo_b - Second MPO
  • options - Fitting options
  • initial - Optional initial guess (if None, uses naive contraction)

§Returns

The contracted MPO C with bond dimension controlled by options