Lattice Geometry#
Geometric information about 2D lattice is captured by a class yastn.tn.fpeps.SquareLattice
or its special subclasses yastn.tn.fpeps.RectangularUnitcell
and yastn.tn.fpeps.CheckerboardLattice
.
They all operate on a square lattice, where yastn.tn.fpeps.SquareLattice
can be used for a finite system or an infinite system with a rectangular unit cell.
yastn.tn.fpeps.RectangularUnitcell
works for an infinite system with a pattern of repeating tensors inside the unit cell.
yastn.tn.fpeps.CheckerboardLattice
is a special case of the latter, with a \(2 \times 2\) unit cell and checkerboard pattern.
The geometry classes provide information on lattice sites (in particular, unique sites in the unit cell), unique bonds, and a way to navigate the lattice through the information on the neighborhood of each site.
Basic Elements#
Auxiliary objects in lattice definition are yastn.tn.fpeps.Bond
representing a pair of nearest-neighbor lattice sites,
and yastn.tn.fpeps.Site
for sites.
Core Classes#
- class yastn.tn.fpeps.SquareLattice(dims=(2, 2), boundary='infinite')[source]#
Geometric information about 2D square lattice.
- Parameters:
dims (tuple[int, int]) – Size of the unit cell in a form of
dims=(rows, columns)
. Site(0, 0) corresponds to top-left corner of the unit cell.boundary (str) – ‘infinite’ (the default) for an infinite lattice, ‘obc’ for a finite lattice, or ‘cylinder’ for a finite cylinder periodic along rows.
- bonds(dirn=None, reverse=False) Sequence[Bond] [source]#
Sequence of unique nearest neighbor bonds between lattice sites.
- Parameters:
dirn (None | str) – return horizontal followed by vertical bonds if None; ‘v’ and ‘h’ are, respectively, for vertical and horizontal bonds only.
reverse (bool) – whether to reverse the order of bonds.
- nn_site(site, d) Site | None [source]#
Index of the lattice site neighboring the
site
in the directiond
.For infinite lattices, this function simply shifts the
site
by provided vectord
. For finite lattices with open/periodic boundary it handles corner cases whered
is too large and the resulting site either doesn’t exist or it wraps around periodic boundary.Return
None
if there is no neighboring site in a given direction.- Parameters:
d (str | tuple[int, int]) – Take values in: ‘t’, ‘b’, ‘l’, ‘r’, ‘tl’, ‘bl’, ‘tr’, ‘br’, or a tuple of shifts (dx, dy).
- class yastn.tn.fpeps.CheckerboardLattice[source]#
Geometric information about infinite checkerboard lattice, which is an infinite lattice with \(2{\times}2\) unit cell and two unique tensors.
- class yastn.tn.fpeps.RectangularUnitcell(pattern, boundary='infinite')[source]#
Rectangular unit cells supporting patterns characterized by a single momentum
Q=(q_x, q_y)
.Inspired by b1592/ad-peps by B. Ponsioen.
- Parameters:
pattern (Sequence[Sequence[int]] | dict[tuple[int, int], int]) – Definition of a rectangular unit cell that tiles the square lattice. Integers are labels of unique tensors populating the sites within the unit cell.
Examples of such patterns can be:
[[0,],] : 1x1 unit cell, Q=0
{(0, 0): 0} : 1x1 unit cell, Q=0
[[0, 1],] : 1x2 unit cell, Q=(0, pi)
{(0, 0): 0, (0, 1): 1} : 1x2 unit cell, Q=(0, pi)
[[0, 1], [1, 0]] : 2x2 unit cell with bipartite pattern, Q=(pi, pi). Equivalent to
yastn.tn.fpeps.CheckerboardLattice
.[[0, 1, 2], [1, 2, 0], [2, 0, 1]] : 3x3 unit cell with diagonal stripe order, Q=(2pi/3, 2pi/3)
Warning
It is assumed that the neighborhood of each unique tensor is identical. This excludes cases such as
[[0, 1], [1, 1]]
.