FFT Weak-Residual Engine
Implementation & benchmark of arXiv:2608.10389 — Efficient Weak-Entropy PINN for Solving Hyperbolic Conservation Laws
Source paper: Efficient Weak-Entropy PINN for Solving Hyperbolic Conservation Laws arXiv:2608.10389 ⓘ · analyzed Sep 1, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Evaluate weak residuals against a bank of periodic trigonometric test functions using FFT projections instead of repeated pointwise quadrature or output automatic differentiation. Frequency truncation and mode weighting provide a direct way to control the spatial scales enforced during neural PDE training.
Formulas
Mathematical statement
For the weak residual $R_\phi=-\int[u\partial_t\phi+f(u)\cdot\nabla\phi]$, choose periodic Fourier tests $\phi_k(\mathbf{x})=e^{2\pi i k\cdot\mathbf{x}}$, where $k$ is an integer frequency vector. Their spatial derivatives are known exactly: $\nabla\phi_k=2\pi i k\phi_k$. For grid values $v_n$ on $N$ periodic points, the DFT is $\widehat v_k=\sum_{n=0}^{N-1}v_ne^{-2\pi i kn/N}$ and Parseval's identity is $N^{-1}\sum_n|v_n|^2=N^{-2}\sum_k|\widehat v_k|^2$ under this normalization. The weak loss can therefore be computed over a selected frequency set $\mathcal K$ as $L_{\mathrm{weak}}=\sum_{k\in\mathcal K}w_k|\widehat R_k|^2$. The useful mathematical properties are orthogonality, exact Fourier differentiation of test functions, Parseval energy accounting, and FFT complexity $O(N\log N)$. Nonlinear fluxes such as Burgers' $f(u)=u^2/2$ must be dealiased before their FFT is used.
Implementation notes
(1) Integrate at the residual-loss computation of a PINN or neural operator evaluated on a uniform periodic spatial grid of $N$ points and a batch of time slices. Retain only a time finite difference or time autodiff; avoid spatial autodiff of the network output. (2) Compute u = net(t, x_grid) and flux components F_j = flux_j(u). Apply torch.fft.fftn to the state and flux tensors. Construct integer frequency arrays k_j; multiply Fourier coefficients by 2*pi*1j*k_j to apply exact derivatives to test functions. For selected modes K, form the projected residual coefficients and minimize sum(w_k*abs(Rhat_k)**2). Use real sine/cosine projections if complex tensors are inconvenient. Add initial and boundary losses separately. (3) The Fourier basis, derivative multipliers, Parseval scaling, and FFT complexity come from the mathematics; grid resolution, mode cutoff $K_{max}$, weights $w_k$, time stepping, and dealiasing are empirical. For quadratic fluxes, use 3/2 zero-padding or the 2/3 truncation rule before transforming the nonlinear product. (4) First experiment: periodic 1D Burgers on $N=256$ points with a small residual MLP. Compare FFT weak loss, random weak quadrature, and a strong pointwise PINN at matched wall-clock time. Track loss decrease per second, GPU memory, shock position error, relative $L^2$ error, and high-frequency spectral error. Success is faster loss reduction and sharper shocks at equal compute without aliasing-driven instability.
Verification
Stage 1 · Toy mechanism gate: Failed ✗
Stage 2 · Mechanism transferred to benchmark: Not tested
Stage 2 · Practical benchmark result: Not run
Methodology: Toy-system gate first; the benchmark stage runs only after a pass. How verification works
Stage 1 — Mechanism check agent confidence 9/10
Built fft_weak_engine.py implementing FFT weak Burgers residuals, Fourier test-function differentiation, Parseval accounting, quadratic-flux 3/2 dealiasing, frequency truncation, and projection timing. The core predictions manifested: Parseval error was 3.39e-16, Fourier derivative error was 1.89e-14, aliasing stayed about 3e-16 through kmax/N=0.333 then rose to 0.100 and 0.205 at 0.4 and 0.45 while dealiasing stayed below 5e-16; truncated spectral and physical projection energies agreed to about 2e-16. However, the PyTorch Burgers training comparison failed with “One of the differentiated Tensors does not require grad,” so there is no valid baseline-versus-idea training result or demonstrated end-to-end win.
- Agent confidence
- 9/10
- Baseline
- Direct trigonometric projection: 19.46 ms; FFT selected projection: 0.307 ms; direct/FFT=63.4x. Strong-vs-weak training benchmark: failed before producing metrics.
- Idea
- FFT projection relative numerical check 6.97e-15; dealiasing relative error 3.60e-16 to 4.96e-16 across tested cutoffs, versus raw alias error 0.100-0.205 above the 2/3 transition; Parseval and derivative checks at machine precision.
Limitations: The neural training benchmark was not successfully executed, so loss reduction, wall-clock training speed, memory, shock position, and solution error were not tested. The speed comparison is NumPy CPU projection timing rather than a matched GPU PINN workload; random weak quadrature was also not implemented.
How to run: python3 fft_weak_engine.py
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Artifacts
- fft_weak_engine.py 8.9 KB View Raw
- report.md 1.7 KB View
- results.json 3.0 KB View Raw