Spectral PDE Lab
Make PDE structure executable.
Browser-side Fourier solvers for classical PDE archetypes that show up in diffusion models, flow matching, physics-informed neural networks, and neural operators. The lab is for inspecting how spectral structure controls dynamics, not a replacement for a production solver.
Exact under
- Periodic boundary conditions on a cube
- Smooth initial data band-limited to the FFT grid
- Constant coefficients (heat, transport, free Schrödinger, Poisson)
- Exponential time integration of the diagonalized operator (no CFL constraint for parabolic problems)
Approximate when
- Boundary conditions are non-periodic (Dirichlet, Neumann, free space): use Chebyshev or windowing instead
- Coefficients vary in space (variable-coefficient elliptic, nonlinear)
- Initial data has high-frequency content beyond the FFT grid (aliasing)
- Geometry is not a simple box (use finite-element methods)
Why this matters for ML
The forward process of a denoising-diffusion model is the heat equation on the data density. Inverting it during sampling is equivalent to running the score-equation backward in time. Knowing what spectral content the diffusion preserves (low frequencies) versus what it destroys (high frequencies) tells you exactly what the sampler can and cannot recover.
Flow matching trains a velocity field whose ODE pushes the reference distribution to the data distribution. The simplest targets are diagonalized Fourier multipliers, which the spectral lab evaluates exactly.
PINNs and neural operators are most often benchmarked against spectral solvers because the spectral solution is the gold standard on periodic boxes with smooth coefficients. Claiming a neural method is impressive without comparing to the spectral baseline on these problems is not a serious benchmark.
Method
- Discretize the spatial domain on a regular grid with N points per dimension.
- Apply the FFT to recover Fourier-mode amplitudes û_k for wave numbers k = -N/2, …, N/2 - 1.
- Evolve each mode independently under the diagonalized operator. For the heat equation ∂_t u = α Δ u, û_k(t) = exp(-α |k|² t) û_k(0).
- Inverse FFT to recover the spatial solution at any time.
- Verify: Parseval's theorem checks energy conservation; compare to the closed-form solution where one exists.
Implementation status
The solver code lives on the worktree codex/knowledge-state-preview and lands on main when the provider-seam refactor merges. Until then, the spectral content is embedded inline in the PDE fundamentals topic page below.
A standalone lab experience remains on the Run 4+ roadmap (see Technical Labs).
Read the underlying theory
- PDE Fundamentals for ML — the six PDE archetypes, classification (parabolic / hyperbolic / elliptic), notions of solution, and where they embed in ML systems
- Diffusion Models and SDEs — the heat-equation interpretation of the DDPM forward process
- Physics-Informed Neural Networks — what PINNs and neural operators do differently from spectral solvers, and where they actually win
- Spectral Theory of Operators — the underlying functional-analytic framework
Source
The spectral solver is being developed inside TheoremPath. When it lands on main, it will live at src/components/labs/spectral-pde/. Until then, this page documents the planned surface and links to the underlying theory.