Dims
Dimensions of systems.
This module provides utility functions to calculate geometric properties of a molecular system such as the bounding box lengths, box vectors, and the volume of the box required to enclose the atoms.
get_box_lengths(positions)
¶
Compute lengths of box edges.
This function calculates the lengths of the edges of a box that encompasses a set of atomic positions by finding the difference between the maximum and minimum coordinates in each dimension.
PARAMETER | DESCRIPTION |
---|---|
positions
|
A 2D NumPy array of shape (N, 3), where N is the number of atoms and each row represents the Cartesian coordinates [x, y, z] of an atom.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
NDArray[float64]
|
A 1D NumPy array of shape (3,) containing the lengths of the box in the x, y, and z directions. |
get_box_vectors(positions)
¶
Construct orthogonal box vectors.
This function calculates the vectors of the edges of a box that encompasses a set of atomic positions. The vectors are represented as a diagonal matrix where the diagonal elements correspond to the lengths of the box edges.
PARAMETER | DESCRIPTION |
---|---|
positions
|
A 2D NumPy array of shape (N, 3), where N is the number of atoms and each row represents the Cartesian coordinates [x, y, z] of an atom.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
NDArray[float64]
|
A 3x3 NumPy array representing the box vectors in matrix form. The matrix is diagonal since the box is assumed to be orthorhombic. |
get_box_volume(positions)
¶
Calculate volume of the enclosing orthorhombic box.
Computes the volume of the orthorhombic box that encapsulates all atoms. The box vectors are assumed to form an orthogonal basis.
PARAMETER | DESCRIPTION |
---|---|
positions
|
A 2D NumPy array of shape (N, 3), where N is the number of atoms and each row represents the Cartesian coordinates [x, y, z] of an atom.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float
|
Volume of the enclosing box. |