seemps.solve.cgs_solve#
- seemps.solve.cgs_solve(A: MPO | MPOList | MPOSum, b: MPS | MPSSum, guess: MPS | None = None, maxiter: int = 100, tolerance: float = DEFAULT_TOLERANCE, strategy: Strategy = DEFAULT_STRATEGY, callback: Callable[[MPS, float], Any] | None = None) tuple[CanonicalMPS, float][source]#
Approximate solution of \(A \psi = b\).
Given the
MPOA and theMPSb, use the conjugate gradient method to estimate another MPS that solves the linear system of equations \(A \psi = b\). Convergence is determined by the residual \(\Vert{A \psi - b}\Vert\) being smaller than tol.- Parameters:
- A
MPO|MPOList|MPOSum Matrix product state that will be inverted
- b
MPS|MPSSum Right-hand side of the equation
- maxiter
int,default= 100 Maximum number of iterations
- tol
float,default=DEFAULT_TOLERANCE Error tolerance for the algorithm.
- strategy
Strategy,default=DEFAULT_STRATEGY Truncation strategy for MPS and MPO operations
- A
- Returns:
MPSApproximate solution to \(A ψ = b\)
floatNorm-2 of the residual \(\Vert{A \psi - b}\Vert\)