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='l', 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 byyastn.tn.mps.compression_()
for refinment.- Parameters:
psi (fpeps.Peps) – Finite PEPS to be contracted.
opts_svd (dict) – Passed to
yastn.tn.mps.zipper()
andyastn.tn.mps.compression_()
(ifmethod="2site"
is used inopts_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 isNone
which sets opts_var={max_sweeps: 2, normalization: False}.
- 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, opts_svd, opts_var=None)[source]#
Calculate all 2-point correlations <O_i P_j> in a finite PEPS.
Takes CTM environments and operators.
- Parameters:
O, P (dict[tuple[int, int], dict[int, operators]],) – mapping sites with list of operators at each site.
- sample(projectors, 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.
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
.