qib.lattice.hexagonal_lattice.HexagonalLattice

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

Bases: AbstractLattice

Hexagonal lattice. The lattice has n full hexagons per row and m full hexagons per column.

Methods

adjacency_matrix

Construct the adjacency matrix, indicating nearest neighbors.

coord_to_index

Map lattice coordinates to single index.

equivalent_brick_lattice

Returns the equivalent brick lattice (delete=True).

index_to_coord

Map linear index to the hexagonal lattice coordinates.

Attributes

ndim

Number of spatial dimensions.

nsites

Number of lattice sites.

adjacency_matrix()[source]

Construct the adjacency matrix, indicating nearest neighbors. Adj matrix built from the equivalent brick lattice (delete=True).

coord_to_index(c) int[source]

Map lattice coordinates to single index.

equivalent_brick_lattice()[source]

Returns the equivalent brick lattice (delete=True):

 _   _   _      _   _   _
/ \_/ \_/ \    | |_| |_| |
\_/ \_/ \_/ == |_| |_| |_|
  \_/ \_/      . |_| |_| .
index_to_coord(i: int) tuple[source]

Map linear index to the hexagonal lattice coordinates.

property ndim: int

Number of spatial dimensions.

property nsites: int

Number of lattice sites.