TwoSiteMixer

Inheritance Diagram

Inheritance diagram of tenpy.algorithms.dmrg.TwoSiteMixer

Methods

TwoSiteMixer.__init__(options)

Initialize self.

TwoSiteMixer.perturb_svd(engine, theta, i0, …)

Mix extra terms to theta and perform an SVD.

TwoSiteMixer.subspace_expand(engine, theta, …)

Expand the MPS subspace, to allow the bond dimension to increase.

TwoSiteMixer.update_amplitude(sweeps)

Update the amplitude, possibly disable the mixer.

class tenpy.algorithms.dmrg.TwoSiteMixer(options)[source]

Bases: tenpy.algorithms.dmrg.SingleSiteMixer

Mixer for two-site DMRG.

This is the two-site version of the mixer described in [hubig2015]. Equivalent to the DensityMatrixMixer, but never construct the full density matrix.

perturb_svd(engine, theta, i0, move_right)[source]

Mix extra terms to theta and perform an SVD.

Parameters
  • engine (DMRGEngine) – The DMRG engine calling the mixer.

  • theta (Array) – The optimized wave function, prepared for svd.

  • i0 (int) – Site index; theta lives on i0, i0+1.

  • update_LP (bool) – Whether to calculate the next env.LP[i0+1].

  • update_RP (bool) – Whether to calculate the next env.RP[i0].

Returns

  • U (Array) – Left-canonical part of theta. Labels '(vL.p0)', 'vR'.

  • S (1D ndarray | 2D Array) – Without mixer just the singluar values of the array; with mixer it might be a general matrix; see comment above.

  • VH (Array) – Right-canonical part of theta. Labels 'vL', '(vR.p1)'.

  • err (TruncationError) – The truncation error introduced.

subspace_expand(engine, theta, i0, move_right, next_B)[source]

Expand the MPS subspace, to allow the bond dimension to increase.

This is the subspace expansion following [hubig2015].

Parameters
  • engine (DMRGEngine) – The DMRG engine calling the mixer.

  • theta (Array) – Optimized guess for the ground state of the effective local Hamiltonian.

  • i0 (int) – Site index at which the local update has taken place.

  • move_right (bool) – Whether the next i0 of the sweep will be right or left of the current one.

  • next_B (Array) – The subspace expansion requires to change the tensor on the next site as well. If move_right, it should correspond to engine.psi.get_B(i0+1, form='B'). If not move_right, it should correspond to engine.psi.get_B(i0-1, form='A').

Returns

  • theta – Local MPS tensor at site i0 after subspace expansion.

  • next_B – MPS tensor at site i0+1 or i0-1 (depending on sweep direction) after subspace expansion.

update_amplitude(sweeps)[source]

Update the amplitude, possibly disable the mixer.

Parameters

sweeps (int) – The number of performed sweeps, to check if we need to disable the mixer.

Returns

mixer – Returns self if we should continue mixing, or None, if the mixer should be disabled.

Return type

Mixer | None