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 psi updating 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 most max_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: target is MPS or list [MPS]

  • against MPO acting on MPS: target is a list [MPO, MPS].

  • against sum of MPOs acting on MPS: target is a list [[MPO, MPO, ...], MPS].

  • sum of any of the three above: target is [[MPS], [MPO, MPS], [[MPO, MPO, ...], MPS], ...]

  • for psi being MPO, where all MPS’s above should be replaced with MPO, e.g., [MPO, MPO]

Outputs iterator if iterator_step is given, which allows inspecting psi outside of compression_ function after every iterator_step sweeps.

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 psi and target are MPO, 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. Default is None, in which case compression_ sweeps are performed immediately.

  • opts_svd (dict) – Options passed to yastn.linalg.svd() used to truncate virtual spaces in method='2site'.

Returns:

NamedTuple with fields

  • sweeps number of performed sweeps.

  • overlap overlap after the last sweep.

  • doverlap absolute value of relative overlap change in the last sweep.

  • max_dSchmidt norm of Schmidt values change on the worst cut in the last sweep.

  • max_discarded_weight norm of discarded_weights on the worst cut in ‘2site’ procedure.

Return type:

compression_out(NamedTuple)