UnitCell class¶
- class chemfiles.CellShape(value)¶
Available cell shapes in Chemfiles:
CellType.Orthorhombic
: for cells where the three angles are 90°;CellType.Triclinic
: for cells where the three angles may not be 90°;CellType.Infinite
: for cells without periodic boundary conditions;
- class chemfiles.UnitCell(lengths, angles=(90.0, 90.0, 90.0))¶
An
UnitCell
represent the box containing the atoms, and its periodicity.An unit cell is fully represented by three lengths (a, b, c); and three angles (alpha, beta, gamma). The angles are stored in degrees, and the lengths in Angstroms. The cell angles are defined as follow: alpha is the angles between the cell vectors b and c; beta as the angle between a and c; and gamma as the angle between a and b.
A cell also has a matricial representation, by projecting the three base vector into an orthonormal base. We choose to represent such matrix as an upper triangular matrix:
| a_x b_x c_x | | 0 b_y c_y | | 0 0 c_z |
Create a new
UnitCell
with the given celllengths
and cellangles
. Iflengths
is a 3x3 matrix, it is taken to be the unit cell matrix, andangles
is ignored.If the three angles are equal to 90.0, the new unit cell shape is
CellShape.Orthorhombic
. Else it isCellShape.Infinite
.