TwoSiteH

Inheritance Diagram

Inheritance diagram of tenpy.algorithms.mps_sweeps.TwoSiteH

Methods

TwoSiteH.__init__(env, i0[, combine, …])

Initialize self.

TwoSiteH.combine_Heff()

Combine LP and RP with W to form LHeff and RHeff.

TwoSiteH.combine_theta(theta)

Combine the legs of theta, such that fit to how we combined the legs of self.

TwoSiteH.matvec(theta)

Apply the effective Hamiltonian to theta.

TwoSiteH.matvec_theta_ortho(theta)

Apply self to theta, and orthogonalize against self.theta_ortho.

TwoSiteH.to_matrix()

Contract self to a matrix.

Class Attributes and Properties

TwoSiteH.acts_on

TwoSiteH.length

class tenpy.algorithms.mps_sweeps.TwoSiteH(env, i0, combine=False, move_right=True, ortho_to_envs=[])[source]

Bases: tenpy.algorithms.mps_sweeps.EffectiveH

Class defining the two-site effective Hamiltonian for Lanczos.

The effective two-site Hamiltonian looks like this:

|        .---       ---.
|        |    |   |    |
|       LP----W0--W1---RP
|        |    |   |    |
|        .---       ---.

If combine is True, we define LHeff and RHeff, which are the contractions of LP with W0, and RP with W1, respectively.

Parameters
  • env (MPOEnvironment) – Environment for contraction <psi|H|psi>.

  • i0 (int) – Index of the active site if length=1, or of the left-most active site if length>1.

  • combine (bool) – Whether to combine legs into pipes. This combines the virtual and physical leg for the left site (when moving right) or right side (when moving left) into pipes. This reduces the overhead of calculating charge combinations in the contractions, but one matvec() is formally more expensive, \(O(2 d^3 \chi^3 D)\).

  • move_right (bool) – Whether the the sweep is moving right or left for the next update.

combine

Whether to combine legs into pipes. This combines the virtual and physical leg for the left site and right site into pipes. This reduces the overhead of calculating charge combinations in the contractions, but one matvec() is formally more expensive, \(O(2 d^3 \chi^3 D)\).

Type

bool

length

Number of (MPS) sites the effective hamiltonian covers.

Type

int

acts_on

Labels of the state on which self acts. NB: class attribute. Overwritten by normal attribute, if combine.

Type

list of str

LHeff

Left part of the effective Hamiltonian. Labels '(vR*.p0)', 'wR', '(vR.p0*)' for bra, MPO, ket.

Type

Array

RHeff

Right part of the effective Hamiltonian. Labels '(p1*.vL)', 'wL', '(p1.vL*)' for ket, MPO, bra.

Type

Array

LP, W0, W1, RP

Tensors making up the network of self.

Type

Array

matvec(theta)[source]

Apply the effective Hamiltonian to theta.

Parameters

theta (Array) – Labels: vL, p0, p1, vR if combine=False, (vL.p0), (p1.vR) if True

Returns

Product of theta and the effective Hamiltonian.

Return type

theta Array

combine_Heff()[source]

Combine LP and RP with W to form LHeff and RHeff.

Combine LP with W0 and RP with W1 to get the effective parts of the Hamiltonian with piped legs.

combine_theta(theta)[source]

Combine the legs of theta, such that fit to how we combined the legs of self.

Parameters

theta (Array) – Wave function with labels 'vL', 'p0', 'p1', 'vR'

Returns

theta – Wave function with labels 'vL', 'p0', 'p1', 'vR'

Return type

Array

to_matrix()[source]

Contract self to a matrix.

matvec_theta_ortho(theta)[source]

Apply self to theta, and orthogonalize against self.theta_ortho. __ We implement this by effectively replacing H -> P H P with the projector P = 1 - sum_o |o> <o| projecting out the states from theta_ortho.

Parameter and return value as for matvec() (which this function replaces, if the class was initialized with non-empty ortho_to_envs.)