qib.lattice.odd_face_centered_lattice.OddFaceCenteredLattice

class qib.lattice.odd_face_centered_lattice.OddFaceCenteredLattice(shape: Sequence[int], pbc=False)[source]

Bases: AbstractLattice

Modified square lattice in two dimensions, where every “odd” face has an additional vertex at the center. Used for “compact encoding”.

Methods

adjacency_matrix

Construct the adjacency matrix, indicating nearest neighbors.

coord_to_index

Map lattice coordinate to linear index.

edge_to_odd_face_index

Find the adjacent "odd" face of edge (i, j), returning the lattice site index of the face, or -1 in case the edge is not adjacent to an odd face.

index_to_coord

Map linear index to lattice coordinate.

Attributes

ndim

Number of spatial dimensions.

nsites

Number of lattice sites.

adjacency_matrix()[source]

Construct the adjacency matrix, indicating nearest neighbors. Each site at an odd face center is considered to be a neighbor of the four corners of the face.

coord_to_index(c) int[source]

Map lattice coordinate to linear index.

edge_to_odd_face_index(i, j)[source]

Find the adjacent “odd” face of edge (i, j), returning the lattice site index of the face, or -1 in case the edge is not adjacent to an odd face.

index_to_coord(i: int) tuple[source]

Map linear index to lattice coordinate.

property ndim: int

Number of spatial dimensions.

property nsites: int

Number of lattice sites.