Cell
#
- class mbgdml.periodic.Cell(cell_v, cutoff=None, pbc=True)[source]#
Enables \(n\)-body predictions under periodic boundary conditions.
The minimum-image convention (mic) is used to reformat \(n\)-body structures in a form resembling non-periodic structures.
- Parameters:
cell_v (
numpy.ndarray
, shape:(3, 3)
) – The three cell vectors. For example, a cube of length 9.0 would be[[9.0, 0.0, 0.0], [0.0, 9.0, 0.0], [0.0, 0.0, 9.0]]
.cutoff (
float
, default:None
) – A periodic image interaction cutoff. Must be smaller than half the smallest cube length (non-cubic cells might have slightly larger cutoffs). Is automatically calculated if this isNone
.pbc (
list
orbool
) – Periodic boundary conditions in x-, y- and z-direction. Default is to assume periodic boundaries in all directions (i.e.,pbc=True
).
- property cell_v#
The three cell vectors. For example, a cube of length 9.0 would be
[[9.0, 0.0, 0.0], [0.0, 9.0, 0.0], [0.0, 0.0, 9.0]]
.- Type:
- d_mic(d, check_cutoff=True)[source]#
Applies the minimum-image convention to distance vectors.
Also checks that all atomic pairwise distances are less than
self.cutoff
. If any are equal to greater than the cutoff then it returnsNone
.- Parameters:
d (
numpy.ndarray
, ndim:2
) – Distances computed within the periodic cell.- Returns:
The minimum image coordinates.
- Return type:
- r_mic(r)[source]#
Find minimum-image convention coordinates of molecule(s) under periodic boundary conditions.
Creates distance vectors of each atom with respect to the first. Then applies the minimum-image convention using
self.d_mic()
.- Parameters:
r (
numpy.ndarray
, ndim:2
) – Cartesian coordinates of atoms under periodic boundary conditions.- Returns:
Cartesian coordinates of atoms after applying the minimum-image convention.
- Return type:
- property volume#
Volume of the periodic cell.
The volume of the parallelepiped described by
cell_v
(\(\boldsymbol{v}\)) is computed with\[\text{Volume} = (v_1 \times v_2) \cdot v_3.\]