xnn.gnn.featurizers.spherical_bessel.real_spherical_harmonics#

xnn.gnn.featurizers.spherical_bessel.real_spherical_harmonics(l_max, x, y, z)[source]#

Real spherical harmonics Y_lm of a unit vector, degrees 0 to l_max.

Orthonormal on the sphere, without the Condon-Shortley phase: Y_l0 = N_l0 P_l(z), Y_lm = sqrt(2) N_lm P_l^m(z) cos(m phi) and Y_l,-m = sqrt(2) N_lm P_l^m(z) sin(m phi) for m > 0, with N_lm = sqrt((2l+1)/(4 pi) (l-m)!/(l+m)!). They are evaluated as polynomials in the Cartesian components (float64 internally), so they are smooth everywhere on the sphere, the poles included.

Parameters:
  • l_max (int) – Highest degree.

  • x (Tensor) – Components of unit vectors, all of the same shape; z is the polar axis and the azimuth is measured from x towards y.

  • y (Tensor) – Components of unit vectors, all of the same shape; z is the polar axis and the azimuth is measured from x towards y.

  • z (Tensor) – Components of unit vectors, all of the same shape; z is the polar axis and the azimuth is measured from x towards y.

Returns:

Shape (..., (l_max + 1)**2), degree-major with m = -l .. l within each degree (column l**2 + l + m), in the dtype of z.

Return type:

Tensor