Variational overlap maximization#
- yastn.tn.mps.compression_(psi, target, method='1site', overlap_tol=None, Schmidt_tol=None, max_sweeps=1, iterator_step=None, opts_svd=None, normalize=True)[source]#
Perform variational optimization sweeps until convergence to best approximate the target, starting from MPS/MPO
psi.The outer loop sweeps over
psiupdating sites from the first site to the last and back. Convergence can be controlled based on overlap and/or Schmidt values (which is a more sensitive measure of convergence). The algorithm performs at mostmax_sweeps. If tolerance measures are provided, the calculation ends when the convergence criteria are satisfied, e.g., change in overlap or Schmidt values between sweeps is less than the provided tolerance.Works for
optimization against provided MPS:
targetisMPSor list[MPS]against MPO acting on MPS:
targetis a list[MPO, MPS].against sum of MPOs acting on MPS:
targetis a list[[MPO, MPO, ...], MPS].sum of any of the three above: target is
[[MPS], [MPO, MPS], [[MPO, MPO, ...], MPS], ...]for
psibeing itself an MPO, all MPS’s above should be replaced with MPO, e.g.,[MPO, MPO]
Outputs iterator if
iterator_stepis given, which allows inspectingpsioutside ofcompression_function after everyiterator_stepsweeps.- Parameters:
psi (yastn.tn.mps.MpsMpoOBC) – Initial state. It is updated during execution. It is first canonized to the first site, if not provided in such a form. State resulting from
compression_is canonized to the first site.target (MPS or MPO) – Defines target state. The target can be:
an MPS, e.g. target = MPS or [MPS],
an MPO acting on MPS (target = [MPO, MPS]),
sum of MPOs acting on MPS, e.g, [[MPO, MPO], MPS],
or the sum of the above, e.g., [[MPS], [MPO, MPS], [[MPO, MPO], MPS]].
If
psiandtargetare MPOs, the MPS in above list is replaced by MPO.
method (str) – Which optimization variant to use from ‘1site’, ‘2site’
overlap_tol (float) – Convergence tolerance for the change of relative overlap in a single sweep. By default is None, in which case overlap convergence is not checked.
Schmidt_tol (float) – Convergence tolerance for the change of Schmidt values on the worst cut/bond in a single sweep. By default is None, in which case Schmidt values convergence is not checked.
max_sweeps (int) – Maximal number of sweeps.
iterator_step (int) – If int,
compression_returns a generator that would yield output after every iterator_step sweeps. The default is None, in which casecompression_sweeps are performed immediately.opts_svd (dict) – Options passed to
yastn.linalg.svd()used to truncate virtual spaces inmethod='2site'.
- Returns:
NamedTuple with fields
sweepsnumber of performed sweeps.overlapoverlap after the last sweep.doverlapabsolute value of relative overlap change in the last sweep.max_dSchmidtnorm of Schmidt values change on the worst cut in the last sweep.max_discarded_weightnorm of discarded_weights on the worst cut in ‘2site’ procedure.
- Return type:
compression_out(NamedTuple)