mdopt.optimiser.dmrg module#

This module contains the DMRG and the EffectiveOperator classes. The class structure is inspired by TenPy.

class mdopt.optimiser.dmrg.DMRG(mps: ExplicitMPS | CanonicalMPS, mpo: List[ndarray], chi_max: int = 10000, cut: float = 1e-17, mode: str = 'SA', silent: bool = False, copy: bool = True)#

Class holding the Density Matrix Renormalisation Group algorithm with two-site updates for a finite-size system with open-boundary conditions.

run(num_iter: int = 1) None#

Run the algorithm, i.e., run sweep for num_iter iterations.

sweep() None#

One full DMRG sweep (left→right, then right→left).

update_bond(i: int) None#

Update the bond between sites i and i+1.

update_left_environment(i: int) None#

Compute the left_environment left of site i+1 from the left_environment left of site i.

update_right_environment(i: int) None#

Compute the right_environment right of site i-1 from the right_environment right of site i.

class mdopt.optimiser.dmrg.EffectiveOperator(*args, **kwargs)#

Bases: LinearOperator

Class to store an effective two-site operator.

In order to take more advantage of the scipy.sparse.linalg module, we make a special class for local effective operators. It allows us to compute eigenvectors more efficiently.

Such effective operator is to be diagonalised in the update_bond method of the DMRG class:

---uL                    uR---
|        i          j        |
|  vL    |          |    vR  |
(L)----(mpo_l)----(mpo_r)----(R)
|        |          |        |
|        k          l        |
---dL                    dR---

In our convention, the legs of left/right environments (tensors L/R in the cartoon) are ordered as follows: (uL/uR, vL/vR, dL/dR) which means “(up, virtual, down)”.