TwoSiteMixer

Inheritance Diagram

Inheritance diagram of tenpy.algorithms.dmrg.TwoSiteMixer

Methods

TwoSiteMixer.__init__(*args, **kwargs)

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

Preform a subspace expansion of a single-site wave function on one side.

TwoSiteMixer.update_amplitude(sweeps)

Update the amplitude, possibly disable the mixer.

Class Attributes and Properties

TwoSiteMixer.update_sites

how many sites the theta in perturb_svd should have

class tenpy.algorithms.dmrg.TwoSiteMixer(*args, **kwargs)[source]

Bases: SingleSiteMixer

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

Preform a subspace expansion of a single-site wave function on one side.

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

  • theta (Array) – The optimized wave function, prepared for svd, with labels '(vL.p0)', 'vR' for right move, or 'vL', '(p0.vR)' for left move.

  • i0 (int) – The site index where theta lives.

  • move_right (bool) – Whether we move to the right (True) or left (False).

Returns

  • U, VH (Array) – Left and right part of the subspace-expanded svd. Always such that the contraction U.S.VH resembles the original theta up to truncation error. U has labels '(vL.p0)', 'vR' (right move) or 'vL', 'vR' (left move). V has labels 'vL', 'vR' (right move) or '(vL.p0)', 'vR' (left move). For a right move, only U is canonical; for a left-move only VH is canonical.

  • S (1D ndarray) – (Perturbed) singular values on the new bond.

  • err (TruncationError) – The truncation error introduced.

  • S_approx (ndarray) – Same as S.

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

update_sites = 1

how many sites the theta in perturb_svd should have