Environment BoundaryMPS#

Boundary MPS approach for contracting finite lattice. It supports expectation values, including long-range correlations, sampling, etc.

class yastn.tn.fpeps.EnvBoundaryMPS(psi, opts_svd, setup='r', opts_var=None)[source]#

Boundary MPS class for finite PEPS contraction.

Calculate boundary MPSs for finite PEPS.

Consequative MPS follows from contracting transfer matrix with previous MPS. This employs yastn.tn.mps.zipper() followed by yastn.tn.mps.compression_() for refinement.

Parameters:
  • psi (fpeps.Peps) – Finite PEPS to be contracted.

  • opts_svd (dict) – Passed to yastn.tn.mps.zipper() and yastn.tn.mps.compression_() (if method="2site" is used in opts_var) Controls bond dimensions of boundary MPSs.

  • setup (str) – String containing directions from which the square lattice is contracted, consisting of characters “l”, “r”, “t”, “b”. E.g., setup=”lr” would calculate boundary MPSs from the left and from the right sites of the lattice. The default is “l”.

  • opts_var (dict) – Options passed to yastn.tn.mps.compression_(). The default is None which sets opts_var={max_sweeps: 2, normalization: False}.

classmethod from_dict(d, config=None)[source]#

De-serializes EnvBoundaryMPS from the dictionary d. See yastn.Tensor.from_dict() for further description.

measure_1site(O, site=None)[source]#

Calculate all 1-point expectation values <O_j> in a finite PEPS.

Takes CTM environments and operators.

Parameters:

O (dict[tuple[int, int], dict[int, operators]]) – mapping sites with list of operators at each site.

measure_2site(O, P, xrange=None, yrange=None, pairs='corner <=', dirn='v', opts_svd=None, opts_var=None)[source]#

Calculate expectation values \(\langle \textrm{O}_i \textrm{P}_j \rangle\) of local operators O and P for pairs of lattice sites \(i, j\).

Parameters:
  • O, P (yastn.Tensor) – one-site operators. It is possible to provide a dict of yastn.tn.fpeps.Lattice object mapping operators to sites. For each site, it is possible to provide a list or dict of operators, where the expectation value is calculated for each combination of those operators

  • xrange (None | tuple[int, int]) – range of rows forming a window, [r0, r1); r0 included, r1 excluded. For None, takes a single unit cell of the lattice.

  • yrange (tuple[int, int]) – range of columns forming a window. For None, takes a single unit cell of the lattice.

  • pairs (str | list[tuple[tule[int, int], tuple[int, int]]]) – Limits the pairs of sites to calculate the expectation values. If ‘corner’ in pairs, O is limited to top-left corner of the lattice If ‘row’ in pairs, O is limited to top row of the lattice

  • dirn (str) – ‘h’ or ‘v’, where the boundary MPSs used for truncation are, respectively, horizontal or vertical. The default is ‘v’.

  • opts_svd (dict) – Options passed to yastn.linalg.svd() used to truncate virtual spaces of boundary MPSs used in sampling. The default is None, in which case take D_total as the largest dimension from CTM environment.

  • opts_svd (dict) – Options passed to yastn.tn.mps.compression_() used in the refining of boundary MPSs. The default is None, in which case make 2 variational sweeps.

sample(projectors, xrange=None, yrange=None, dirn='v', number=1, opts_svd=None, opts_var=None, progressbar=False, return_probabilities=False, flatten_one=True, **kwargs)[source]#

Sample random configurations from PEPS. Output a dictionary linking sites with lists of sampled projectors` keys for each site. Projectors should be summing up to identity – this is not checked.

Parameters:
  • projectors (Dict[Any, yast.Tensor] | Sequence[yast.Tensor] | Dict[Site, Dict[Any, yast.Tensor]]) – Projectors to sample from. We can provide a dict(key: projector), where the sampled results will be given as keys, and the same set of projectors is used at each site. For a list of projectors, the keys follow from enumeration. Finally, we can provide a dictionary between each site and sets of projectors.

  • xrange (None | tuple[int, int]) – range of rows forming a window, [r0, r1); r0 included, r1 excluded. For None, takes a single unit cell of the lattice, which is the default.

  • yrange (None | tuple[int, int]) – range of columns forming a window. For None, takes a single unit cell of the lattice, which is the default.

  • dirn (str) – ‘h’ or ‘v’, where the boundary MPSs used for truncation are, respectively, horizontal or vertical. The default is ‘v’.

  • number (int) – Number of independent samples.

  • progressbar (bool) – Whether to display progressbar. The default is False.

  • return_probabilities (bool) – Whether to return a tuple (samples, probabilities). The default is False, where a dict samples is returned.

  • flatten_one (bool) – Whether, for number==1, pop one-element lists for each lattice site to return samples={site: ind, } instead of {site: [ind]}. The default is True.

sample_MC_(st0, st1, st2, psi, projectors, opts_svd, opts_var, trial='local')[source]#

Monte Carlo steps in a finite peps. Makes two steps while sweeping finite lattice back and forth.

Takes environments and a complete list of projectors to sample from.

proj_env, st1, st2 are updated in place

to_dict(level=2)[source]#

Serialize EnvBoundaryMPS to a dictionary. Complementary function is yastn.EnvBoundaryMPS.from_dict() or a general yastn.from_dict(). See yastn.Tensor.to_dict() for further description.