mindscience.e3nn.o3.spherical_harmonics

mindscience.e3nn.o3.spherical_harmonics(l, x, normalize=True, normalization='integral')[source]

Compute spherical harmonics.

Spherical harmonics are polynomials defined on the 3d space:

\[Y^l: \mathbb{R}^3 \longrightarrow \mathbb{R}^{2l+1}\]

Usually restricted on the sphere (with normalize=True) :

\[Y^l: S^2 \longrightarrow \mathbb{R}^{2l+1}\]

who satisfies the following properties:

  • are polynomials of the cartesian coordinates x, y, z

  • is equivariant \(Y^l(R x) = D^l(R) Y^l(x)\)

  • are orthogonal \(\int_{S^2} Y^l_m(x) Y^j_n(x) dx = \text{cste} \; \delta_{lj} \delta_{mn}\)

The value of the constant depends on the choice of normalization.

It obeys the following property:

\[Y^{l+1}_i(x) &= \text{cste}(l) \; & C_{ijk} Y^l_j(x) x_k \partial_k Y^{l+1}_i(x) &= \text{cste}(l) \; (l+1) & C_{ijk} Y^l_j(x)\]

where \(C\) are the wigner_3j.

Parameters
  • l (Union[int, list[int]]) – degree of the spherical harmonics.

  • x (Tensor) – tensor for construct spherical harmonics. The shape of Tensor is \(x\) of shape (..., 3)

  • normalize (bool, optional) – whether to normalize the x to unit vectors that lie on the sphere before projecting onto the spherical harmonics. Default: True.

  • normalization (str, optional) –

    {'integral', 'component', 'norm'}, normalization method of the output tensors. Default: 'intergral'.

    • 'component': \(\|Y^l(x)\|^2 = 2l+1, x \in S^2\)

    • 'norm': \(\|Y^l(x)\| = 1, x \in S^2\), component / sqrt(2l+1)

    • 'integral': \(\int_{S^2} Y^l_m(x)^2 dx = 1\), component / sqrt(4pi)

Returns

Tensor, the spherical harmonics \(Y^l(x)\). The shape of Tensor is (..., 2l+1).

Raises
  • ValueError – If normalization is not in {'integral', 'component', 'norm'}.

  • ValueError – If irreps_in for SphericalHarmonics is not neither a vector (1x1o) nor a pseudovector (1x1e).

  • ValueError – If the l and p of irreps_out are not consistent with irreps_in for spherical harmonics. The output parity should have been p = {input_p**l}.

  • ValueError – If the tensor x is not the shape of (..., 3).

  • NotImplementedError – If l is larger than 11.