seemps.solve.dmrg_solve#

seemps.solve.dmrg_solve(A: MPO, b: MPS, guess: TypeAliasForwardRef('~seemps.state.MPS') | None = None, maxiter: int = 20, atol: float = 0, rtol: float = 1e-5, strategy: Strategy = DEFAULT_STRATEGY, method: str = 'bicgstab', compute_residuals: bool = True) tuple[TypeAliasForwardRef('~seemps.state.MPS'), float | None][source]#

Solve \(A x = b\) for an MPO A and an MPS b using two-site DMRG.

Parameters:
AMPO

Linear operator on the left-hand side.

bMPS

Right-hand side.

guessMPS | None, default = None

Initial guess (defaults to b).

maxiterint, default = 20

Maximum number of sweeps.

atol, rtolfloat

Convergence tolerance. With compute_residuals=True, convergence requires norm(A@x - b) <= max(rtol * norm(b), atol). With compute_residuals=False, the relative change of the solution between sweeps is used instead. Defaults are rtol=1e-5 and atol=0.

strategyStrategy, default = DEFAULT_STRATEGY

Truncation strategy for the bond dimension.

methodstr, deafult = ‘bicgstab’

Iterative solver: 'cg', 'bicg', 'bicgstab', 'gmres', or 'lgmres'.

compute_residualsbool, default = True

If True, check the full residual at each sweep for convergence (robust). If False, use a cheaper relative-change criterion (faster).

Returns:
MPS

The solution x.

float | None

Residual :math:\Vert A x - b\Vert_2, or None when compute_residuals=False.