Fourier spectral methods and Fourier neural operators
Before this lesson: circulant matrices and the DFT (linear algebra 19); the method of lines, RK4 and its stability region (lesson 02). Complex exponentials: . Time: about 100 minutes, plus the notebook.
Why this matters #
- Weather and climate models. ECMWF's IFS is a spectral transform model: it computes derivatives in spherical-harmonic space (lesson 09 is the spherical version of this lesson). NeuralGCM couples a spectral dynamical core with learned physics.
- Neural operators. The FNO (Li et al., 2021) learns maps between functions, for example from an initial condition to the solution at a later time. FourCastNet's adaptive FNO (AFNO) and the spherical FNO (SFNO) are its descendants in weather models.
- Training data. Many datasets for neural PDE solvers (Burgers, Navier–Stokes, Kuramoto–Sivashinsky) are produced by pseudo-spectral solvers like the one in this lesson.
- One shared trap. A product in a solver and a pointwise activation in a network both create frequencies that the grid cannot hold. Understanding aliasing tells you when "resolution-invariant" is true and when it is not.
1. Predict first #
2. The picture #
Derivatives become multiplications #
A Fourier mode is an eigenfunction of the derivative:
So in Fourier space, is multiplication by , and is multiplication by . A linear PDE with constant coefficients splits into one scalar ODE per mode. Take the heat equation with viscosity . The coefficient of mode obeys , so . High modes decay fastest.
On a grid this gives the spectral derivative: FFT, multiply mode by , inverse FFT. It uses all grid points at once. A finite difference uses only neighbours.
Move the slider for . Top: the exact derivative, the spectral derivative and the second-order finite difference at the grid points. Bottom: the largest error against on log–log axes. For the analytic function the spectral error curve bends down (faster than any power of ) until round-off near ; the finite-difference error is a straight line of slope . Switch to and : with less smoothness the advantage shrinks or disappears.
Spectral accuracy, in words. A smooth periodic function has Fourier coefficients that decay very fast. grid points hold the lowest modes, so the error is about the size of the first mode that is left out. For an analytic function the coefficients fall like , so the error falls like : each doubling of roughly squares the error. For , every grid with gives the exact derivative.
Aliasing: a fast wave can hide as a slow one #
grid points can tell apart only modes. On the grid , the waves and take the same values at every grid point, because .
Move above . The true wave is sampled at points (aqua dots). When , the same samples belong to a lower mode (dashed). The bottom panel is the folding map from to the mode the grid sees: a zigzag, like a strip of paper folded at . Try , : the grid sees mode .
Products create high modes. A product of two fields with modes has modes up to . In Fourier space a product is a convolution of coefficient vectors, which costs . The pseudo-spectral method instead goes to the grid (inverse FFT), multiplies point by point () and comes back (FFT): in total. But the new modes above do not fit on the grid. They fold back onto lower modes and add wrong energy there.
On grid points, which complex wave has exactly the same samples as ?
Modes and have the same samples, so . Mode has the samples of , the complex conjugate. For a cosine this does not matter ( and agree on the grid, because cosine is even), which is why is tempting. Mode is the Nyquist mode, a different wave.
The FNO picture #
A neural operator learns a map between functions, for example from to . The FNO does it in three stages. Lift the input function to channels with a pointwise linear map. Then repeat a Fourier layer: FFT, keep the lowest modes, multiply each kept mode by a learned complex matrix, inverse FFT, add a pointwise linear map of the input, and apply a pointwise activation. Finally, project to the output with a pointwise network. The weights belong to wavenumbers, not to grid points. So one set of weights serves every grid. Section 3 says exactly when this gives the same output on every grid.
3. Definitions and main results #
Fourier series on a grid #
Take the domain . (For a period , mode has the wavenumber .) The grid is , . A function has the Fourier series with coefficients . The discrete Fourier transform (DFT), in NumPy's convention, is
For even , the FFT entries come in the order
(np.fft.fftfreq(n, d=1/n) returns exactly these integers). If has only modes ,
then .
The spectral derivative of order is . For odd and even , set the Nyquist mode to zero. Reason: the real interpolant holds this mode as . Its odd derivatives are multiples of , which is zero at every grid point.
Spectral accuracy (a standard result; see Boyd, ch. 2). If is periodic, analytic and bounded in the strip , then , and the error of the spectral derivative on points falls like , up to slowly varying factors. If has only finitely many continuous derivatives, the error falls only like a power of . Example: has with .
For the spectral derivative has a largest error of on points. About how large is it on points?
The error falls like with . From to this multiplies it by , giving about ; the measured value is . The factors 4 and 16 are what methods of order 2 and 4 would give. Round-off () is reached only near .
Aliasing #
Theorem 1 (aliasing). On the grid , for every integer . So if (absolutely convergent), the DFT of the samples is
Proof of Theorem 1
- , because is an integer.
- . Group the modes by their remainder . By step 1, , so .
- The DFT on points is invertible, and . Compare coefficients: .
So the grid cannot tell mode from , , and so on. Energy above the Nyquist mode does not disappear; it shows up as wrong energy at a lower mode.
Theorem 2 (Orszag's 2/3 rule). Let and have only modes . Multiply them point by point on grid points, take the FFT, and keep the modes . If , the kept coefficients equal those of the exact product . If (and ), aliasing can corrupt kept modes.
Why this is true, in words. The product has modes up to . A mode above lands at . The highest one, , lands at . If this is still below , every wrong mode lands outside the kept band, and the truncation throws it away.
Proof of Theorem 2
- The exact product has modes ; its coefficients are the convolution .
- Assume , so . A mode with appears on the grid as itself. A mode with appears at (Theorem 1), and lies in . Negative are the mirror image.
- The largest alias is . It misses every kept mode when , that is, . Then all corrupted entries lie at , and the truncation removes them.
- Sharpness: if (and ), take . The product has mode , which aliases to , a kept mode.
In a solver: keep the state band-limited with the mask . Go to the grid, multiply, come back, and apply the mask again. The other classic option is padding (the 3/2 rule): compute the product on a grid with times more points (zero-padded coefficients) and truncate back. It keeps all modes of the state, at the price of larger FFTs.
A pseudo-spectral code uses grid points and the 2/3 rule for a quadratic term. Which modes may the state keep?
Theorem 2 needs , so . With the product has mode , which aliases to , a kept mode. Keeping is "all modes below the Nyquist mode", with no dealiasing.
Why aliasing matters: energy #
Theorem 3 (energy conservation). Inviscid Burgers on a periodic domain conserves the energy for smooth solutions. Its Galerkin truncation , where keeps the modes and , also conserves .
Proof of Theorem 3
- .
- is an orthogonal projection, so it is self-adjoint: . Hence .
- , and the integral of the derivative of a periodic function is zero. (Without truncation, step 2 is not needed.)
With the 2/3 rule, the pseudo-spectral right-hand side is the Galerkin one (Theorem 2). So the dealiased semi-discrete scheme (before time stepping; RK4 adds a small time-step error) conserves energy for . For it gives , as the PDE does. With aliasing, the computed term is plus an aliasing error, step 2 fails, and energy can be created. In an under-resolved run this feeds a pile-up of energy at the highest modes (spectral blocking) and then a blow-up. By Parseval, on the grid, so the energy is easy to monitor.
The pseudo-spectral Burgers solver #
The viscous Burgers equation on becomes, mode by mode (method of lines),
with computed on the grid and masked as in Theorem 2. RK4 then integrates this system of ODEs (lesson 02).
An exact solution to test against (Cole–Hopf). The substitution turns Burgers into the heat equation (derivation in section 8, question 3). For , choose ; then . With the modified Bessel functions and , . Each mode decays as in the heat equation:
stays positive (the heat equation keeps positive data positive), so has no poles. For small the series loses digits to cancellation; the widget below therefore uses the equivalent heat-kernel integral, which is stable for every .
The time step. The viscous term has eigenvalues (real, negative). The advection term behaves roughly like eigenvalues (imaginary). The RK4 stability region contains on the real axis and on the imaginary axis (lesson 02). With the largest kept mode, this gives and roughly . The viscous limit shrinks like : the problem is stiff. An integrating factor or ETDRK4 removes this limit (lesson 02).
Choose and press Play. The initial wave steepens into a front at near . Top: the exact Cole–Hopf solution and the pseudo-spectral solution on 64 points. Bottom: the energy , exact (blue), with the 2/3 rule (orange) and without it (magenta). With the rule, the energy never increases, as Theorem 3 says. Without it, the energy rises after the front forms and the run blows up near . For the two runs agree: aliasing matters only when the grid is too coarse for the solution.
The Fourier neural operator #
Operator learning. We want a map between function spaces, for example for Burgers. The data are pairs , sampled on grids. Two well-known architectures are DeepONet (Lu et al., 2021), which combines a "branch" network for the input function with a "trunk" network for the output location, and the FNO. Kovachki, Lanthaler and Stuart (2024) review the theory.
The Fourier layer. Let be the channels at the point . Then
with , , a pointwise activation (GELU) and a learned
matrix-valued kernel . By the convolution theorem, .
The FNO learns directly for the lowest modes and
sets all higher modes to zero. On a grid: rfft along , multiply mode by , irfft back to
points. For one channel, is a circulant matrix
(linear algebra 19): a global convolution that is also a
low-pass filter.
- Parameters: complex numbers per layer in 1-D, independent of .
- Cost: for the FFTs plus for the mode mixing.
- Shift equivariance: every part commutes with cyclic shifts of the grid. Appending the grid coordinates as extra input channels, as the reference code does, breaks this on purpose.
Theorem 4 (the Fourier layer is discretisation-invariant). Let be a real function with modes only. On every grid with points, maps the samples of to the samples of the same function , where are the coefficients of and (so is real). We assume , so the layer never asks for a mode the grid does not have.
Proof of Theorem 4
- , so all modes of lie below the Nyquist mode, and Theorem 1 has no extra terms: for , and for the other modes.
- The layer multiplies by for and zeroes the rest. The do not depend on . Modes that a coarse grid cannot hold have anyway.
- The inverse DFT divides by : . The factor of step 1 cancels.
The pointwise parts (, , lifting, projection) act on the values at each point, so they do not depend on the grid either.
Why the full FNO is only approximately invariant. is applied point by point, and is not band-limited. By Theorem 1 its samples alias: on a coarse grid the next layer sees plus an aliasing error, on a fine grid almost only . So the outputs at two resolutions differ by an error that falls as the grid gets finer, as fast as the Fourier coefficients of decay. In addition, if the data have content above the coarse Nyquist mode, the coarse samples are aliased before the network sees them. And "zero-shot super-resolution" cannot create real detail above the modes the network learned.
Switch the activation to "none", then back to GELU. A small FNO block (Fourier layer, pointwise weight, activation, second Fourier layer, 8 modes each) runs on the chosen grid. Top: its output and the reference on 1024 points. Bottom: the largest output error against . Without the activation the error is round-off on every grid (Theorem 4). With GELU it is at and falls fast. Now add to the input with no activation: grids with fold mode 20 onto a kept mode, so the error is large before any activation.
Is an FNO Fourier layer discretisation-invariant?
Theorem 4 needs a band-limited input and enough grid points; then the factor of the DFT cancels and the output function is the same. Pointwise activations create modes above Nyquist that alias differently on each grid, and input above the coarse Nyquist mode is aliased before the layer sees it. The normalisation only has to be consistent (forward divides by somewhere); "ortho" is not required.
Alias-aware neural operators
The remedy for aliasing in a network is the same as in a solver: apply the nonlinearity on a finer grid and filter back. The convolutional neural operator (CNO; Raonić et al., 2023) upsamples before each activation and low-pass filters after it, and Bartolucci et al. (NeurIPS 2023) define "representation-equivalent" operators for which the discrete and the continuous network agree. In image generation, StyleGAN3 uses the same idea to remove texture sticking. The price is larger FFTs, as with padding in a solver.
Answers to section 1. (1) . On 8 points, mode 6 appears as , so the FFT shows : a false mode 2. (2) The weights do not change: they live on the modes . Each Fourier layer computes the same function on both grids for band-limited input (Theorem 4). The full network is only approximately the same, because the activation aliases differently on the two grids.
4. Worked example #
(a) Aliasing by hand. , . The exact square is . At the grid points, . The FFT reports , that is, at . A solver that keeps all modes below the Nyquist mode () adds this false to the solution. The 2/3 rule keeps only , that is, : then is never part of the state.
(b) A dealiased product. (modes , and ). Exactly, . With and :
On 8 points, mode 3 stays mode 3 and mode 4 is the Nyquist mode. Nothing lands on . After the mask: , exactly the kept part of the true product.
(c) A spectral derivative by hand. on points. Since , the FFT gives and . The cosine gives . Multiply by :
- mode : ; mode : ;
- mode : ; mode : .
The inverse FFT divides by 8: and . So , exact at every grid point.
(d) The time step. , , . The 2/3 rule keeps (). Viscous limit: . Advective limit: . The viscous term decides. Without dealiasing () the viscous limit would be . Doubling divides the viscous limit by about 4.
(e) FNO weights. With and , one Fourier layer has complex weights (plus real numbers for and ), on a grid of 64 points or of 4096 points.
You double the grid from to in the explicit RK4 Burgers solver with the 2/3 rule, at fixed . What happens to the largest stable time step?
goes from 21 to 42. The viscous limit falls from to , a factor 4; the advective limit only halves, to about . The smaller of the two decides. Order is about accuracy, not stability.
5. In code #
NumPy and SciPy check the claims of this lesson. First, aliasing on 8 points (worked examples a and b):
import numpy as np
n = 8
x = 2 * np.pi * np.arange(n) / n # periodic grid on [0, 2π)
k = np.fft.fftfreq(n, d=1 / n).astype(int) # the integer wavenumber of each FFT entry
print(k) # [ 0 1 2 3 -4 -3 -2 -1]
print(np.allclose(np.cos(6 * x), np.cos(2 * x))) # True: mode 6 looks like mode 6 - 8 = -2
coef = lambda w: (np.fft.fft(w) / n).real.round(3) + 0.0 # real signals that are even in x
print(coef(np.cos(3 * x) ** 2)) # [0.5 0. 0.25 0. 0. 0. 0.25 0. ]
# exact: 1/2 + cos(6x)/2, so the 0.25 at k = ±2 is aliasing
u = np.cos(x) + np.cos(2 * x) # modes |k| <= 2: the 2/3-rule band for n = 8
print(coef(u ** 2)) # [1. 0.5 0.25 0.5 0.5 0.5 0.25 0.5 ]
# modes |k| <= 2 (1, 0.5, 0.25) are exact
Second, spectral accuracy against second-order finite differences, for :
def spectral_derivative(u):
n = len(u)
k = np.fft.fftfreq(n, d=1 / n)
k[n // 2] = 0 # Nyquist mode: zero for an odd derivative
return np.fft.ifft(1j * k * np.fft.fft(u)).real
a = np.arccosh(2.0) # analytic in the strip |Im x| < a
for n in [8, 16, 32, 64]:
x = 2 * np.pi * np.arange(n) / n
u, du = 1 / (2 - np.cos(x)), -np.sin(x) / (2 - np.cos(x)) ** 2
fd = (np.roll(u, -1) - np.roll(u, 1)) / (2 * 2 * np.pi / n) # periodic central differences
print(n, f"{np.abs(spectral_derivative(u) - du).max():.1e}",
f"{np.abs(fd - du).max():.1e}", f"{np.exp(-a * n / 2):.1e}")
# 8 1.3e-02 1.0e-01 5.2e-03
# 16 1.4e-04 4.2e-02 2.7e-05
# 32 7.5e-09 1.1e-02 7.1e-10
# 64 5.0e-15 2.8e-03 5.0e-19
The spectral error follows (last column) up to a slowly varying factor, so each doubling of roughly squares it, until it reaches round-off at . The finite-difference error falls only by about 4 per doubling (order 2).
Third, the pseudo-spectral Burgers solver, checked against Cole–Hopf, and the energy with and without the 2/3 rule:
from scipy.special import ive
def burgers_rhs(uh, k, nu, mask):
"""d(u_hat)/dt for u_t + (u^2/2)_x = nu u_xx, pseudo-spectral, with a mode mask."""
u = np.fft.ifft(uh).real
return mask * (-0.5j * k * np.fft.fft(u * u) - nu * k**2 * uh)
def solve_burgers(u0, nu, T, h, dealias=True):
n = len(u0)
k = np.fft.fftfreq(n, d=1 / n) # integer wavenumbers
mask = (np.abs(k) < n / 3) if dealias else (np.abs(k) < n / 2)
uh = mask * np.fft.fft(u0)
for _ in range(int(round(T / h))): # RK4 (lesson 02)
k1 = burgers_rhs(uh, k, nu, mask)
k2 = burgers_rhs(uh + h / 2 * k1, k, nu, mask)
k3 = burgers_rhs(uh + h / 2 * k2, k, nu, mask)
k4 = burgers_rhs(uh + h * k3, k, nu, mask)
uh = uh + h / 6 * (k1 + 2 * k2 + 2 * k3 + k4)
return np.fft.ifft(uh).real
def cole_hopf(x, t, nu, K=200):
"""Exact solution for u(x, 0) = sin x: phi = I0(R) + 2 sum I_k(R) e^{-nu k^2 t} cos kx, R = 1/(2 nu)."""
k = np.arange(K)
c = ive(k, 1 / (2 * nu)) * np.exp(-nu * k**2 * t) # scaled Bessel functions: the scale cancels
c[1:] *= 2
phi = c @ np.cos(np.outer(k, x))
phi_x = -(c * k) @ np.sin(np.outer(k, x))
return -2 * nu * phi_x / phi
for n in [32, 64, 128]:
x = 2 * np.pi * np.arange(n) / n
u = solve_burgers(np.sin(x), nu=0.1, T=1.0, h=1e-3)
print(n, f"{np.abs(u - cole_hopf(x, 1.0, 0.1)).max():.1e}")
# 32 4.6e-03
# 64 3.7e-05
# 128 2.5e-09
energy = lambda u: 0.5 * np.mean(u**2) * 2 * np.pi # E = (1/2) ∫ u^2 dx
x = 2 * np.pi * np.arange(64) / 64
for T in [1.0, 1.5]:
on = solve_burgers(np.sin(x), nu=0.005, T=T, h=2e-3, dealias=True)
off = solve_burgers(np.sin(x), nu=0.005, T=T, h=2e-3, dealias=False)
print(T, f"{energy(on):.3f} {energy(off):.3f}")
# 1.0 1.546 1.548
# 1.5 1.409 2.591 (exact: 1.546 at t = 1 and 1.337 at t = 1.5; E(0) = π/2 = 1.571)
Fourth, the two facts behind discretisation invariance: a band-limited input has the same coefficients on every fine-enough grid (Theorem 4), and a pointwise GELU makes coarse grids alias:
from scipy.special import erf
gelu = lambda a: 0.5 * a * (1 + erf(a / np.sqrt(2)))
grid = lambda n: 2 * np.pi * np.arange(n) / n
coeffs = lambda vals, kmax=4: np.fft.rfft(vals)[: kmax + 1] / len(vals) # c_0 .. c_kmax
v = lambda x: 2 * np.sin(x) + np.cos(3 * x) # band-limited: modes 1 and 3
print(np.round(coeffs(v(grid(16))), 3) + 0) # [0. +0.j 0. -1.j 0. +0.j 0.5+0.j 0. +0.j]
print(np.abs(coeffs(v(grid(16))) - coeffs(v(grid(64)))).max() < 1e-14) # True
ref = coeffs(gelu(v(grid(4096)))) # practically exact
for n in [16, 32, 64]:
print(n, f"{np.abs(coeffs(gelu(v(grid(n)))) - ref).max():.1e}")
# 16 4.7e-03
# 32 2.0e-06
# 64 9.0e-15
6. Where it shows up #
- Weather and climate. Orszag published the 2/3 rule in the Journal of the Atmospheric Sciences (1971). Spectral transform models such as ECMWF's IFS, and NeuralGCM's dynamical core, use the spherical version of this lesson (lesson 09). FNO-type emulators (FourCastNet's AFNO, SFNO) learn global dynamics in Fourier or spherical-harmonic space (lesson 16).
- Seismology. Fourier pseudo-spectral methods are a classic tool for seismic wave propagation. Neural operators have been trained to emulate 2-D acoustic wave propagation for any velocity model and source location, and reverse-mode automatic differentiation through them gives the gradients for tomography (Yang et al., The Seismic Record, 2021): the adjoint idea of lesson 04.
- PINN baselines. The Burgers solver of this lesson is the reference against which lesson 11 measures physics-informed networks.
- Deep learning. An FNO layer is a global convolution computed with the FFT; long-convolution sequence models use the same trick. Strided convolutions and pooling in CNNs alias too. Alias-free generators (StyleGAN3) upsample before the nonlinearity and low-pass after it, the same remedy as dealiasing.
7. Common mistakes #
- Wavenumbers in the wrong order, or without the factor for a period . Use
np.fft.fftfreq(n, d=L/n) * 2 * np.pi. - A nonzero Nyquist mode in an odd derivative. The result is no longer the derivative of a real interpolant.
- Keeping instead of . For this keeps mode 32, and mode 64 aliases onto .
- Masking only after the product. The state itself must be band-limited, so mask the initial condition and every right-hand side.
- Blaming the nonlinear term for a blow-up that is really the viscous stability limit : check the time step first, then the energy.
- FNO: inconsistent FFT normalisation (
norm="ortho"in one place, the default in another). The output then scales with , and discretisation invariance is lost. - FNO: asking for more modes than the grid has (
rfftgives modes for even ), or evaluating on non-periodic data without padding.
8. Check yourself #
- On grid points, which mode does look like?
Answer
: it looks like (cosine is even, so modes give the same real wave). - For , what is the largest kept under the 2/3 rule? Show what goes wrong if you
keep one more mode.
Answer
Keep , so (). With , the product has mode , which aliases to : a kept mode. - Derive the Cole–Hopf transform: show that solves when
.
Answer
Write with . Burgers is , so it is enough that . With , and : the terms cancel ( against ), and the bracket equals , which is zero for a heat-equation solution. must stay positive, or has poles. - Why is a Fourier layer discretisation-invariant, while a 3-tap convolution kernel learned at 64 points is
not?
Answer
The Fourier weights are attached to physical wavenumbers , and the DFT scaling cancels (Theorem 4). The 3 weights of a local kernel are attached to the grid spacing: at 256 points they cover a 4 times shorter distance, so they are a different operator with a different frequency response. - Why does the dealiased pseudo-spectral scheme for conserve , and the
aliased one not?
Answer
Dealiased, the right-hand side equals the Galerkin term exactly (Theorem 2). Then (Theorem 3), and is proportional to (Parseval). Aliased, the computed term contains an aliasing error whose product with does not integrate to zero. - You double in the explicit RK4 Burgers solver at fixed . What happens to the stable time step,
and how can you avoid that?
Answer
doubles, so the viscous limit falls by a factor 4 (the advective limit only by 2). Treat the stiff linear term exactly or implicitly: an integrating factor, ETDRK4 or an IMEX scheme (lesson 02). Then the step is limited mainly by advection.
How do you compute the first derivative of periodic samples with the FFT?
with integer wavenumbers from
fftfreq(n, 1/n)(times for period ), and the Nyquist mode set to zero.What does spectral accuracy mean?
For a smooth (analytic) periodic function the error falls faster than any power of , like , because the Fourier coefficients decay exponentially.
State the aliasing rule on a grid of points.
for every integer , so the DFT gives .
On points, where does mode 6 of appear?
At : a false mode 2.
State Orszag's 2/3 rule.
If both factors have modes and , the kept modes of the grid product are exact.
Why does aliasing matter for energy in Burgers?
The dealiased right-hand side is the Galerkin one, which conserves for ; the aliasing error breaks this and can create energy until the run blows up.
What is the Cole–Hopf transform?
; it maps solutions of the heat equation (with ) to solutions of viscous Burgers.
Write the FNO Fourier layer.
, with learned for the lowest modes and zero above.
Why is the linear Fourier layer discretisation-invariant?
Its weights belong to wavenumbers; for band-limited input on a grid with , the DFT factor cancels and the output is the same function on every grid.
Why is the full FNO only approximately resolution-invariant?
Pointwise activations create modes above the Nyquist mode, which alias differently on each grid.
9. Interview angle #
- "What is aliasing, and how do you avoid it in a pseudo-spectral code?" — Theorem 1, then the 2/3 rule or padding, with the energy argument as the reason it matters.
- "Is an FNO really resolution-invariant?" — Each Fourier layer is, for band-limited inputs (Theorem 4). The pointwise activations alias on coarse grids, so the network is only approximately invariant; test the error at several resolutions.
- "FNO, U-Net or graph network for a PDE surrogate?" — FNO: global receptive field in each layer, , periodic uniform grids, smooth fields (sharp fronts need many modes). U-Net: local and multiscale, better at sharp features, tied to one resolution. Graph or mesh networks: irregular geometry (GraphCast uses an icosahedral mesh). The sphere: SFNO (lesson 09).
- "Why are spectral methods so accurate, and when do they fail?" — Exponential convergence for smooth periodic functions; trouble with shocks (Gibbs), non-periodic boundaries (use Chebyshev points) and complex geometry.
- "Your spectral solver blows up after 100 steps. How do you debug it?" — Check the time step against the viscous limit, check dealiasing, monitor the energy and the spectrum at the highest modes.
10. Practice #
The notebook for this lesson runs in Colab or in the browser. It has four exercises, each with a check cell and a folded solution:
- FFT wavenumbers and the spectral derivative; compare its error with finite differences.
- Aliasing of a product and the 2/3-rule mask; find the false modes of on 8 points.
- A pseudo-spectral Burgers solver with RK4, checked against Cole–Hopf; energy with and without the mask.
- Learn a linear Fourier multiplier (the linear part of an FNO layer) from heat-equation data on 64 points by least squares, and test it on 256 points.
11. Watch and read #
- Boyd, Chebyshev and Fourier Spectral Methods, 2nd ed. (free PDF from the author): §2.2–2.4 and §2.8 (orders of convergence; singularities set the rate); ch. 11 "Aliasing, spectral blocking, and blow-up": §11.2 (aliasing), §11.3 (spectral blocking), §11.5 (the two-thirds rule).
- Driscoll and Braun, Fundamentals of Numerical Computation (free online): §9.5 (trigonometric interpolation), §11.2–11.4 (method of lines, absolute stability, stiffness).
- Li et al., Fourier Neural Operator for Parametric Partial Differential Equations (ICLR 2021): §4 (the Fourier layer), §5.1 (Burgers).
- Kovachki, Lanthaler and Stuart, Operator Learning: Algorithms and Analysis (2024): §1.1 (vectors versus functions), §3.3 (FNO), §4.2 (universal approximation).
- Lu et al., DeepONet (Nature Machine Intelligence, 2021): the branch–trunk operator network.
- Raonić et al., Convolutional Neural Operators (NeurIPS 2023): alias-aware operator layers.
- neuraloperator, theory guide "Fourier Neural Operators": the sections on the Fourier layer and resolution invariance.
Runs in your browser with nothing to install. The notebook repeats the key demos and has exercises with checks; solutions are inside, folded.
No Google account needed: Python runs inside your browser. The first start downloads about 40 MB; your changes are saved in this browser only.