# DMRG

`ITensors.dmrg`

— Function`dmrg(H::MPO,psi0::MPS,sweeps::Sweeps;kwargs...)`

Use the density matrix renormalization group (DMRG) algorithm to optimize a matrix product state (MPS) such that it is the eigenvector of lowest eigenvalue of a Hermitian matrix H, represented as a matrix product operator (MPO). The MPS `psi0`

is used to initialize the MPS to be optimized, and the `sweeps`

object determines the parameters used to control the DMRG algorithm.

Returns:

`energy::Complex`

- eigenvalue of the optimized MPS`psi::MPS`

- optimized MPS

Optional keyword arguments:

`outputlevel::Int = 1`

- larger outputlevel values make DMRG print more information and 0 means no output`observer`

- object implementing the Observer interface which can perform measurements and stop DMRG early`write_when_maxdim_exceeds::Int`

- when the allowed maxdim exceeds this value, begin saving tensors to disk to free memory in large calculations

`dmrg(Hs::Vector{MPO},psi0::MPS,sweeps::Sweeps;kwargs...)`

Use the density matrix renormalization group (DMRG) algorithm to optimize a matrix product state (MPS) such that it is the eigenvector of lowest eigenvalue of a Hermitian matrix H. The MPS `psi0`

is used to initialize the MPS to be optimized, and the `sweeps`

object determines the parameters used to control the DMRG algorithm.

This version of `dmrg`

accepts a representation of H as a Vector of MPOs, Hs = [H1,H2,H3,...] such that H is defined as H = H1+H2+H3+... Note that this sum of MPOs is not actually computed; rather the set of MPOs [H1,H2,H3,..] is efficiently looped over at each step of the DMRG algorithm when optimizing the MPS.

Returns:

`energy::Complex`

- eigenvalue of the optimized MPS`psi::MPS`

- optimized MPS

`dmrg(H::MPO,Ms::Vector{MPS},psi0::MPS,sweeps::Sweeps;kwargs...)`

Use the density matrix renormalization group (DMRG) algorithm to optimize a matrix product state (MPS) such that it is the eigenvector of lowest eigenvalue of a Hermitian matrix H, subject to the constraint that the MPS is orthogonal to each of the MPS provided in the Vector `Ms`

. The orthogonality constraint is approximately enforced by adding to H terms of the form w|M1><M1| + w|M2><M2| + ... where Ms=[M1,M2,...] and w is the "weight" parameter, which can be adjusted through the optional `weight`

keyword argument. The MPS `psi0`

is used to initialize the MPS to be optimized, and the `sweeps`

object determines the parameters used to control the DMRG algorithm.

Returns:

`energy::Complex`

- eigenvalue of the optimized MPS`psi::MPS`

- optimized MPS