spherical_harmonics#

cuequivariance_jax.spherical_harmonics(
ls: list[int],
vector: RepArray,
normalize: bool = True,
) RepArray#

Compute the spherical harmonics of a vector.

The spherical harmonics are polynomials of an input vector. This function computes the polynomials of the specified degrees.

Parameters:
  • ls (list[int]) – List of spherical harmonic degrees. Each degree must be non-negative.

  • vector (RepArray) – Input vector. Must be a single vector (multiplicity 1) with 3 components.

  • normalize (bool, optional) – Whether to normalize the vector before computing the spherical harmonics. Defaults to True.

Returns:

The spherical harmonics of the vector, containing the polynomials of each specified degree.

Return type:

RepArray

Example

>>> import cuequivariance_jax as cuex
>>> vector = cuex.randn(jax.random.key(0), cue.IrrepsAndLayout(cue.Irreps(cue.O3, "1o"), cue.mul_ir))
>>> harmonics = spherical_harmonics([0, 1, 2], vector)