aenet.geometry.transformations.CellTransformationMatrix
- class aenet.geometry.transformations.CellTransformationMatrix(T, sort: int | None = 2)[source]
General integer cell/basis transformation using a 3x3 matrix.
This wraps
aenet.geometry.utils.transform_cell().The transformation matrix
Tis applied as:A' = T · A
where rows of
Aare the lattice vectors. Atomic coordinates are transformed accordingly and redundant periodic images are created (or removed) so that the atom count is consistent with the volume scaling factor.Purpose
This is a change of lattice basis that does not actually alter the atomic structure, but rather how it is represented. This is useful for generating:
different supercell shapes for the same primitive cell
commensurate cells for defects, phonons, or disordered sampling
as a first step when constructing surface slabs from bulk structures
- param T:
Transformation matrix. In practice this should be integer-valued for supercell / basis transformations.
- type T:
array_like shape (3, 3)
- param sort:
Sorting behavior passed to
utils.transform_cell(default: 2).2sorts by fractional z, then by type.Nonedisables the coordinate-based sort (type sort still happens).- type sort:
int or None, optional
Notes
This currently relies on utilities that expect fractional coordinates. We convert AtomicStructure Cartesian coordinates to fractional, apply the transformation, then convert back to Cartesian.
Methods
__init__(T[, sort])apply_transformation(structure, **kwargs)Apply cell basis transformation to structure.