qib.lattice.brick_lattice.BrickLattice

class qib.lattice.brick_lattice.BrickLattice(shape: Sequence[int], pbc=False, delete=False, convention: ShiftedLatticeConvention = ShiftedLatticeConvention.COLS_SHIFTED_UP)[source]

Bases: AbstractLattice

Brick lattice. The lattice has n full rectangles per row and m full rectangles per column.

Methods

adjacency_matrix

Construct the adjacency matrix, indicating nearest neighbors. Brick lattice embedded in a square grid::.

coord_to_index

Map lattice coordinate to the equivalent square lattice coordinate.

index_to_coord

Map linear index to the equivalent square lattice coordinate.

Attributes

ndim

Number of spatial dimensions.

nsites

Number of lattice sites.

adjacency_matrix()[source]

Construct the adjacency matrix, indicating nearest neighbors. Brick lattice embedded in a square grid:

 _   _   _
| |_| |_| |
|_| |_| |_|
. |_| |_| .

If delete == True, the 2 extra points are eliminated from the adjacency matrix. Otherwise, they are just disconnected (corresponding rows and columns are 0)

coord_to_index(c) int[source]

Map lattice coordinate to the equivalent square lattice coordinate. If delete=True the two extra points of the equivalent square lattice are not counted in.

index_to_coord(i: int) tuple[source]

Map linear index to the equivalent square lattice coordinate. If self.delete=True the two extra points of the equivalent square lattice are not counted in.

property ndim: int

Number of spatial dimensions.

property nsites: int

Number of lattice sites. If delete=False, it includes the 2 extra points if they are needed.