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:
- H
MPO|NNHamiltonian The Hermitian operator that is to be diagonalized. It may be also a nearest-neighbor Hamiltonian that is implicitly converted to MPO.
- guess
MPS|None An initial guess for the ground state.
- maxiter
int Maximum number of steps of the DMRG. Each step is a sweep that runs over every pair of neighborin sites. Defaults to 20.
- tol
float Tolerance in the energy to detect convergence of the algorithm.
- tol_up
float,default= tol If energy fluctuates up below this tolerance, continue the optimization.
- tol_eigs
float|None,default= tol Tolerance of Scipy’s eigsh() solver, used internally. Zero means use machine precision.
- strategy
Strategy Truncation strategy to keep bond dimensions in check. Defaults to DEFAULT_STRATEGY, which is very strict.
- callback
Callable[[MPS,OptimizeResults],Any] |None A callable called after each iteration (defaults to None).
- H
- Returns:
OptimizeResultsThe result from the algorithm in an
OptimizeResultsobject.
Examples
>>> from seemps.hamiltonians import HeisenbergHamiltonian >>> from seemps.optimization import dmrg >>> H = HeisenbergHamiltonian(10) >>> result = dmrg(H)