Lattice Geometry#
Geometric information about 2D lattice are captured by a class yastn.tn.fpeps.SquareLattice
or its special subclass yastn.tn.fpeps.CheckerboardLattice
.
They 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) – Finite lattice, infinite lattice, or finite cylinder periodic along rows, respectively, for ‘obc’, ‘infinite’, or ‘cylinder’.
- 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 for vertical and horizontal bonds only, respectively.
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,1],] : 1x2 unit cell, Q=(pi, 0)
[[0,1],[1,0]] : 2x2 unit cell with bipartite pattern, Q=(pi, pi)
[[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 as
[[0, 1], [1, 1]]
.