seemps.solve.gmres_solve#

seemps.solve.gmres_solve(A: MPO, b: MPS, guess: TypeAliasForwardRef('~seemps.state.MPS') | None = None, nvectors: int = 5, max_restarts: int = 5, tolerance: float = DEFAULT_TOLERANCE, tol_ill_conditioning: float | floating = np.finfo(float).eps * 10, strategy: Strategy = DEFAULT_STRATEGY) tuple[TypeAliasForwardRef('~seemps.state.CanonicalMPS'), float][source]#

Approximate solution of \(A \psi = b\).

Given the MPO A and the MPS b, use the generalized minimal resudial (GMRES) 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 tolerance.

Parameters:
AMPO

The linear operator on the left-hand side of the equation.

bMPS

The right-hand side vector.

guessMPS | None, default = None

Initial guess for the solution. If None, uses zero.

nvectorsint, default = 5

Maximum size of the Krylov subspace at each restart.

max_restartsint, default = 5

Maximum number of restarts.

tolerancefloat, default = DEFAULT_TOLERANCE

Convergence tolerance for the residual norm.

tol_ill_conditioningfloat, default = np.finfo(float):obj:.eps * 10

Tolerance for detecting ill-conditioning in the Krylov basis.

strategyStrategy, default = DEFAULT_STRATEGY

Truncation strategy for MPS operations.

Returns:
CanonicalMPS

Approximate solution to \(A \psi = b\).

float

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