seemps.optimization.dmrg#

seemps.optimization.dmrg(H: TypeAliasForwardRef('~seemps.operators.MPO') | TypeAliasForwardRef('~seemps.hamiltonians.NNHamiltonian'), guess: TypeAliasForwardRef('~seemps.state.MPS') | None = None, maxiter: int = 20, tol: float = 1e-10, tol_up: float | None = None, tol_eigs: float | None = None, strategy: Strategy = DEFAULT_STRATEGY, callback: TypeAliasForwardRef('~collections.abc.Callable') | None = None) OptimizeResults[source]#

Compute the ground state of a Hamiltonian represented as MPO using the two-site DMRG algorithm.

Parameters:
HMPO | NNHamiltonian

The Hermitian operator that is to be diagonalized. It may be also a nearest-neighbor Hamiltonian that is implicitly converted to MPO.

guessMPS | None

An initial guess for the ground state.

maxiterint

Maximum number of steps of the DMRG. Each step is a sweep that runs over every pair of neighborin sites. Defaults to 20.

tolfloat

Tolerance in the energy to detect convergence of the algorithm.

tol_upfloat, default = tol

If energy fluctuates up below this tolerance, continue the optimization.

tol_eigsfloat | None, default = tol

Tolerance of Scipy’s eigsh() solver, used internally. Zero means use machine precision.

strategyStrategy

Truncation strategy to keep bond dimensions in check. Defaults to DEFAULT_STRATEGY, which is very strict.

callbackCallable[[MPS, OptimizeResults], Any] | None

A callable called after each iteration (defaults to None).

Returns:
OptimizeResults

The result from the algorithm in an OptimizeResults object.

Examples

>>> from seemps.hamiltonians import HeisenbergHamiltonian
>>> from seemps.optimization import dmrg
>>> H = HeisenbergHamiltonian(10)
>>> result = dmrg(H)