mlchem.chem.calculator.tools.calc_gyration_tensor

calc_gyration_tensor(coordinates: ndarray, masses: Iterable | None = None) ndarray

Calculate the gyration tensor of a set of coordinates.

Parameters:
  • coordinates (np.ndarray) – A 2D array of shape (N, 3) representing spatial coordinates.

  • masses (Iterable, optional) – An iterable of length N representing the masses of each point.

Returns:

The 3x3 gyration tensor.

Return type:

np.ndarray

Examples

>>> calc_gyration_tensor(np.random.rand(5, 3))