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
MPOA and theMPSb, 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:
- A
MPO The linear operator on the left-hand side of the equation.
- b
MPS The right-hand side vector.
- guess
MPS|None,default=None Initial guess for the solution. If None, uses zero.
- nvectors
int,default= 5 Maximum size of the Krylov subspace at each restart.
- max_restarts
int,default= 5 Maximum number of restarts.
- tolerance
float,default=DEFAULT_TOLERANCE Convergence tolerance for the residual norm.
- tol_ill_conditioning
float,default=np.finfo(float):obj:.eps * 10 Tolerance for detecting ill-conditioning in the Krylov basis.
- strategy
Strategy,default=DEFAULT_STRATEGY Truncation strategy for MPS operations.
- A
- Returns:
CanonicalMPSApproximate solution to \(A \psi = b\).
floatNorm-2 of the residual \(\Vert{A \psi - b}\Vert\).