Type at least 2 letters. Enter opens the first result, Esc closes.

    ML for Science · Lesson 9 · Neural operators, symmetry and physics

    Spherical harmonics and spherical Fourier neural operators

    Advanced 100 min 5 interactive figures 3 videos Colab notebook

    Before this lesson: lesson 08 (the FFT, spectral derivatives, aliasing and the Fourier neural operator). Helpful: linear algebra lesson 19 (equivariance) and calculus lesson 11 (Gauss–Hermite quadrature, a close relative of the Gauss–Legendre rule used here). Time: about 100 minutes, plus the notebook.


    Why this matters #

    • Weather and climate models are on the sphere. ERA5, the standard reanalysis used to train ML weather models, has 721×1440721 \times 1440 points (a 0.25°0.25° grid). Every row has 1440 points. The east–west spacing is about 28 km at the equator and about 120 m on the row next to the pole. Methods that treat the grid as a flat image waste points near the poles and see a false seam.
    • Spectral models. ECMWF's IFS computes derivatives, diffusion and its semi-implicit time step in spherical-harmonic space. Its high-resolution forecast uses the truncation TCo1279, about 9 km grid spacing (ECMWF documentation, as of 2026). The dynamical core of the hybrid model NeuralGCM (Kochkov et al., 2024) is also spectral, at resolutions from 2.8° to 0.7°.
    • ML weather and climate models. The SFNO (Bonev et al., 2023) replaced the flat 2D FFT of FourCastNet by the SHT. The paper reports stable autoregressive rollouts over a simulated year (1460 steps of 6 hours). SFNO is also the base of the ACE climate emulator (Watt-Meyer et al., 2023). Lesson 16 puts these models side by side.
    • Geophysics and seismology. Global models of the mantle from seismic tomography (for example S40RTS, up to degree 40), Earth's gravity field (EGM2008, to degree 2159) and the main geomagnetic field (IGRF, to degree 13) are all published as spherical-harmonic coefficients. The free oscillations of the Earth after a large earthquake are labelled by their degree ll.
    • Equivariant networks. Real spherical harmonics are the features of the E(3)-equivariant networks of lesson 10.

    1. Predict first #

    2. The picture #

    The grid problem #

    Use the colatitude θ∈[0,π]\theta \in [0, \pi] (θ=0\theta = 0 at the North Pole, θ=π/2\theta = \pi/2 on the equator) and the longitude ϕ∈[0,2π)\phi \in [0, 2\pi). The latitude is 90°−θ90° - \theta. The area element of the unit sphere is dΩ=sin⁡θ dθ dϕd\Omega = \sin\theta\,d\theta\,d\phi: a band near a pole has little area because sin⁡θ\sin\theta is small there.

    A regular latitude–longitude grid puts the same number of points on every row. So the points crowd together near the poles.

    Interactive figure: loading…

    Move the latitude slider and compare the two bars: the share of the grid points (orange) with |latitude| ≥ bb and the share of the area (blue) there, which is 1−sin⁡b1 - \sin b. Notice that at b=60°b = 60° the polar caps (yellow) hold 34 % of the points of a 1° grid but only 13 % of the area. Drag the sphere to look at a pole: the rows become tiny circles.

    So a lat–lon field is not a nice periodic image. Latitude is not periodic at all: the row at the North Pole is not a neighbour of the row at the South Pole. The right basis must be built for the sphere.

    From the circle to the sphere #

    On one circle of latitude, a field is a periodic function of ϕ\phi. So it is a Fourier series in ϕ\phi, exactly as in lesson 08: modes cos⁡mϕ\cos m\phi and sin⁡mϕ\sin m\phi with an integer order mm. The coefficient of each mode is a function of the colatitude. For each mm we expand this function in a second family, the associated Legendre functions Pˉlm(cos⁡θ)\bar P_l^m(\cos\theta) with l=m,m+1,…l = m, m+1, \dots The product of the two is a spherical harmonic:

    Yl0(θ,ϕ)=Pˉl0(cos⁡θ),Ylm(θ,ϕ)=2 Pˉlm(cos⁡θ)cos⁡mϕ(m>0),Yl−m(θ,ϕ)=2 Pˉlm(cos⁡θ)sin⁡mϕ(m>0).\begin{aligned} Y_l^0(\theta, \phi) &= \bar P_l^0(\cos\theta), \\ Y_l^m(\theta, \phi) &= \sqrt2\,\bar P_l^m(\cos\theta)\cos m\phi \qquad (m > 0), \\ Y_l^{-m}(\theta, \phi) &= \sqrt2\,\bar P_l^m(\cos\theta)\sin m\phi \qquad (m > 0). \end{aligned}

    The degree l=0,1,2,…l = 0, 1, 2, \dots is the total wavenumber. The order mm, with −l≤m≤l-l \le m \le l, is the east–west wavenumber. Each YlmY_l^m is a standing wave on the sphere. Its zero set (the nodal lines) has ∣m∣|m| great circles through the poles and l−∣m∣l - |m| circles of latitude.

    The first few, up to constant factors:

    • Y00Y_0^0: a constant (the global mean);
    • Y10∝cos⁡θY_1^0 \propto \cos\theta: warm in the north, cold in the south;
    • Y11∝sin⁡θcos⁡ϕY_1^1 \propto \sin\theta\cos\phi and Y1−1∝sin⁡θsin⁡ϕY_1^{-1} \propto \sin\theta\sin\phi: an east–west tilt;
    • Y20∝3cos⁡2θ−1Y_2^0 \propto 3\cos^2\theta - 1; Y22∝sin⁡2θcos⁡2ϕY_2^2 \propto \sin^2\theta\cos 2\phi.
    Interactive figure: loading…

    Move the degree ll and the order mm. Orange is positive, blue is negative, and the dark lines are the nodal lines. Count them: ∣m∣|m| great circles through the poles and l−∣m∣l - |m| circles of latitude. Try "zonal" (m=0m = 0: bands of latitude), "sectoral" (∣m∣=l|m| = l: only meridians) and "tesseral" (a checkerboard). Switch to the map view to see the same harmonic on a longitude–latitude rectangle.

    Why the poles cause no trouble. Pˉlm(cos⁡θ)\bar P_l^m(\cos\theta) contains the factor sin⁡∣m∣θ\sin^{|m|}\theta. So a mode with a large order mm is almost zero near the poles. Fine east–west waves cannot live on the tiny circles near a pole, and the basis does not need them there. A degree ll has a wavelength of about 2πa/l2\pi a/l on a sphere of radius aa: on Earth (a=6371a = 6371 km), l=639l = 639 gives about 63 km.

    Quick check

    How many nodal lines does Y4−1Y_4^{-1} have, and of which kind?

    Quick check

    The Laplacian on the unit sphere maps Y3mY_3^m to which multiple of itself (for every mm from −3-3 to 33)?

    3. Definitions and main results #

    3.1 The Laplacian on the sphere #

    Write x=cos⁡θx = \cos\theta (so x=1x = 1 at the North Pole and x=−1x = -1 at the South Pole). On the unit sphere the Laplace–Beltrami operator (the Laplacian of the sphere) is

    ∇2f=1sin⁡θ ∂θ(sin⁡θ ∂θf)+1sin⁡2θ ∂ϕ2f=∂x((1−x2) ∂xf)+11−x2 ∂ϕ2f.\begin{aligned} \nabla^2 f &= \frac{1}{\sin\theta}\,\partial_\theta\big(\sin\theta\,\partial_\theta f\big) + \frac{1}{\sin^2\theta}\,\partial_\phi^2 f \\ &= \partial_x\big((1 - x^2)\,\partial_x f\big) + \frac{1}{1 - x^2}\,\partial_\phi^2 f . \end{aligned}

    For the second form use ∂θ=−sin⁡θ ∂x\partial_\theta = -\sin\theta\,\partial_x and sin⁡2θ=1−x2\sin^2\theta = 1 - x^2. The area element is dΩ=sin⁡θ dθ dϕ=dx dϕd\Omega = \sin\theta\,d\theta\,d\phi = dx\,d\phi (up to the sign of dxdx).

    3.2 Associated Legendre functions and spherical harmonics #

    Definition. For integers 0≤m≤l0 \le m \le l, with PlP_l the Legendre polynomial of degree ll, the normalised associated Legendre function is

    Pˉlm(x)=Nlm (1−x2)m/2 dmdxmPl(x),Nlm=2l+14π (l−m)!(l+m)!.\bar P_l^m(x) = N_l^m\,(1 - x^2)^{m/2}\,\frac{d^m}{dx^m}P_l(x), \qquad N_l^m = \sqrt{\frac{2l + 1}{4\pi}\,\frac{(l - m)!}{(l + m)!}} .

    It solves the associated Legendre equation

    ((1−x2) y′)′+[l(l+1)−m21−x2] y=0\big((1 - x^2)\,y'\big)' + \Big[l(l+1) - \frac{m^2}{1 - x^2}\Big]\,y = 0

    and is bounded at x=±1x = \pm 1. The real spherical harmonics YlmY_l^m are the products of section 2. They are orthonormal: ∫S2Ylm Yl′m′ dΩ=δll′ δmm′\int_{S^2} Y_l^m\,Y_{l'}^{m'}\,d\Omega = \delta_{ll'}\,\delta_{mm'}. The factor 2\sqrt2 for m≠0m \ne 0 is there because ∫02πcos⁡2mϕ dϕ=π\int_0^{2\pi}\cos^2 m\phi\,d\phi = \pi, while ∫02π1 dϕ=2π\int_0^{2\pi} 1\,d\phi = 2\pi.

    3.3 Theorem 1: spherical harmonics are eigenfunctions of the Laplacian #

    Why this is true (intuition). In longitude, cos⁡mϕ\cos m\phi is an eigenfunction of ∂ϕ2\partial_\phi^2 with eigenvalue −m2-m^2, as on a circle. In latitude, the associated Legendre equation is exactly the condition that the remaining part gives −l(l+1)-l(l+1).

    Proof.

    1. Take m≥0m \ge 0 and write Y=Pˉ(x) cos⁡mϕY = \bar P(x)\,\cos m\phi with Pˉ=Pˉlm\bar P = \bar P_l^m (the sin⁡mϕ\sin m\phi case is the same). Then ∂ϕ2Y=−m2 Y\partial_\phi^2 Y = -m^2\,Y.
    2. With the xx form of the operator, ∇2Y=[((1−x2) Pˉ′)′−m21−x2 Pˉ]cos⁡mϕ\nabla^2 Y = \Big[\big((1 - x^2)\,\bar P'\big)' - \dfrac{m^2}{1 - x^2}\,\bar P\Big]\cos m\phi.
    3. Pˉ\bar P solves the associated Legendre equation, so the bracket equals −l(l+1) Pˉ-l(l+1)\,\bar P. A constant factor does not change this, so the normalisation plays no role.
    4. Hence ∇2Y=−l(l+1) Y\nabla^2 Y = -l(l+1)\,Y. On a sphere of radius aa, each of the two derivatives carries a factor 1/a1/a, which gives −l(l+1)/a2-l(l+1)/a^2. ■\blacksquare

    Consequences.

    • The eigenvalue depends on ll only. All 2l+12l + 1 harmonics of degree ll share it. This is the rotation symmetry of the sphere at work (section 3.8).
    • Spectral calculus. If f=∑l,malmYlmf = \sum_{l,m} a_l^m Y_l^m, then ∇2f\nabla^2 f has the coefficients −l(l+1)a2 alm-\tfrac{l(l+1)}{a^2}\,a_l^m.
    • Poisson's equation is a division. The streamfunction ψ\psi of a vorticity field ζ\zeta solves ∇2ψ=ζ\nabla^2\psi = \zeta, so ψlm=−a2 ζlm/(l(l+1))\psi_l^m = -a^2\,\zeta_l^m/(l(l+1)) for l≥1l \ge 1. At l=0l = 0 the eigenvalue is 0: the global mean of ζ\zeta must be zero, and the mean of ψ\psi is free (set it to 0).
    • Diffusion is a damping per degree. ∂tu=ν∇2u\partial_t u = \nu\nabla^2 u multiplies each coefficient by e−νl(l+1)t/a2e^{-\nu l(l+1)t/a^2}. Spectral models apply (hyper)diffusion this way.
    • The longitude derivative is also diagonal: it maps the pair (Ylm,Yl−m)(Y_l^m, Y_l^{-m}) to (−m Yl−m,m Ylm)(-m\,Y_l^{-m}, m\,Y_l^m). The latitude derivative is not diagonal: sin⁡θ ∂θ\sin\theta\,\partial_\theta maps degree ll to a combination of degrees l−1l - 1 and l+1l + 1.

    3.4 Triangular truncation #

    A field is band-limited to NN if it has no harmonics of degree above NN. The triangular truncation TNT_N keeps all 0≤l≤N0 \le l \le N and −l≤m≤l-l \le m \le l: that is ∑l=0N(2l+1)=(N+1)2\sum_{l=0}^N (2l + 1) = (N + 1)^2 real coefficients. "T79" or "T639" in the weather literature means this truncation.

    Triangular truncation is the natural choice because its resolution is the same everywhere on the globe. The addition theorem says ∑m=−ll(Ylm(θ,ϕ))2=(2l+1)/(4π)\sum_{m=-l}^{l} \big(Y_l^m(\theta, \phi)\big)^2 = (2l + 1)/(4\pi) at every point. So no place, and no direction, is preferred. The set of all TNT_N fields is also mapped to itself by every rotation (section 3.8).

    Interactive figure: loading…

    Move the band limit NN and watch the map and the power spectrum El=∑m(alm)2E_l = \sum_m (a_l^m)^2 (one dot per degree). The orange dots are kept, the grey ones are dropped, and the dashed line is NN. Notice that the small storm (the narrow bump) needs about N≥30N \ge 30 to appear with its full height. Switch to "sharp front": its spectrum falls slowly, and the truncated field shows ripples along the front (the Gibbs effect of lesson 08). Use "error" to see where the truncated field differs from the original.

    3.5 Computing Pˉlm\bar P_l^m: the stable recursion #

    The closed formula of section 3.2 is useless for large ll. The factorials overflow (171! is larger than the largest float64), and high derivatives of polynomials lose all digits to cancellation. Use a recursion for each order mm, directly on the normalised functions:

    1. Start: Pˉ00=1/4π\bar P_0^0 = 1/\sqrt{4\pi}.
    2. Diagonal: Pˉmm=2m+12m 1−x2  Pˉm−1m−1\bar P_m^m = \sqrt{\dfrac{2m+1}{2m}}\,\sqrt{1 - x^2}\;\bar P_{m-1}^{m-1}.
    3. First step off the diagonal: Pˉm+1m=2m+3  x Pˉmm\bar P_{m+1}^m = \sqrt{2m + 3}\;x\,\bar P_m^m.
    4. Three-term recursion in ll, for l≥m+2l \ge m + 2:
    Pˉlm=αlm x Pˉl−1m−βlm Pˉl−2m,\bar P_l^m = \alpha_l^m\,x\,\bar P_{l-1}^m - \beta_l^m\,\bar P_{l-2}^m,
    αlm=4l2−1l2−m2,βlm=((l−1)2−m2)(2l+1)(l2−m2)(2l−3).\alpha_l^m = \sqrt{\frac{4l^2 - 1}{l^2 - m^2}}, \qquad \beta_l^m = \sqrt{\frac{\big((l-1)^2 - m^2\big)(2l + 1)}{(l^2 - m^2)(2l - 3)}} .

    The numbers αlm\alpha_l^m and βlm\beta_l^m are fixed; they are not the coefficients alma_l^m of a field. All values stay of moderate size, so nothing overflows. The values agree with SciPy (after the phase and the normalisation are matched) to about 10−1410^{-14} for l≤20l \le 20. This is the recursion of torch-harmonics and, in an equivalent form, of SHTns.

    Very high degrees

    For NN in the thousands, Pˉmm∝sin⁡mθ\bar P_m^m \propto \sin^m\theta underflows near the poles. At the polar node of a 1280-latitude Gauss grid, sin⁡θ≈1.9×10−3\sin\theta \approx 1.9 \times 10^{-3}, and sin⁡1279θ≈10−3487\sin^{1279}\theta \approx 10^{-3487}. These values are negligible: the harmonic is zero there for all practical purposes. Libraries skip them, or use scaled (extended-exponent) arithmetic.

    3.6 Gauss–Legendre quadrature #

    The SHT must compute integrals over latitude, ∫−11g(x) dx\int_{-1}^1 g(x)\,dx, from samples. A quadrature rule with KK nodes xjx_j and weights wjw_j approximates ∫−11g(x) dx≈∑j=1Kwj g(xj)\int_{-1}^1 g(x)\,dx \approx \sum_{j=1}^K w_j\,g(x_j). With equispaced nodes and well-chosen weights you can integrate every polynomial of degree K−1K - 1 exactly. If you may also choose the nodes, you can do twice as well.

    Definition. The Gauss–Legendre rule with KK nodes uses the KK roots of the Legendre polynomial PKP_K as nodes, and the weights wj=∫−11ℓj(x) dxw_j = \int_{-1}^1 \ell_j(x)\,dx, where ℓj\ell_j is the Lagrange polynomial that is 1 at xjx_j and 0 at the other nodes.

    Proof
    1. Let pp have degree ≤2K−1\le 2K - 1. Divide by PKP_K: p=q PK+rp = q\,P_K + r, with deg⁡q≤K−1\deg q \le K - 1 and deg⁡r≤K−1\deg r \le K - 1.
    2. PKP_K is orthogonal to every polynomial of lower degree, so ∫−11q PK dx=0\int_{-1}^1 q\,P_K\,dx = 0. Hence ∫p=∫r\int p = \int r.
    3. At the nodes PK(xj)=0P_K(x_j) = 0, so p(xj)=r(xj)p(x_j) = r(x_j). Hence ∑jwj p(xj)=∑jwj r(xj)\sum_j w_j\,p(x_j) = \sum_j w_j\,r(x_j).
    4. rr has degree ≤K−1\le K - 1, so it equals its Lagrange interpolant ∑jr(xj) ℓj\sum_j r(x_j)\,\ell_j. Integrate: ∫r=∑jr(xj)∫ℓj=∑jwj r(xj)\int r = \sum_j r(x_j)\int\ell_j = \sum_j w_j\,r(x_j).
    5. Steps 2–4 give ∑jwj p(xj)=∫p\sum_j w_j\,p(x_j) = \int p. For degree 2K2K, take p=PK2p = P_K^2: its integral is positive, but the rule gives 0. ■\blacksquare
    Interactive figure: loading…

    Choose the number of nodes KK and the degree dd of the test integrand ((1+x)/2)d((1 + x)/2)^d (blue curve). The orange dots and bars are the nodes and the weights. The lower chart shows the relative error for every degree: it stays at rounding level inside the aqua band (d≤2K−1d \le 2K - 1) and jumps up right after it. The yellow dot is your dd.

    Quick check

    A latitude integrand is a polynomial of degree 9. What is the smallest number of Gauss–Legendre nodes that integrates it exactly?

    3.7 Theorem 2: the SHT on a Gauss grid is exact #

    Grid. NlatN_{\text{lat}} Gauss–Legendre nodes xjx_j (colatitudes θj=arccos⁡xj\theta_j = \arccos x_j) with weights wjw_j, and NlonN_{\text{lon}} equispaced longitudes ϕk=2πk/Nlon\phi_k = 2\pi k/N_{\text{lon}}. This is a Gaussian grid.

    Analysis (grid → coefficients). For each order m≥0m \ge 0:

    1. FFT along each row: Fm(xj)=1Nlon∑kf(xj,ϕk) e−imϕkF_m(x_j) = \dfrac{1}{N_{\text{lon}}}\sum_k f(x_j, \phi_k)\,e^{-im\phi_k}.
    2. Legendre step, one matrix–vector product per mm: clm=2π∑jwj Fm(xj) Pˉlm(xj)c_l^m = 2\pi\sum_j w_j\,F_m(x_j)\,\bar P_l^m(x_j).
    3. Real coefficients: al0=cl0a_l^0 = c_l^0 and, for m>0m > 0, alm=2 Re⁡clma_l^m = \sqrt2\,\operatorname{Re} c_l^m, al−m=−2 Im⁡clma_l^{-m} = -\sqrt2\,\operatorname{Im} c_l^m.

    Synthesis (coefficients → grid): set cl0=al0c_l^0 = a_l^0 and clm=(alm−i al−m)/2c_l^m = (a_l^m - i\,a_l^{-m})/\sqrt2; then Fm(xj)=∑l=mNclm Pˉlm(xj)F_m(x_j) = \sum_{l=m}^N c_l^m\,\bar P_l^m(x_j), and f(xj,ϕk)=F0+2Re⁡∑m>0Fm(xj) eimϕkf(x_j, \phi_k) = F_0 + 2\operatorname{Re}\sum_{m>0}F_m(x_j)\,e^{im\phi_k} (an inverse real FFT).

    Proof of Theorem 2
    1. The continuous formula. By orthonormality alm=∫f Ylm dΩa_l^m = \int f\,Y_l^m\,d\Omega. Do the longitude integral first. With Fm(x)=12π∫02πf e−imϕ dϕF_m(x) = \frac{1}{2\pi}\int_0^{2\pi} f\,e^{-im\phi}\,d\phi and clm=2π∫−11Fm(x) Pˉlm(x) dxc_l^m = 2\pi\int_{-1}^1 F_m(x)\,\bar P_l^m(x)\,dx, one checks alm=2Re⁡clma_l^m = \sqrt2\operatorname{Re} c_l^m and al−m=−2Im⁡clma_l^{-m} = -\sqrt2\operatorname{Im} c_l^m (use cos⁡mϕ=Re⁡e−imϕ\cos m\phi = \operatorname{Re} e^{-im\phi} and sin⁡mϕ=−Im⁡e−imϕ\sin m\phi = -\operatorname{Im} e^{-im\phi}).
    2. Longitude. On a row, ff is a trigonometric polynomial with orders ∣m′∣≤N|m'| \le N. The discrete sum 1Nlon∑kei(m′−m)ϕk\frac{1}{N_{\text{lon}}}\sum_k e^{i(m' - m)\phi_k} is 1 if m′−mm' - m is a multiple of NlonN_{\text{lon}} and 0 otherwise (lesson 08, Theorem 1). Since ∣m′−m∣≤2N<Nlon|m' - m| \le 2N < N_{\text{lon}}, only m′=mm' = m survives: step 1 gives the exact Fm(xj)F_m(x_j).
    3. Latitude. Fm(x)F_m(x) is a combination of Pˉl′m(x)\bar P_{l'}^m(x) with l′≤Nl' \le N. Each Pˉlm\bar P_l^m is (1−x2)m/2(1 - x^2)^{m/2} times a polynomial of degree l−ml - m. So the product Pˉl′mPˉlm\bar P_{l'}^m\bar P_l^m of two functions with the same mm is (1−x2)m(1 - x^2)^m times a polynomial of degree l+l′−2ml + l' - 2m: a polynomial of degree l+l′≤2Nl + l' \le 2N. (For odd mm one Pˉlm\bar P_l^m alone is not a polynomial; the product is.)
    4. Quadrature. NlatN_{\text{lat}} Gauss nodes are exact up to degree 2Nlat−1≥2N+12N_{\text{lat}} - 1 \ge 2N + 1. So step 2 equals the integral of proof step 1. The synthesis is the exact evaluation of a finite sum, and the coefficients determine the field. ■\blacksquare

    Two traps show that both bounds are sharp (we use them again in section 4):

    • With Nlat=NN_{\text{lat}} = N nodes, the nodes are the roots of PNP_N, and YN0∝PN(cos⁡θ)Y_N^0 \propto P_N(\cos\theta) is zero at every grid point. The grid cannot see it.
    • With Nlon=2NN_{\text{lon}} = 2N, sin⁡(Nϕk)=sin⁡(πk)=0\sin(N\phi_k) = \sin(\pi k) = 0 at every grid longitude. The mode YN−NY_N^{-N} is invisible.

    Cost. The FFTs cost O(NlatNlonlog⁡Nlon)=O(N2log⁡N)O(N_{\text{lat}}N_{\text{lon}}\log N_{\text{lon}}) = O(N^2\log N). The Legendre step costs about (N+1−m) Nlat(N + 1 - m)\,N_{\text{lat}} per order, so O(N3)O(N^3) in total: it dominates for large NN. The symmetry Pˉlm(−x)=(−1)l+m Pˉlm(x)\bar P_l^m(-x) = (-1)^{l+m}\,\bar P_l^m(x) saves a factor 2, and on GPUs the step is a batch of dense matrix products.

    Products, dealiasing and other grids

    The product of two TNT_N fields has degrees up to 2N2N, as in 1D (lesson 08). To get the TNT_N coefficients of a product without aliasing, the integrands have degree up to 3N3N. Then you need Nlat≥(3N+1)/2N_{\text{lat}} \ge (3N + 1)/2 and Nlon≥3N+1N_{\text{lon}} \ge 3N + 1: the quadratic grid, the spherical form of the 2/3 rule (Boyd, §18.12). The minimal grid of Theorem 2 is the linear grid. ECMWF's IFS uses an even finer cubic octahedral grid, which also has fewer points per row near the poles. An equiangular grid such as ERA5's has no Gauss nodes. Exact quadrature on it needs about twice as many latitudes (Driscoll and Healy, 1994).

    3.8 Rotations, spherical convolution and the SFNO layer #

    Rotations keep the degree. Let RR be a rotation and fR(x^)=f(R−1x^)f_R(\hat x) = f(R^{-1}\hat x) the rotated field. The rotated version of a degree-ll harmonic is again a combination of degree-ll harmonics. Reason: the Laplacian commutes with rotations (it is defined by the geometry of the sphere), so it maps the eigenspace of −l(l+1)-l(l+1) to itself. A rotation also keeps the inner product ∫fg dΩ\int fg\,d\Omega. Hence the vector al=(al−l,…,all)a_l = (a_l^{-l}, \dots, a_l^l) of the degree-ll coefficients changes by an orthogonal (2l+1)×(2l+1)(2l+1) \times (2l+1) matrix:

    al  ↦  Dl(R) al.a_l \;\mapsto\; D^l(R)\,a_l .

    Dl(R)D^l(R) is the real Wigner-D matrix; lesson 10 studies it in detail. Two consequences:

    • The power spectrum El=∑m(alm)2=∥al∥2E_l = \sum_m (a_l^m)^2 = \|a_l\|^2 does not change under rotations. It is the standard diagnostic of small-scale energy. An ML forecast trained with the MSE often loses power at high ll: it is blurry.
    • A rotation about the polar axis does not mix orders: it turns each pair (alm,al−m)(a_l^m, a_l^{-m}) by the angle mαm\alpha. Any other rotation mixes all orders mm of the same degree.

    Proof. On degree ll, TT is the matrix clIc_l I. Rotate first, then filter: cl Dl(R) alc_l\,D^l(R)\,a_l. Filter first, then rotate: Dl(R) (cl al)D^l(R)\,(c_l\,a_l). A multiple of the identity commutes with every matrix, so the two are equal for every ll. ■\blacksquare

    A diagonal factor clmc_{lm} that changes with mm is a diagonal matrix that is not a multiple of the identity. It does not commute with a Dl(R)D^l(R) that mixes the orders. Schur's lemma (lesson 10) says more: the only linear maps of the degree-ll space that commute with all rotations are multiples of the identity.

    Interactive figure: loading…

    Compare the two lower maps ("A: rotate, then filter" and "B: filter, then rotate") while you move the tilt β\beta. With the factor clc_l the maps are identical and the difference is about 10−1510^{-15}. Switch to the factor clmc_{lm} (it smooths only in the east–west direction): now the maps differ. Then set β=0°\beta = 0° and move only the spin α\alpha: the difference drops to rounding level again, because a rotation about the polar axis does not mix orders.

    Spherical convolution. On the circle, a convolution is a multiplication of Fourier coefficients (lesson 08). On the sphere, the convolution of a field with a kernel that is symmetric about the pole (a zonal kernel) multiplies the coefficients of degree ll by one number per degree. That number is proportional to the m=0m = 0 coefficient of the kernel at degree ll (Driscoll and Healy, 1994; SFNO paper, §4.1). So degree-wise filters are exactly the spherical convolutions.

    The SFNO layer. With channels v(x^)∈Rdvv(\hat x) \in \R^{d_v} at each point x^\hat x of the sphere, one layer is

    v′(x^)=σ(Wv(x^)+b+(Kv)(x^)),(Kv)^lm=Rl  v^lm(l≤lmax⁡),v'(\hat x) = \sigma\big(W v(\hat x) + b + (\mathcal K v)(\hat x)\big), \qquad \widehat{(\mathcal K v)}{}_l^m = R_l\;\hat v_l^m \quad (l \le l_{\max}),

    where v^lm∈Rdv\hat v_l^m \in \R^{d_v} are the SHT coefficients of the channels and Rl∈Rdv×dvR_l \in \R^{d_v \times d_v} is a learned matrix for each degree, with no dependence on mm. It is the FNO layer of lesson 08 with the FFT replaced by the SHT. RlR_l acts on the channel index and Dl(R)D^l(R) on the order index, so they commute: the linear part is exactly rotation-equivariant (Theorem 3 for each channel pair). The pointwise skip WW and the activation σ\sigma are equivariant on the continuous sphere; on a discrete grid the activation creates high degrees that alias, so the full network is only approximately equivariant (SFNO paper, §4.2).

    Quick check

    A spectral layer multiplies alma_l^m by learned weights wlmw_{lm} that depend on both ll and mm. Is it equivariant under all rotations of the sphere?

    Answers to section 1. (1) No. Latitude is not periodic: a 2D FFT makes the North-Pole row a neighbour of the South-Pole row and creates a false seam. The rows near the poles are tiny circles with as many points as the equator, and the flat Fourier modes are not smooth at the poles. Use the FFT only in longitude, and associated Legendre functions with Gauss quadrature in latitude. (2) N+1N + 1 Gauss latitudes and 2N+12N + 1 longitudes (Theorem 2). For exact products, use (3N+1)/2(3N + 1)/2 latitudes and 3N+13N + 1 longitudes. (3) Yes. A factor clc_l that depends only on the degree commutes with every rotation (Theorem 3). A factor that depends on mm does not, except for rotations about the polar axis.

    4. Worked example #

    Take f(θ,ϕ)=1+3cos⁡θ+sin⁡2θ cos⁡2ϕf(\theta, \phi) = 1 + 3\cos\theta + \sin^2\theta\,\cos 2\phi. Its highest degree is N=2N = 2.

    Step 1: the coefficients by hand. We need three harmonics:

    • Y00=Pˉ00=1/4πY_0^0 = \bar P_0^0 = 1/\sqrt{4\pi}. So 1=4π Y001 = \sqrt{4\pi}\,Y_0^0 and a00=4π=3.5449a_0^0 = \sqrt{4\pi} = 3.5449.
    • Pˉ10=3/(4π) x\bar P_1^0 = \sqrt{3/(4\pi)}\,x, so Y10=3/(4π)cos⁡θY_1^0 = \sqrt{3/(4\pi)}\cos\theta. Then 3cos⁡θ=34π/3 Y103\cos\theta = 3\sqrt{4\pi/3}\,Y_1^0 and a10=34π/3=23π=6.1400a_1^0 = 3\sqrt{4\pi/3} = 2\sqrt{3\pi} = 6.1400.
    • Pˉ22=54π0!4! (1−x2)⋅3=1415/(2π) sin⁡2θ\bar P_2^2 = \sqrt{\tfrac{5}{4\pi}\tfrac{0!}{4!}}\,(1 - x^2)\cdot 3 = \tfrac14\sqrt{15/(2\pi)}\,\sin^2\theta (because d2dx2P2=3\tfrac{d^2}{dx^2}P_2 = 3). So Y22=2 Pˉ22cos⁡2ϕ=1415/π sin⁡2θcos⁡2ϕY_2^2 = \sqrt2\,\bar P_2^2\cos 2\phi = \tfrac14\sqrt{15/\pi}\,\sin^2\theta\cos 2\phi, and a22=4π/15=1.8306a_2^2 = 4\sqrt{\pi/15} = 1.8306.

    All other coefficients are 0.

    Step 2: the grid. Theorem 2 needs Nlat≥3N_{\text{lat}} \ge 3 and Nlon≥5N_{\text{lon}} \ge 5. The 3-node Gauss rule has nodes x=−3/5, 0, 3/5x = -\sqrt{3/5},\ 0,\ \sqrt{3/5} (that is ±0.7746\pm 0.7746 and 0) and weights 5/9, 8/9, 5/95/9,\ 8/9,\ 5/9. Check its limit:

    • degree 4: ∑jwjxj4=2⋅59⋅925=25=∫−11x4 dx\sum_j w_j x_j^4 = 2 \cdot \tfrac59 \cdot \tfrac{9}{25} = \tfrac25 = \int_{-1}^1 x^4\,dx (exact);
    • degree 6: ∑jwjxj6=2⋅59⋅27125=0.24\sum_j w_j x_j^6 = 2 \cdot \tfrac59 \cdot \tfrac{27}{125} = 0.24, but ∫−11x6 dx=27=0.2857\int_{-1}^1 x^6\,dx = \tfrac27 = 0.2857.

    Degree 2N=42N = 4 is all we need.

    Step 3: analysis of a10a_1^0. On each row, the mean over the 5 longitudes is F0(x)=1+3xF_0(x) = 1 + 3x: the cos⁡2ϕ\cos 2\phi term sums to zero over 5 equispaced points. Then

    ∑jwj F0(xj) xj=59 (1−3⋅0.7746)(−0.7746)+89⋅1⋅0+59 (1+3⋅0.7746)(0.7746)=59⋅6⋅35=2,\begin{aligned} \sum_j w_j\,F_0(x_j)\,x_j &= \tfrac59\,(1 - 3 \cdot 0.7746)(-0.7746) + \tfrac89 \cdot 1 \cdot 0 + \tfrac59\,(1 + 3 \cdot 0.7746)(0.7746) \\ &= \tfrac59 \cdot 6 \cdot \tfrac35 = 2, \end{aligned}

    which equals ∫−11(1+3x) x dx=2\int_{-1}^1 (1 + 3x)\,x\,dx = 2. So c10=2π3/(4π)⋅2=23π=6.1400=a10c_1^0 = 2\pi\sqrt{3/(4\pi)} \cdot 2 = 2\sqrt{3\pi} = 6.1400 = a_1^0. ✓

    Step 4: analysis of a22a_2^2. On each row, F2(x)=15∑ksin⁡2θcos⁡2ϕk e−2iϕk=12(1−x2)F_2(x) = \tfrac15\sum_k \sin^2\theta\cos 2\phi_k\,e^{-2i\phi_k} = \tfrac12(1 - x^2). (Only the e2iϕe^{2i\phi} half of cos⁡2ϕ=12(e2iϕ+e−2iϕ)\cos 2\phi = \tfrac12(e^{2i\phi} + e^{-2i\phi}) survives; e−4iϕe^{-4i\phi} sums to 0 on 5 points.) Then

    c22=2π∑jwj 12(1−xj2)⋅14152π (1−xj2)=π4152π  ∑jwj(1−xj2)2.\begin{aligned} c_2^2 &= 2\pi\sum_j w_j\,\tfrac12(1 - x_j^2)\cdot\tfrac14\sqrt{\tfrac{15}{2\pi}}\,(1 - x_j^2) \\ &= \tfrac{\pi}{4}\sqrt{\tfrac{15}{2\pi}}\;\sum_j w_j(1 - x_j^2)^2 . \end{aligned}

    The sum is 2⋅59⋅(0.4)2+89⋅1=16152 \cdot \tfrac59 \cdot (0.4)^2 + \tfrac89 \cdot 1 = \tfrac{16}{15}, which is ∫−11(1−x2)2 dx\int_{-1}^1(1 - x^2)^2\,dx. So c22=1.2944c_2^2 = 1.2944 and a22=2 Re⁡c22=1.8306a_2^2 = \sqrt2\,\operatorname{Re} c_2^2 = 1.8306. ✓

    Step 5: the Laplacian. Multiply each coefficient by −l(l+1)-l(l+1): a00→0a_0^0 \to 0, a10→−2×6.1400=−12.280a_1^0 \to -2 \times 6.1400 = -12.280, a22→−6×1.8306=−10.983a_2^2 \to -6 \times 1.8306 = -10.983. Synthesis gives

    ∇2f=−6cos⁡θ−6sin⁡2θcos⁡2ϕ.\nabla^2 f = -6\cos\theta - 6\sin^2\theta\cos 2\phi .

    You can check this with the operator of section 3.1. The inverse Laplacian gives back ff up to a constant: the l=0l = 0 part is lost.

    Step 6: the two traps.

    • Nlat=2N_{\text{lat}} = 2: the nodes ±1/3\pm 1/\sqrt3 are the roots of P2P_2, so Y20∝P2(cos⁡θ)Y_2^0 \propto P_2(\cos\theta) is zero at every grid point. Also, the 2-node rule gives ∑jwjxj4=2/9\sum_j w_j x_j^4 = 2/9, not 2/52/5.
    • Nlon=4N_{\text{lon}} = 4: sin⁡2ϕk=sin⁡(kπ)=0\sin 2\phi_k = \sin(k\pi) = 0 at all four longitudes. The orders m=2m = 2 and m=−2m = -2 alias, and the sin⁡2ϕ\sin 2\phi part of a field is invisible.
    Quick check

    How many real coefficients does a field in the truncation T2T_2 have, and how many does T79T_{79} have?

    5. In code #

    The code checks the quadrature limit and computes the worked example with the recursion and the SHT of Theorem 2. Only NumPy and SciPy's roots_legendre are used.

    import numpy as np
    from scipy.special import roots_legendre
    
    # (a) Gauss-Legendre with K nodes is exact up to degree 2K - 1.
    x, w = roots_legendre(3)
    print(x, w)                            # [-0.7746 0. 0.7746] [0.5556 0.8889 0.5556]
    print(w @ x**4, w @ x**6, 2 / 7)       # 0.4 (= 2/5, exact)  0.24  0.2857
    
    # (b) Normalised associated Legendre functions by the recursion (no (-1)^m phase).
    def pbar_table(N, x):
        s, P = np.sqrt(1 - x**2), np.zeros((N + 1, N + 1, x.size))
        P[0, 0] = 1 / np.sqrt(4 * np.pi)
        for m in range(1, N + 1):
            P[m, m] = np.sqrt((2 * m + 1) / (2 * m)) * s * P[m - 1, m - 1]
        for m in range(N):
            P[m + 1, m] = np.sqrt(2 * m + 3) * x * P[m, m]
            for l in range(m + 2, N + 1):
                a = np.sqrt((4 * l * l - 1) / (l * l - m * m))
                b = np.sqrt(((l - 1) ** 2 - m * m) * (2 * l + 1) / ((l * l - m * m) * (2 * l - 3)))
                P[l, m] = a * x * P[l - 1, m] - b * P[l - 2, m]
        return P
    
    # (c) Analysis on the Gauss grid: rfft in longitude, quadrature in latitude.
    def sht(f, N):
        nlat, nlon = f.shape
        x, w = roots_legendre(nlat)
        P, F = pbar_table(N, x), np.fft.rfft(f, axis=1) / nlon
        A = np.zeros((N + 1, 2 * N + 1))                   # A[l, N + m] = a_l^m
        for m in range(N + 1):
            c = 2 * np.pi * (P[m:, m] * w) @ F[:, m]
            if m == 0:
                A[:, N] = c.real
            else:
                A[m:, N + m], A[m:, N - m] = np.sqrt(2) * c.real, -np.sqrt(2) * c.imag
        return A
    
    x, _ = roots_legendre(3)
    th, ph = np.arccos(x)[:, None], 2 * np.pi * np.arange(5)[None, :] / 5
    f = 1 + 3 * np.cos(th) + np.sin(th) ** 2 * np.cos(2 * ph)
    A = sht(f, 2)
    print(A[0, 2], A[1, 2], A[2, 4])       # 3.5449 6.1400 1.8306
    print(np.sqrt(4 * np.pi), 2 * np.sqrt(3 * np.pi), 4 * np.sqrt(np.pi / 15))   # the same
    print(np.abs(A).sum() - A[0, 2] - A[1, 2] - A[2, 4])   # all other coefficients: 4e-15
    
    # (d) The Laplacian: multiply degree l by -l(l+1).
    print(A[[0, 1, 2], [2, 2, 4]] * -np.array([0, 2, 6]))   # [0. -12.2799 -10.9835]
    

    In the notebook you also write the synthesis, check a round trip with random T20T_{20} coefficients (error about 10−1410^{-14}), solve the Poisson equation and test the rotation property of Theorem 3.

    6. Where it shows up #

    • Spectral dynamical cores. The IFS (ECMWF) and the core of NeuralGCM compute derivatives, diffusion and the semi-implicit solver in spectral space, and the nonlinear terms on a Gaussian grid (the "transform method"). NeuralGCM's core is written in JAX, so the learned physics is trained through it (lesson 03).
    • ML weather and climate models. SFNO-based models (FourCastNet with SFNO, the ACE climate emulator) use the degree-wise filters of section 3.8. The open-source library torch-harmonics provides a differentiable SHT on GPUs. Spherical power spectra are a standard check of blurriness in lesson 16.
    • Positional encodings on the globe. Spherical harmonics of the latitude and longitude of a point are used as location encodings for geospatial ML (Rußwurm et al., 2024).
    • Seismology and geophysics. Global tomography models of seismic velocity in the mantle, gravity models of the geoid, and the geomagnetic reference field are spherical-harmonic expansions. A seismic "spheroidal mode" nSl_nS_l of the free oscillations of the Earth has the angular shape of a degree-ll harmonic.
    • Equivariant networks. In lesson 10, the real harmonics YlY_l of an edge direction are the features of E(3)-equivariant networks, and the matrices Dl(R)D^l(R) of section 3.8 appear again.
    • Practice tools. torch-harmonics (PyTorch), SHTns (fast C library), pyshtools (geodesy and geophysics).

    7. Common mistakes #

    • Colatitude versus latitude. Gauss nodes are values of x=cos⁡θ=sin⁡(latitude)x = \cos\theta = \sin(\text{latitude}). Mixing the two flips or shifts the field.
    • Wrong argument order in SciPy. The new function is sph_harm_y(l, m, colatitude, longitude). The older sph_harm(m, l, longitude, colatitude), still in old code, used the opposite order in both pairs.
    • Mixing conventions. Orthonormal, 4π4\pi-normalised and Schmidt semi-normalised functions differ by factors, and the phase (−1)m(-1)^m may be on or off. Match both before comparing.
    • Too few latitudes, or Gauss weights on the wrong grid. Fewer than N+1N + 1 Gauss latitudes, or Gauss weights on an equiangular grid, silently drop modes (section 4).
    • Dividing by l(l+1)l(l+1) at l=0l = 0, or forgetting the radius. The constant mode is the null space of the Laplacian. On Earth the eigenvalue is −l(l+1)/a2-l(l+1)/a^2.
    • Spectra from m≥0m \ge 0 storage. If you store complex clmc_l^m for m≥0m \ge 0 only, then El=∣cl0∣2+2∑m>0∣clm∣2E_l = |c_l^0|^2 + 2\sum_{m>0}|c_l^m|^2: count each m>0m > 0 twice.
    • Factorial formulas at high degree. Use the normalised recursion.
    • Treating the lat–lon grid as a periodic image. A 2D FFT (as in FNO or AFNO) creates a seam between the poles and artefacts near them. This is what SFNO fixes.
    • Weights that depend on mm. They break rotation equivariance (Theorem 3 and the quiz above).

    8. Check yourself #

    1. What is the eigenvalue of ∇2\nabla^2 for degree l=3l = 3 on the unit sphere, and on Earth (a=6371a = 6371 km)?
      Answer−l(l+1)=−12-l(l+1) = -12 on the unit sphere. On Earth −12/a2=−12/(6.371×106 m)2≈−2.96×10−13 m−2-12/a^2 = -12/(6.371 \times 10^6\ \text{m})^2 \approx -2.96 \times 10^{-13}\ \text{m}^{-2}. All seven harmonics of degree 3 share it.
    2. A model uses the truncation T79. Give the minimal Gauss grid for an exact transform, and the minimal grid for exact (dealiased) quadratic products.
      AnswerLinear grid: Nlat≥80N_{\text{lat}} \ge 80 and Nlon≥159N_{\text{lon}} \ge 159 (160 in practice, for the FFT). Quadratic grid: Nlat≥(3⋅79+1)/2=119N_{\text{lat}} \ge (3 \cdot 79 + 1)/2 = 119 and Nlon≥238N_{\text{lon}} \ge 238 (often 120×240120 \times 240).
    3. On the unit sphere the vorticity is ζ=6sin⁡2θcos⁡2ϕ\zeta = 6\sin^2\theta\cos 2\phi. Find the streamfunction ψ\psi with ∇2ψ=ζ\nabla^2\psi = \zeta.
      Answerζ\zeta has degree 2 only (it is a multiple of Y22Y_2^2), so divide by −l(l+1)=−6-l(l+1) = -6: ψ=−sin⁡2θcos⁡2ϕ\psi = -\sin^2\theta\cos 2\phi, plus any constant.
    4. Why does a weight clmc_{lm} that depends on mm break rotation equivariance, while clc_l does not?
      AnswerA rotation acts on the degree-ll coefficients by the orthogonal matrix Dl(R)D^l(R), which mixes the orders mm. The filter is the diagonal matrix diag⁡(cl,−l,…,cl,l)\operatorname{diag}(c_{l,-l}, \dots, c_{l,l}). It commutes with every Dl(R)D^l(R) only if it is a multiple of the identity, that is, if clm=clc_{lm} = c_l (Schur's lemma, lesson 10).
    5. Which step of the SHT dominates at large NN, and how does it scale?
      AnswerThe Legendre step: about N2/2N^2/2 coefficients times Nlat≈NN_{\text{lat}} \approx N latitudes, so O(N3)O(N^3). The FFTs cost only O(N2log⁡N)O(N^2\log N). The parity symmetry halves the Legendre step, and GPUs run it as batched matrix products.
    6. You compare the power spectra ElE_l of an ML forecast and of the analysis at a lead time of 5 days, and the forecast has much less power for l>100l > 100. What does this tell you?
      AnswerThe forecast is too smooth at scales shorter than about 2πa/100≈4002\pi a/100 \approx 400 km. This is typical of models trained with the MSE: under uncertainty the MSE-optimal forecast is the conditional mean, which averages out small features. The rotation invariance of ElE_l makes it a clean, orientation-free diagnostic.
    Recall cardsAnswer in your head first, then reveal. Add the cards to your review deck to see them again just before you would forget.
    1. What is the eigenvalue of the Laplacian for YlmY_l^m on a sphere of radius aa?

    2. How many real coefficients does the triangular truncation TNT_N have?

    3. Up to which degree is a KK-node Gauss–Legendre rule exact?

    4. What are the two steps of the spherical harmonic transform on a Gauss grid?

    5. Which grid makes the SHT exact for a band limit NN?

    6. Why compute Pˉlm\bar P_l^m with the three-term recursion instead of the closed formula?

    7. Which spectral filters alm↦c alma_l^m \mapsto c\,a_l^m commute with all rotations of the sphere?

    8. How do you solve ∇2ψ=ζ\nabla^2\psi = \zeta on the unit sphere with the SHT?

    9. What does the SFNO change compared with the FNO?

    Open the review →

    9. Interview angle #

    • "Why spherical harmonics and not a 2D FFT on the lat–lon grid?" Latitude is not periodic and the grid is singular at the poles. Spherical harmonics are the eigenfunctions of the Laplacian on the sphere, and the triangular truncation has the same resolution everywhere.
    • "What does SFNO change compared with FNO?" The SHT replaces the flat FFT, and the weights depend on the degree ll only, so the linear part commutes with rotations. The paper reports stable rollouts over one simulated year (1460 steps of 6 hours).
    • "How would you show that an ML forecast is blurry?" Compare the spherical power spectrum ElE_l of the forecasts with that of the analysis (for example ERA5). Models trained with the MSE lose power at high ll, more at longer lead times.
    • "Why is Poisson's equation easy on the sphere, and what is the catch?" Divide each coefficient by −l(l+1)/a2-l(l+1)/a^2. The catch is l=0l = 0: the constant is the null space, so the mean of the right-hand side must be zero.
    • "How do you choose a grid for the truncation NN?" N+1N + 1 Gauss latitudes and 2N+12N + 1 longitudes for linear terms; the quadratic grid ((3N+1)/2(3N + 1)/2 latitudes and 3N+13N + 1 longitudes) to avoid aliasing in products; about twice the latitudes on an equiangular grid.

    10. Practice #

    The notebook for this lesson runs in Colab and in the browser. It has five exercises, each with a check cell and a folded solution:

    1. Build the Gauss–Legendre rule with the Golub–Welsch eigenvalue method and test its exactness up to degree 2K−12K - 1.
    2. Compute the normalised associated Legendre functions with the recursion; compare with scipy.special.lpmv and check orthonormality.
    3. Write the forward and inverse SHT on a Gauss grid; reproduce the worked example and get a round-trip error near 10−1410^{-14}.
    4. Solve Poisson's equation on the sphere (vorticity to streamfunction) and handle the l=0l = 0 mode.
    5. Test numerically that a filter clc_l commutes with rotations and a filter clmc_{lm} does not.

    11. Watch and read #

    Watch how separation of variables gives the Fourier part in longitude and the associated Legendre part in latitude.
    Open on YouTube · the player loads from youtube-nocookie.com when you press play
    A geophysics view: the gravity field of a planet as a sum of spherical harmonics, with the same degree and order.
    Open on YouTube · the player loads from youtube-nocookie.com when you press play
    A reminder of the FNO layer; the SFNO keeps it and changes only the transform and the weight sharing.
    Open on YouTube · the player loads from youtube-nocookie.com when you press play

    Reading

    • Bonev et al., Spherical Fourier Neural Operators: Learning Stable Dynamics on the Sphere (ICML 2023): §3–4 for the SHT, spherical convolution and equivariance. arXiv 2306.03838
    • Boyd, Chebyshev and Fourier Spectral Methods (2nd ed., free PDF), chapter 18: spherical harmonics, triangular truncation, Gaussian grids and dealiasing. PDF
    • Schaeffer, Efficient spherical harmonic transforms aimed at pseudo-spectral numerical simulations (G-cubed, 2013; the SHTns paper): definitions, the recursion and the exactness argument. arXiv 1202.6522
    • torch-harmonics notebooks (NVIDIA): the SHT, quadrature and a Poisson solver in PyTorch. GitHub