Module harmonics

Module harmonics 

Source
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.
SolidTable πŸ”’
Solid harmonics r^p P_p^m e^(i m phi) of every degree p <= order and 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 r and direction x / r of a displacement x. Scaling by the largest component first keeps both accurate where |x|^2 under- or overflows.
harmonic_normalization πŸ”’
sqrt((2l + 1) / 4 pi) sqrt((l - m)! / (l + m)!), which turns P_l^m(cos theta) exp(i m phi) into the orthonormal spherical harmonic Y_lm.
on_sphere πŸ”’
Y = P_l^m(cos theta) exp(i m phi) at a unit vector u and its tangential gradient grad S(u) - l S(u) u, where S is the degree-l solid harmonic with S(u) = Y. The tangential gradient is r times the Cartesian gradient of Y at r 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 + m of (p, m) in a harmonic table.
tangent πŸ”’
The tangential part grad S(u) - l S(u) u of a degree-l solid harmonic’s gradient.