pyscivr.utils module
Utilities for molecular geometries.
- Notation:
N: number of atoms.
- pyscivr.utils.get_geom(xyzstr)[source]
Get the chemical symbols, positions and masses from an XYZ string.
Only the lines of the form
symbol x y zwhose first token is a chemical symbol inatomic_weightsare read. Other lines (e.g. the atom count and the comment line of the XYZ format) are skipped.
- pyscivr.utils.get_mass_center(posi, mass)[source]
Get the center of mass.
- Parameters:
posi (ArrayLike) –
(N, 3)positions.mass (ArrayLike) –
(N,)atomic masses.
- Returns:
(3,)center of mass.- Return type:
NDArray[np.float64]
- pyscivr.utils.get_inertia(posi, mass)[source]
Get the inertia tensor about the origin.
\[I = \sum_a m_a ((r_a^T r_a) I_3 - r_a r_a^T)\]- Parameters:
posi (ArrayLike) –
(N, 3)positions.mass (ArrayLike) –
(N,)atomic masses.
- Returns:
(3, 3)inertia tensor.- Return type:
NDArray[np.float64]
Note
The tensor is computed about the origin. To obtain the inertia tensor about the center of mass, subtract
get_mass_center()fromposiin advance.