Spherical Harmonics

Harmonics viewer
SH decomposition
2
1
drag to rotate · scroll to zoom · all panels linked

Spherical harmonics Ylm(θ, φ)

Spherical harmonics are the natural basis functions for the sphere — the analogue of sines and cosines on a circle. They appear throughout quantum mechanics as the angular part of atomic wavefunctions, and in any problem with spherical geometry.

Each panel shows a 3D polar plot: the distance from the origin in direction (θ,φ) equals the absolute value of the plotted quantity in that direction. Colour encodes the signed value.

Left — Re[Ylm]: Real part. Blue = negative, red = positive. For m=0 the harmonic is entirely real.
Centre — Im[Ylm]: Imaginary part. Zero when m=0.
Right — |Ylm|²: Angular probability density — always non-negative. This is the quantity that appears directly in quantum mechanical probabilities.

Quantum numbers: l ≥ 0 is the angular momentum quantum number; m with |m| ≤ l is the magnetic quantum number. The number of nodal surfaces equals l, with |m| nodal cones and (l−|m|) nodal planes.

Try: l=0,m=0 (perfect sphere) · l=1,m=0 (pz dumbbell) · l=2,m=0 (d) · l=4,m=±4 (8-lobed clover)

Re[Y] x y z
Im[Y] x y z
|Y|² x y z
drag to rotate · scroll to zoom

Spherical harmonic decomposition

Any square-integrable function on the sphere can be written as f(θ,φ) = Σ clm Ylm(θ,φ), where the coefficients are clm = ∫ f(θ,φ) Ylm*(θ,φ) sinθ dθ dφ. This is the spherical analogue of a Fourier series.

Left — f(θ,φ): The original function. Radius = |f|, colour = signed value.
Centre — Approximation: Partial sum including all terms up to l = lmax. The title shows the percentage of signal captured.
Right — Residual: f minus the approximation, on a fixed ±1 colour scale so you can watch it shrink as lmax grows.

Power spectrum (bottom): Each bar shows Σm|clm|² for that l — the "energy" at each angular scale. Blue bars are included in the current sum.

Try: Y₁⁰ and Y₁¹ (sine) are exact at lmax=1 · step shows Gibbs ringing · McIntyre Ex. 7.5 has power only at even l (converges well by lmax=6)

f(θ,φ) x y z
Approximation x y z
Residual (fixed ±1) x y z