Python API

The Python calculators accept either NumPy arrays on CPU or CuPy arrays on CUDA.

class sphericart.SphericalHarmonics(l_max: int)

Spherical harmonics calculator, which computes the real spherical harmonics \(Y^m_l\) up to degree l_max.

The calculator accepts either NumPy arrays on CPU or CuPy arrays on CUDA.

compute(xyz)

Calculate spherical harmonics for an (n_samples, 3) array.

compute_with_gradients(xyz) Tuple[object, object]

Calculate spherical harmonics and Cartesian gradients.

compute_with_hessians(xyz) Tuple[object, object, object]

Calculate spherical harmonics, gradients, and Hessians.

class sphericart.SolidHarmonics(l_max: int)

Solid harmonics calculator, up to degree l_max.

The calculator accepts either NumPy arrays on CPU or CuPy arrays on CUDA.

compute(xyz)

Calculate solid harmonics for an (n_samples, 3) array.

compute_with_gradients(xyz) Tuple[object, object]

Calculate solid harmonics and Cartesian gradients.

compute_with_hessians(xyz) Tuple[object, object, object]

Calculate solid harmonics, gradients, and Hessians.