MPOModel

class tenpy.models.model.MPOModel(lattice, H_MPO)[source]

Bases: tenpy.models.model.Model

Base class for a model with an MPO representation of the Hamiltonian.

In this class, the Hamiltonian gets represented by an MPO. Thus, instances of this class are suitable for MPO-based algorithms like DMRG dmrg and MPO time evolution.

Todo

implement MPO for time evolution…

Parameters
H_MPOMPO

The Hamiltonian rewritten as an MPO.

Attributes
H_MPOtenpy.networks.mpo.MPO

MPO representation of the Hamiltonian.

Methods

calc_H_bond_from_MPO(self[, tol_zero])

Calculate the bond Hamiltonian from the MPO Hamiltonian.

group_sites(self[, n, grouped_sites])

Modify self in place to group sites.

test_sanity

group_sites(self, n=2, grouped_sites=None)[source]

Modify self in place to group sites.

Group each n sites together using the GroupedSite. This might allow to do TEBD with a Trotter decomposition, or help the convergence of DMRG (in case of too long range interactions).

This has to be done after finishing initialization and can not be reverted.

Parameters
nint

Number of sites to be grouped together.

grouped_sitesNone | list of GroupedSite

The sites grouped together.

Returns
grouped_siteslist of GroupedSite

The sites grouped together.

calc_H_bond_from_MPO(self, tol_zero=1e-15)[source]

Calculate the bond Hamiltonian from the MPO Hamiltonian.

Parameters
tol_zerofloat

Arrays with norm < tol_zero are considered to be zero.

Returns
H_bondlist of Array

Bond terms as required by the constructor of NearestNeighborModel. Legs are ['p0', 'p0*', 'p1', 'p1*']

Raises
ValueErrorif the Hamiltonian contains longer-range terms.