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 byyastn.tn.mps.compression_()for refinement.- 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 isNonewhich sets opts_var={max_sweeps: 2, normalization: False}.
- classmethod from_dict(d, config=None)[source]#
De-serializes EnvBoundaryMPS from the dictionary
d. Seeyastn.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
OandPfor 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.Latticeobject 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 operatorsxrange (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 isNone, in which case takeD_totalas 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 isNone, 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 generalyastn.from_dict(). Seeyastn.Tensor.to_dict()for further description.