ncdl.lattice.Lattice

class ncdl.lattice.Lattice(input_lattice: List | str, scale: array | None = None, tensor_backend: torch._tensor = torch.Tensor)

The general “LatticeTensor” factory. Basically, this holds all the important information about the point structure of any Lattice. LatticeTensors are instances of multi-dimensional sequences, but they store values only within a bounded region (and on an integer lattice).

An instance of this class /creates/ lattice tensors from a collection of tensors (and possibly shifts, but if no shifts are spllied, then it is assumed that the default coset structure (all positive) is used)

__init__(input_lattice: List | str, scale: array | None = None, tensor_backend: torch._tensor = torch.Tensor)

Instantiate the LatticeTensor factory.

Parameters:
  • input_lattice – Either a lattice name (i.e. quincunx, qc, bcc etc..) or a list of coset vectors.

  • scale – If input lattice is a list of coset vectors, then this should be an n-dimensional integer vector specifying the scale of each coset.

  • tensor_backend – The type of tensor that backs this tensor created from this factory. This will mostly be torch.Tensor, but can be any torch._tensor type.

Methods

__init__(input_lattice[, scale, tensor_backend])

Instantiate the LatticeTensor factory.

cartesian_index(pt)

cartesian_to_lattice(pt, coset_index)

coset_index(pt)

coset_offset(idx)

kappa(i, j[, additive])

Attributes

coset_count

The total number of cosets for the lattice

coset_scale

The coset scale $D$ of the lattice

coset_vectors

The coset vectors $v_i mod D$ of the current lattice.

dimension

The dimension of the lattice.