Lattice Geometry#
Geometric information about 2D lattice is captured by a class yastn.tn.fpeps.SquareLattice
or its special subclasses yastn.tn.fpeps.RectangularUnitcell, yastn.tn.fpeps.CheckerboardLattice, and yastn.tn.fpeps.TriangularLattice.
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, and
yastn.tn.fpeps.TriangularLattice is a special case with a \(3 \times 3\) unit cell.
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) –
- Type of boundary conditions:
‘infinite’ (the default) for an infinite lattice,
‘obc’ for a finite lattice, or
‘cylinder’ for a finite cylinder periodic along rows, i.e.:
┌───── y(cols) ──────ᐳ │ │ (0, 0) (0, 1) ... (0, Ny-1) x(rows) (1, 0) (1, 1) ... (1, Ny-1) │ ... │ (Nx-1, 0) ... (Nx-1, Ny-1) ᐯ (0, 0) ... (0, Ny-1)
- 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
sitein the directiond.For infinite lattices, this function simply shifts the
siteby provided vectord. For finite lattices with open/periodic boundary it handles corner cases wheredis too large and the resulting site either doesn’t exist or it wraps around periodic boundary.Return
Noneif 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, **kwargs)[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]].