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 MPO A and the MPS b, 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:
AMPO | MPOList | MPOSum

Matrix product state that will be inverted

bMPS | MPSSum

Right-hand side of the equation

maxiterint, default = 100

Maximum number of iterations

tolfloat, default = DEFAULT_TOLERANCE

Error tolerance for the algorithm.

strategyStrategy, default = DEFAULT_STRATEGY

Truncation strategy for MPS and MPO operations

Returns:
MPS

Approximate solution to \(A ψ = b\)

float

Norm-2 of the residual \(\Vert{A \psi - b}\Vert\)