Skip to main content

geom.inertia_tensor()

Calculate the inertia tensor about the center of mass.

Usage

Source

geom.inertia_tensor(geo)

Parameters

geo: Geometry
Geometry.

Returns

np.ndarray
Inertia tensor, shape (3, 3) (zero for an empty geometry).

Examples

    >>> geo = Geometry(
    ...     symbols=["O", "H", "H"],
    ...     coordinates=[[0, 0, 0], [1, 0, 0], [0, 1, 0]],
    ...     charge=0,
    ...     spin=0,
    ... )
    >>> tensor = inertia_tensor(geo)
    >>> tensor.shape
(3, 3)
    >>> bool(np.allclose(tensor, tensor.T))
True