treams.Lattice#
- class treams.Lattice(arr, alignment=None)[source]#
Lattice definition.
The lattice can be one-, two-, or three-dimensional. If it is not three-dimensional it is required to be embedded into a lower dimensional subspace that is aligned with the Cartesian axes. The default alignment for one-dimensional lattices is along the z-axis and for two-dimensional lattices it is in the x-y-plane.
For a one-dimensional lattice the definition consists of simply the value of the lattice pitch. Higher-dimensional lattices are defined by (2, 2)- or (3, 3)-arrays. If the arrays are diagonal it is sufficient to specify the (2,)- or (3,)-array diagonals. Alternatively, if another instance of a Lattice is given, the defined alignment is extracted, which can be used to separate a lower-dimensional sublattice.
Lattices are immutable objects.
Example
>>> Lattice([1, 2]) Lattice([[1. 0.] [0. 2.]], alignment='xy') >>> Lattice(_, 'x') Lattice(1.0, alignment='x')
- Parameters:
arr (float, array, Lattice) – Lattice definition. Each row corresponds to one lattice vector, each column to the axis defined in alignment.
alignment (str, optional) – Alignment of the lattice. Possible values are ‘x’, ‘y’, ‘z’, ‘xy’, ‘yz’, ‘zx’, and ‘xyz’.
Methods
__init__(arr[, alignment])Initialization.
cubic(pitch[, alignment])Create a three-dimensional cubic lattice.
hexagonal(pitch[, height, alignment])Create a hexagonal lattice.
isdisjoint(other)Test if lattices are disjoint.
orthorhombic(x, y, z[, alignment])Create a three-dimensional orthorhombic lattice.
permute([n])Permute the lattice orientation.
rectangular(x, y[, alignment])Create a two-dimensional rectangular lattice.
square(pitch[, alignment])Create a two-dimensional square lattice.
Attributes
alignmentThe alignment of the lattice in three-dimensional space.
dimDimension of the lattice.
reciprocalReciprocal lattice.
volume(Generalized) volume of the lattice.