From spectral methods to Fourier neural operators¶
Given an initial temperature field, predict the temperature after a fixed time. For heat diffusion, a sum of Fourier waves represents the field, and the heat equation determines how each wave changes. A Fourier neural operator (FNO) learns a map between such fields from examples, using Fourier transformations within its architecture.
The heat example separates the spatial waves, the coefficients of an input, and the transformation applied to those coefficients. That distinction remains useful when the input becomes a velocity field or a material property. For nonlinear problems, products and activations couple the modes, which connects FNO layers to pseudospectral methods.
All calculations below use the periodic interval \(0\le x<2\pi\). The temperature and its spatial derivatives agree at the two ends, as for heat on a ring. The heat example has constant diffusivity \(\nu>0\).
import numpy as np
import matplotlib.pyplot as plt
from scipy.special import erf
N = 128
x = np.linspace(0, 2*np.pi, N, endpoint=False)
def ddx(u):
# Differentiate a periodic field: multiply its Fourier coefficients by ik.
wavenumber = np.fft.rfftfreq(u.size, d=1/u.size)
return np.fft.irfft(1j*wavenumber*np.fft.rfft(u), n=u.size)
def amplitudes(u, kmax):
# Amplitude of each real wave in u for the wavenumbers 0..kmax.
c = np.abs(np.fft.rfft(u, norm='forward'))
# Only interior modes have a distinct negative-frequency partner.
if u.size % 2 == 0:
c[1:-1] *= 2
else:
c[1:] *= 2
return c[:kmax + 1]
1. A temperature field and its waves¶
Take the initial temperature
The first term describes broad hot and cold regions. The second adds shorter fluctuations with half the amplitude. The figure shows the resulting temperature field over one period.
u0 = np.sin(x) + 0.5*np.sin(8*x)
show_waves([('Initial temperature', u0, BLUE)])
The field can be reconstructed by adding the two component values at each position. For example, the broad component contributes \(\sin x\), and the rapid component contributes \(\tfrac12\sin(8x)\). The plots below show these components separately.
show_waves([(r'Broad wave $\sin(x)$', np.sin(x), GREEN),
(r'Rapid wave $\frac{1}{2}\sin(8x)$', 0.5*np.sin(8*x), ORANGE)])
Write the same field using fixed spatial functions \(\phi_1(x)=\sin x\) and \(\phi_8(x)=\sin(8x)\),
Changing the coefficients changes the field represented by these waves. Changing the waves would change the representation itself. The FFT computes Fourier coefficients from field samples, while the waves are specified by the periodic domain.
2. Deriving the heat multiplier¶
One wave becomes one amplitude ODE¶
The heat equation describes how the temperature changes with its spatial curvature,
To determine what this equation does to one wave, take \(u(x,0)=\sin(2x)\). Differentiating this wave twice gives
The second derivative is a multiple of the same sine wave. The heat equation therefore preserves its one-dimensional span, so seek a solution with a time-dependent amplitude,
The time derivative differentiates the amplitude, while the spatial derivative differentiates the wave,
Substitution into the PDE gives
This equality must hold for every \(x\). The coefficients of the same nonzero spatial function must therefore agree,
The ODE has solution \(q(t)=e^{-4\nu t}\). Substituting this amplitude into the trial form gives the full temperature solution,
The sine retains its shape and wavelength. Its amplitude decreases with time because \(\nu>0\). The relation \(\partial_{xx}\sin(2x)=-4\sin(2x)\) makes the sine an eigenfunction of the spatial operator.
From one wave to every mode¶
For the wave \(\sin(kx)\), differentiating twice gives \(-k^2\sin(kx)\). Its amplitude satisfies the same type of ODE,
Define the multiplier \(R(k,t)\) as the factor relating the final and initial amplitudes,
For a fixed diffusivity and time, this multiplier is shared by every initial field. The initial amplitudes \(q_k(0)\) depend on the particular input. Larger \(k^2\) gives faster decay, so short waves disappear more rapidly than broad ones.
Return to the initial two-wave field¶
The heat equation is linear, so adding the two single-wave solutions gives the solution for their sum,
Each wave retains its spatial shape, but their sum changes shape because the amplitudes decay at different rates. The next figure compares the initial field with this solution at \(\nu=0.1\) and \(t=1\). The rapid oscillations have nearly disappeared while the broad component remains visible.
nu, t = 0.1, 1.0
u_t = np.exp(-nu*t)*np.sin(x) + 0.5*np.exp(-64*nu*t)*np.sin(8*x)
show_waves([('Initial temperature', u0, BLUE), (f'After diffusion, t = {t:g}', u_t, GREEN)])
The broad wave retains \(e^{-0.1}=0.905\) of its initial amplitude, and the rapid wave retains \(e^{-6.4}=0.0017\). These multipliers apply to the initial amplitudes \(1\) and \(1/2\), respectively. The difference comes from the \(k^2\) term in the amplitude equation.
The same dependence has a spatial interpretation. A peak and its neighboring trough in \(\sin(kx)\) are separated by \(\pi/k\), and diffusion over a distance \(d\) takes a time proportional to \(d^2/\nu\). The resulting decay time is therefore proportional to \(1/(\nu k^2)\).
The Fourier-series form¶
Sines and cosines can be combined into complex exponential waves. For integer \(k\), Euler's formula gives \(e^{ikx}=\cos(kx)+i\sin(kx)\). Write a sufficiently smooth periodic field as
The functions \(e^{ikx}\) specify the Fourier basis. The coefficients \(\widehat u(k,t)\) specify the field in this basis, including amplitudes and phases. For a real field, the negative-frequency coefficients are the complex conjugates of the positive-frequency coefficients.
Differentiation acts on each spatial wave,
Substituting this series into the heat equation gives
The Fourier waves are linearly independent, so their coefficients must agree. The resulting ODE and its solution are
For \(k=0\), the multiplier is \(1\), so the mean temperature is preserved. For nonzero \(k\), the multiplier damps the mode. This independent evolution follows from the constant diffusivity and periodic boundary conditions.
| Object | Heat-flow example | Dependence |
|---|---|---|
| Spatial wave | \(e^{ikx}\) | Fixed by the periodic domain |
| Input coefficient | \(\widehat u(k,0)\) | Changes with the initial temperature |
| Multiplier | \(R(k,t)=e^{-\nu k^2t}\) | Determined by the PDE and prediction time |
| Output coefficient | \(\widehat u(k,t)\) | Product of the multiplier and input coefficient |
The following figure uses initial sine amplitudes \(q_k(0)=1/k\) for \(k=1,\ldots,5\). Its middle panel shows the multipliers, and the right panel shows their products with the initial amplitudes. A multiplier and a field coefficient play different roles even when both are plotted against \(k\).
modes = np.arange(1, 6)
initial = 1/modes
R = np.exp(-nu*modes**2*t)
show_modes([('Amplitude at t = 0', initial, BLUE),
('Multiplier R(k, t)', R, PURPLE),
(f'Amplitude at t = {t:g}', R*initial, GREEN)],
modes, sharey=True, title='How the spectral solution works')
From the modal solution to an FFT algorithm¶
Sample the initial field at \(x_j=2\pi j/N\) for \(j=0,\ldots,N-1\). The grid contains \(N\) distinct points, with values \(u_j=u(x_j,0)\). The endpoint \(2\pi\) duplicates the periodic point \(0\) and is excluded.
The FFT computes the coefficients of the trigonometric interpolant through these samples. For each resolved physical wavenumber, apply the multiplier already derived from the PDE. The inverse FFT reconstructs the evolved samples.
- Compute \(\widehat u_k(0)\) from the input samples using the FFT.
- Form \(\widehat u_k(t)=e^{-\nu k^2t}\widehat u_k(0)\).
- Apply the inverse FFT to obtain \(u(x_j,t)\).
The code obtains angular wavenumbers from \(2\pi\,\mathrm{fftfreq}(N,d=L/N)\). Here \(L=2\pi\), so these wavenumbers are integers, including negative ones. NumPy's forward FFT is unnormalized, and its inverse includes the factor \(1/N\), so their scaling cancels around the modal multiplication.
The initial field is the two-wave example from Section 1. Both waves are resolved on the \(N=128\) grid. The final line compares the numerical reconstruction with their analytic solution.
import numpy as np
N = 128
L = 2 * np.pi
x = np.linspace(0, L, N, endpoint=False)
nu = 0.1
t = 1.0
u0 = np.sin(x) + 0.5 * np.sin(8*x)
# Step 1: Fourier transform
u_hat = np.fft.fft(u0)
# Physical angular wavenumbers
k = 2*np.pi*np.fft.fftfreq(N, d=L/N)
# Step 2: Physics-derived multiplier
R = np.exp(-nu * k**2 * t)
u_hat_new = R * u_hat
# Step 3: Reconstruct temperature
u_new = np.fft.ifft(u_hat_new).real
exact = np.exp(-nu*t)*np.sin(x) + 0.5*np.exp(-64*nu*t)*np.sin(8*x)
print(f"max error: {np.abs(u_new - exact).max():.1e}")
max error: 5.6e-16
The stored error is at the level of floating-point roundoff for this resolved two-wave field. For a general initial condition, a finite grid also introduces truncation and sampling errors. Applying the exact multiplier to resolved modes leaves those representation errors to be controlled separately.
For every resolved initial field, the code computes new input coefficients and applies the same known heat multiplier. Field pairs provide another way to determine that shared transformation. The following fit makes the Fourier multiplier a learned parameter.
3. Learning a spectral transformation from field pairs¶
The map from an input field to an output field¶
Fix a prediction time \(T\). For each initial temperature field \(f\), solving the heat equation gives a final field \(u(\cdot,T)\). The solution operator collects these solves into one map,
Every input field supplies a different set of Fourier coefficients. For this heat equation, the same multiplier transforms all of them at a given frequency. That shared transformation is what the scalar learning example fits.
From a known multiplier to a fitted multiplier¶
Fix a prediction time \(T\) and collect pairs of initial and final temperature fields \((f_n,u_n)\). The input \(f_n\) specifies the initial temperature, and the output \(u_n\) specifies its temperature at time \(T\). For constant-coefficient heat flow, every pair uses the same multiplier,
The FFT computes \(\widehat f_n(k)\) and \(\widehat u_n(k)\) from each pair. These observed coefficients can be used to fit \(R(k,T)\) even when the formula for the evolution is unavailable. The unknown in this fit is the transformation shared across inputs.
For a single sine input with nonzero initial amplitude \(a\) and final amplitude \(b\), the multiplier is \(b/a\). With several field pairs, write \(A_n(k)=\widehat f_n(k)\) and \(B_n(k)=\widehat u_n(k)\). At each frequency, fit a complex scalar by least squares,
When \(\sum_n|A_n(k)|^2>0\), the minimizer is
The denominator measures how much of that mode is present in the training inputs. If it vanishes, the pairs provide no information about the multiplier at that frequency. The heat flow lab performs this fit for three waves.
| Operation | Spectral heat solver | Learned scalar Fourier layer |
|---|---|---|
| Represent an input | Compute Fourier coefficients | Compute Fourier coefficients |
| Specify the transformation | Derive \(R(k,T)\) from the PDE | Fit \(R_\theta(k)\) from field pairs |
| Form the output coefficients | Multiply by \(R(k,T)\) | Multiply by \(R_\theta(k)\) |
| Reconstruct the output | Inverse FFT | Inverse FFT |
The Fourier waves remain the representation in both calculations. Each new input supplies its own coefficients, and the fitted weights are reused. For this linear example, the learned layer approximates the heat solution operator at time \(T\).
Amplitude and phase¶
The heat multiplier is real and positive, so it changes a mode's amplitude while preserving its phase. A complex multiplier can also change the phase. For a positive frequency \(k\), write \(R(k)=A e^{i\varphi}\), with \(A\ge0\).
For a real output, use the conjugate multiplier at \(-k\). Applying this pair to a sine gives
The magnitude \(A\) scales the sine, and \(\varphi\) shifts its phase. For example, \(R(1)=i\) and \(R(-1)=-i\) map \(\sin x\) to \(\cos x\). For pure transport at speed \(c\), the phase change is \(-ckT\), which translates every component by the same distance \(cT\).
| Equation | Multiplier at time \(T\) | Effect |
|---|---|---|
| Heat, \(u_t=\nu u_{xx}\) | \(e^{-\nu k^2T}\) | Decay of each nonconstant mode |
| Transport, \(u_t=-c\,u_x\) | \(e^{-ickT}\) | Translation by \(cT\) |
| Both, \(u_t=-c\,u_x+\nu u_{xx}\) | \(e^{-ickT}e^{-\nu k^2T}\) | Translation and decay |
These transformations are diagonal in the Fourier basis for the constant-coefficient periodic equations shown. Learning complex weights permits both amplitude and phase changes within the same representation. The matrix-valued spectral weights of an FNO extend this operation to feature channels.
When independent multipliers are insufficient¶
A general solution operator can couple Fourier modes. This already occurs in the linear diffusion equation with a prescribed spatially varying diffusivity,
Take \(\nu(x)=1+\tfrac12\cos x\) and the single wave \(u=\sin(2x)\). The flux is a product of the diffusivity and the derivative,
Differentiating this flux gives
The spatial operator is linear in \(u\) because \(\nu(x)\) is prescribed independently of \(u\). Its Fourier matrix is nevertheless non-diagonal, with this coefficient coupling each mode to itself and its immediate neighbors. The matrix is tridiagonal, while its time-evolution operator can have couplings beyond those bands.
The following figure checks the coefficient magnitudes for the single-wave input. The formula above gives their signs. Modes 1 and 3 appear because multiplication by the coefficient field couples neighboring modes.
u = np.sin(2*x)
out = ddx((1 + 0.5*np.cos(x))*ddx(u))
show_modes([(r'Input $\sin(2x)$', amplitudes(u, 5), BLUE),
(r'Output $(\nu(x)\,u_x)_x$', amplitudes(out, 5), ORANGE)],
np.arange(6))
The constant-coefficient heat equation preserves independent modal evolution. Spatial heterogeneity creates linear couplings between modes, as the preceding example shows. Nonlinear PDEs introduce another source of coupling through products of the evolving field itself.
4. Nonlinear mode interactions and pseudospectral methods¶
The limit of a linear Fourier multiplier¶
Apply a scalar multiplier \(R(1)=0.5\) to the input \(u(x)=\sin x\). The output is \(0.5\sin x\), and all other Fourier coefficients remain zero. The figure shows that the amplitude changes while the frequency remains the same.
show_waves([('Before', np.sin(x), BLUE), ('After R(1) = 0.5', 0.5*np.sin(x), GREEN)])
Stacking fixed linear Fourier multipliers preserves this restriction. At frequency \(k\), two scalar layers produce \(R_2(k)R_1(k)\widehat u(k)\), which is another multiplier at the same frequency. If the input coefficient at another frequency is zero, multiplying it by more such weights keeps it zero.
A nonlinear term generates a second harmonic¶
Consider the periodic viscous Burgers equation,
Its diffusion term has the same modal action as the heat equation. Its advection term multiplies the evolving field by its derivative. For the initial field \(u(x,0)=\sin x\), these factors are
Their product is
This product contains a frequency absent from the initial field. The following plots show each factor and their product. The generation of a second harmonic is a consequence of multiplication in physical space.
u = np.sin(x)
show_waves([(r'$u(x)=\sin(x)$', u, BLUE),
(r'$u_x(x)=\cos(x)$', np.cos(x), GREEN),
(r'$u\cdot u_x=\frac{1}{2}\sin(2x)$', u*np.cos(x), ORANGE)])
Substituting the initial field into the full Burgers equation gives
The diffusion term damps the original sine mode. The nonlinear term contributes a second harmonic to the initial time derivative. The emerging solution therefore requires more modes than were present initially.
A physical-space product becomes a Fourier convolution¶
With the Fourier normalization from Section 2, differentiation acts on each coefficient independently,
For a product, substitute the two Fourier expansions and collect terms with the same total frequency,
The coefficient at \(k\) receives contributions from every pair with \(p+q=k\). Its value is therefore the convolution sum
For real sine and cosine waves, the positive and negative frequencies generate both sums and differences. For \(u=\sin x\), the only nonzero coefficients are \(\widehat u(1)=1/(2i)\) and \(\widehat u(-1)=-1/(2i)\). The pairs \((1,1)\) and \((-1,-1)\) each contribute \(-1/4\) at modes \(2\) and \(-2\), respectively.
At \(k=0\), the pairs \((1,-1)\) and \((-1,1)\) together contribute \(1/2\). Reconstructing these coefficients gives
The constant term and second harmonic follow from the same convolution rule. This rule explains frequency mixing without changing the Fourier basis. The coefficient interactions are produced by the nonlinear operation on the field.
Evaluating the product with FFTs¶
A direct convolution sum involves many pairs of modes. A pseudospectral method instead reconstructs the fields on a grid and multiplies their values pointwise. The FFT of this product returns its discrete Fourier coefficients.
| Space | Operation | Result |
|---|---|---|
| Fourier | Form \(ik\widehat u(k)\) | Coefficients of \(u_x\) |
| Fourier to physical | Apply inverse FFTs | Samples of \(u\) and \(u_x\) |
| Physical | Multiply \(u(x)u_x(x)\) | Samples of the nonlinear term |
| Physical to Fourier | Apply the FFT | Coefficients of the sampled product |
In Burgers' equation, this product enters the time derivative with a minus sign. Diffusion adds \(-\nu k^2\widehat u(k)\), and a time integrator advances the resulting coefficient ODEs. The next cell evaluates the product for \(u=\sin x\) and compares it with \(\tfrac12\sin(2x)\).
wavenumber = np.fft.rfftfreq(N, d=1/N)
u_hat = np.fft.rfft(np.sin(x))
u_x_hat = 1j*wavenumber*u_hat # differentiate in Fourier space
u = np.fft.irfft(u_hat, n=N) # back to physical space
u_x = np.fft.irfft(u_x_hat, n=N)
product = u*u_x # multiply at each grid point
product_hat = np.fft.rfft(product) # nonlinear term in Fourier space
error = np.abs(product - 0.5*np.sin(2*x)).max()
print(f"max |u u_x - sin(2x)/2|: {error:.1e}")
show_modes([(r'Modes of $u$', amplitudes(u, 4), BLUE),
(r'Modes of the product $u\,u_x$', amplitudes(product, 4), ORANGE)],
np.arange(5), sharey=True)
max |u u_x - sin(2x)/2|: 7.0e-15
The product in this example is resolved by the grid. For a general input, multiplication can generate frequencies above the Nyquist limit, whose sampled values alias onto resolved modes. Pseudospectral solvers use dealiasing procedures, such as suitable padding and filtering, to control this error.
5. From a learned multiplier to an FNO block¶
Lift the input into feature channels¶
The learned scalar multiplier in Section 3 transforms one coefficient at a time. An FNO uses several feature channels so that each position has a vector \(v_\ell(x)\). A pointwise lifting network first maps the input field \(f\) to these features,
Coordinates or material fields can also enter the lift when the problem needs spatial conditioning. Each feature channel is a function of \(x\) with its own Fourier coefficients. The spectral branch transforms all these channels to Fourier space.
Mix channels at each retained frequency¶
At a retained frequency \(k\), the coefficients form a vector \(\widehat v_\ell(k)\). The learned matrix \(R_\ell(k)\) transforms that vector,
This operation mixes feature channels at the same frequency. Its complex weights can change amplitudes and phases, and its frequency index remains \(k\). The branch sets coefficients outside the retained set to zero before applying the inverse FFT.
Add the pointwise path and apply an activation¶
The inverse FFT reconstructs the transformed feature field. A second learned matrix \(W_\ell\) mixes channels locally at each position. The layer adds these two contributions and applies a pointwise activation,
| Stage | Operation | Role |
|---|---|---|
| FFT | Compute \(\widehat v_\ell(k)\) | Represent the feature fields in Fourier coordinates |
| Spectral transformation | Apply \(R_\ell(k)\) at retained modes | Learn global channel transformations |
| Inverse FFT | Reconstruct the transformed field | Return to physical coordinates |
| Pointwise path | Add \(W_\ell v_\ell(x)\) | Process local feature values |
| Activation | Apply \(\sigma\) | Couple modes through a nonlinear function |
After several blocks, a pointwise projection \(Q_\theta\) produces the output field, \(\widehat u(x)=Q_\theta(v_L(x))\). The lifting, spectral matrices, pointwise matrices, and output projection are trained together to approximate the desired solution operator. The FNO block page displays these operations one at a time.
How the activation creates new modes¶
Take one feature entering the activation to be \(z(x)=\sin x\). For the square activation \(\sigma(z)=z^2\), the product identity gives
The activation generates a constant component and a second harmonic from the first harmonic. The next Fourier block receives this new spectrum and can transform the retained components separately. The following figure shows the feature before and after squaring.
z = np.sin(x)
show_waves([(r'Input: $\sin(x)$', z, BLUE),
(r'After squaring: $\sin^2(x)$', z**2, ORANGE)])
The square makes the new frequencies explicit through a trigonometric identity. ReLU and GELU also generate additional Fourier content, with different coefficients. The following plots compare their low-frequency amplitudes for the same sine input.
relu = np.maximum(z, 0)
gelu = 0.5*z*(1 + erf(z/np.sqrt(2)))
show_modes([(r'Square of $\sin(x)$', amplitudes(z**2, 6), ORANGE),
(r'ReLU of $\sin(x)$', amplitudes(relu, 6), GREEN),
(r'GELU of $\sin(x)$', amplitudes(gelu, 6), PURPLE)],
np.arange(7), sharey=True)
For the square, the constant component and second harmonic each have amplitude \(1/2\). ReLU preserves half the original sine amplitude and adds even modes, with amplitudes \(0.32\), \(0.21\), and \(0.04\) at modes 0, 2, and 4. For GELU, the amplitudes at modes 2 and 4 are \(0.17\) and \(0.007\), reflecting the faster coefficient decay of this smooth periodic function.
The next FNO block applies its own learned matrices to the retained part of this spectrum. Another activation can generate further frequency content from the transformed features. Repeated blocks therefore approximate nonlinear relationships between fields through successive spectral transformations and pointwise operations.
Training one map across many fields¶
The blocks define a prediction \(\mathcal G_\theta(f)\) for each input field \(f\). The parameters \(\theta\) include the lift, the spectral matrices, the pointwise matrices, and the output projection. For field pairs \((f_n,u_n)\) at a fixed prediction time, a supervised loss can be written as
where \(M\) is the number of training pairs. Grid samples approximate the spatial norm, and gradient-based training updates the shared parameters. The trained model then applies these same blocks to a new input field.
For a material-dependent boundary value problem, \(f\) can instead contain a material coefficient field and the other specified inputs. The output is the solution field for that instance. The input family and prediction target determine which operator the model approximates.
The connection to pseudospectral evaluation¶
Both constructions alternate between Fourier and physical coordinates. In Fourier coordinates, differentiation and the FNO spectral branch act by prescribed or learned matrices at each mode. In physical coordinates, the nonlinear operations create interactions between modes.
| Pseudospectral Burgers solver | FNO |
|---|---|
| Compute a derivative using the known multiplier \(ik\) | Transform feature channels using learned \(R_\ell(k)\) |
| Reconstruct \(u\) and \(u_x\) | Reconstruct transformed features and add the pointwise path |
| Evaluate the known product \(uu_x\) | Apply an activation such as GELU |
| Use the PDE right-hand side in a time integrator | Repeat feature blocks and project to the output field |
The pseudospectral solver follows a specified equation and time-integration rule. An FNO fits the transformations needed for a chosen input-output map, such as the solution at a fixed prediction time. Its hidden layer index has no prescribed correspondence to physical time.
6. Global interaction, CNNs, and resolution¶
Spatial reach of a Fourier branch¶
A Fourier coefficient depends on samples across the domain. Changing a retained coefficient changes the reconstructed field through its global wave. A Fourier multiplier therefore defines a convolution whose kernel can extend throughout the periodic domain, even when few modes are retained.
A CNN with compact spatial filters combines values at neighboring grid points. Its receptive field grows through additional layers, dilation, or larger filters. An FNO spectral branch provides global spatial interaction within one block.
| Compact CNN filters | FNO spectral branch |
|---|---|
| Learn local spatial weights | Learn channel matrices at retained Fourier modes |
| Combine nearby grid values | Combine information across the domain |
| Increase spatial reach through the architecture | Provide global spatial reach within one branch |
| Require care when transferring physical length scales between grids | Reuse retained mode weights on compatible grids |
The CNN and discretization notebook compares heat predictions on grids of 128, 256, and 512 points. For a fixed physical domain, a retained Fourier index represents the same physical wavenumber on each compatible grid. The same spectral weights can therefore be evaluated at a finer resolution.
What limits accuracy on a new grid¶
Reusing the weights specifies a computation on the new grid. Prediction accuracy also depends on the training inputs, retained modes, and physical scales resolved by the data. Nonlinear aliasing can change with the grid because activations generate frequencies above the retained spectral set and, potentially, above the sampling limit.
The spectral branch directly transforms only its retained modes. The pointwise path can process other grid-scale features, and activations can generate additional frequencies. Those frequencies have no independent learned spectral weights when they lie outside the retained set.
On the FNO block page, the square-wave input with \(k_{\max}=3\) illustrates this distinction. The truncated spectral branch returns a smooth field. The pointwise branch can preserve input jumps through its channel weights.
| Physical setting | Consequence for the approximation |
|---|---|
| Smooth diffusion | Rapid decay of high modes can make a small retained set effective |
| Nonlinear wave interactions | Layers and channels must approximate the relevant mode couplings |
| Shocks and discontinuities | Sharp changes require substantial high-frequency content |
| Turbulence | Nonlinear interactions involve a range of scales |
| Heterogeneous materials | Coefficient fields or spatial conditioning must identify the material variation |
| Complex boundaries | The Fourier representation requires suitable treatment of geometry and boundary conditions |
7. Linear generators and physical structure¶
From an amplitude ODE to an operator exponential¶
The heat calculation is an example of a well-posed autonomous linear evolution problem,
The operator \(\mathcal L\) includes its boundary conditions. Its solution operator is written formally as
If the Fourier waves are eigenfunctions of \(\mathcal L\), each mode satisfies an amplitude ODE,
Solving this ODE gives \(R(k,t)=e^{t\lambda_k}\).
For periodic heat flow, \(\lambda_k=-\nu k^2\) gives the multiplier derived in Section 2. For periodic transport, \(\lambda_k=-ick\) gives the phase change discussed in Section 3. The same formula applies when the selected basis diagonalizes the known linear generator.
Known linear dynamics and learned corrections¶
The heat equation supplies an independent ODE for each Fourier coefficient. For Burgers' equation, the diffusion term remains diagonal while the quadratic advection couples modes,
The factor \(ik/2\) follows from \(uu_x=\tfrac12(u^2)_x\) and the convolution formula in Section 4. A cubic product such as \(u^3\) would require a triple convolution, and other nonlinearities give other coefficient interactions. For heterogeneous linear diffusion, the linear term itself couples Fourier modes, as in Section 3.
An FNO approximates the solution operator through learned feature transformations and activations. When part of the governing equation is known, an alternative model can preserve its linear generator and learn an unknown nonlinear term or closure,
This form assumes that the chosen basis diagonalizes the known linear part. The learned correction and the time integrator together determine prediction accuracy and stability. Their performance must be assessed on the input family and time horizon of interest.
For a linear operator with suitable eigenfunctions, a change of basis can diagonalize the evolution. For nonlinear systems, Koopman methods study linear evolution of observables in a generally infinite-dimensional function space. A finite representation used for prediction needs its own approximation and stability checks.
Continue with the CNN and discretization notebook, then the FNO block, and train the full network in the Burgers and Darcy notebook.
The original FNO paper gives the full architecture, and McCabe et al., Section 2 analyze the pseudo-spectral connection.