Expand description
Cartesian solid harmonics r^l P_l^m(z/r) e^(i m phi) with their gradients and Hessians,
singly or tabulated for every degree and order, their values and tangential gradients
on the unit sphere, and the normalization of spherical harmonics.
treams-rs extension. Solid harmonics are polynomials in x, y, z, so they and their
derivatives stay finite on the polar axis and at the origin. Spherical translations,
lattice sums and field evaluations use them.
StructsΒ§
- Solid π
- A solid harmonic and its Cartesian derivatives.
- Solid
Table π - Solid harmonics
r^p P_p^m e^(i m phi)of every degreep <= orderand order|m| <= p, from one degree recurrence per|m|rather than one per entry, with the order-reflection factors of negative orders precomputed.
FunctionsΒ§
- direction π
- Length
rand directionx / rof a displacementx. Scaling by the largest component first keeps both accurate where|x|^2under- or overflows. - harmonic_
normalization π sqrt((2l + 1) / 4 pi) sqrt((l - m)! / (l + m)!), which turnsP_l^m(cos theta) exp(i m phi)into the orthonormal spherical harmonicY_lm.- on_
sphere π Y = P_l^m(cos theta) exp(i m phi)at a unit vectoruand its tangential gradientgrad S(u) - l S(u) u, whereSis the degree-lsolid harmonic withS(u) = Y. The tangential gradient isrtimes the Cartesian gradient ofYatr u.- solid π
r^l P_l^m(z/r) exp(i m phi), zero for|m| > l. The second derivative is compiled out unless requested.- table_
index π - Position
p * p + p + mof(p, m)in a harmonic table. - tangent π
- The tangential part
grad S(u) - l S(u) uof a degree-lsolid harmonicβs gradient.