treams.Lattice¶
- class treams.Lattice(arr, alignment=None)¶
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’.
Attributes
The alignment of the lattice in three-dimensional space.
Dimension of the lattice.
Reciprocal lattice.
(Generalized) volume of the lattice.
Methods
__and__
(other)Intersect two lattices.
__eq__
(other)Equality.
__ge__
(value, /)Return self>=value.
__getitem__
(idx)Index into the lattice.
__gt__
(value, /)Return self>value.
__le__
(other)Test if one lattice includes another.
__lt__
(value, /)Return self<value.
__ne__
(value, /)Return self!=value.
__or__
(other)Merge two lattices.
__repr__
()Representation.
__str__
()String representation.
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.
__lt__
(value, /)Return self<value.
__ge__
(value, /)Return self>=value.
__ne__
(value, /)Return self!=value.
__gt__
(value, /)Return self>value.