seemps.optimization.dmrg#

seemps.optimization.dmrg(H, guess=None, maxiter=20, tol=1e-10, tol_up=None, tol_eigs=None, strategy=<seemps.state.core.Strategy object>, callback=None)[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.

guessOptional[MPS]

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_eigsOptional[float], 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.

callbackOptional[Callable[[MPS, OptimizeResults], Any]]

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)