Skip to content
QFT.org

Search QFT.org

Enter a word or phrase.

    You can also browse the main navigation and chapter contents.

    Suppose an external source is changed hundreds of times while the field equation stays fixed. A conventional solver computes the response to each source. An operator learner instead pays for a collection of solved examples and tries to predict the response to a new function. The useful question is whether that investment buys sufficient accuracy on the inputs that will actually be encountered.

    We train a small Fourier network for a nonlinear periodic scalar equation and compare it with direct solves and reduced bases. The fitted weights can be evaluated on finer grids, but the resulting error barely improves on the original input distribution and grows sharply for sources with unfamiliar frequencies. These outcomes distinguish reuse of parameters from recovery of information or convergence to a continuum solution.

    Preparation: Fourier series, a nonlinear elliptic solve, and the distinction between training and held-out error. Spectral collocation develops the conventional discretization, and reduced-basis surrogates introduces the comparison method.

    A nonlinear map from sources to fields

    Let xx run around a circle of circumference one. All quantities in this example are dimensionless. For a real periodic source ff, solve

    −ε2u′′+u+u3=f,ε>0.(1)-\varepsilon^2 u''+u+u^3=f,\qquad \varepsilon>0. \tag{1}

    This is a classical elliptic response problem. Its energy is

    Ef[u]=∫01[ε22(u′)2+12u2+14u4−fu]dx.(2)\mathcal E_f[u] =\int_0^1 \left[ \frac{\varepsilon^2}{2}(u')^2 +\frac12u^2+\frac14u^4-fu \right]dx . \tag{2}

    The quartic normalization is λu4/24\lambda u^4/24 with λ=6\lambda=6, consistent with the site's scalar convention. The problem has periodic boundaries; it is a deliberate extension of the chapter's Dirichlet example, not a change to that example's boundary condition.

    The quadratic terms make Ef\mathcal E_f coercive and strictly convex on periodic H1(0,1)H^1(0,1). In one dimension the quartic integral is well defined there. Thus each square-integrable ff has a unique minimizer and weak solution. The map

    G:(f,ε)⟼u(3)\mathcal G:(f,\varepsilon)\longmapsto u \tag{3}

    is nonlinear in ff. It nevertheless satisfies the exact symmetry G(−f,ε)=−G(f,ε)\mathcal G(-f,\varepsilon)=-\mathcal G(f,\varepsilon).

    There is also a useful stability estimate. For a sufficiently regular periodic trial field vv, define

    r(v)=−ε2v′′+v+v3−f.(4)r(v)=-\varepsilon^2v''+v+v^3-f. \tag{4}

    Subtract the equation for uu, set e=v−ue=v-u, and integrate against ee:

    ε2∥e′∥22+∥e∥22+∫01(v3−u3)e dx=∫01r(v)e dx.(5)\varepsilon^2\|e'\|_2^2+\|e\|_2^2 +\int_0^1(v^3-u^3)e\,dx =\int_0^1r(v)e\,dx. \tag{5}

    The cubic contribution is nonnegative because (v3−u3)(v−u)=(v−u)2(v2+uv+u2)(v^3-u^3)(v-u)=(v-u)^2(v^2+uv+u^2). Consequently,

    ∥v−u∥2≤∥r(v)∥2.(6)\|v-u\|_2\leq\|r(v)\|_2. \tag{6}

    This statement uses the actual residual of the trial field and the correct boundary domain. A small empirical training loss is a different quantity.

    What a Fourier layer learns

    Operator learning approximates a map between function spaces using sampled input–output pairs. A practical Fourier construction first lifts the input to several channels, alternates convolution and pointwise operations, and then projects back to a field. This organization is developed by Li et al., §§2–4, Eqs. (1)–(5).

    Our input has two channels: the sampled ff and the constant ε\varepsilon. The source is divided by its training-set RMS, and ε\varepsilon is mapped affinely from [0.08,0.2][0.08,0.2] to [−1,1][-1,1]. Output units use the training-field RMS. No validation or test fields determine these scales.

    After a real affine lift to four channels, a layer has the form

    vℓ+1(xj)=tanh⁡ ⁣[Wℓvℓ(xj)+bℓ+FN−1(Rℓ FNvℓ)(xj)].(7)v_{\ell+1}(x_j) =\tanh\!\left[ W_\ell v_\ell(x_j)+b_\ell+ \mathcal F_N^{-1} \bigl(R_\ell\,\mathcal F_Nv_\ell\bigr)(x_j) \right]. \tag{7}

    Here WℓW_\ell mixes channels locally. The matrix Rℓ(k)R_\ell(k) mixes channels separately at Fourier mode kk, and is zero outside ∣k∣≤4|k|\leq4. Its negative-mode values are the complex conjugates of its positive-mode values; Rℓ(0)R_\ell(0) is real. The output therefore remains real.

    We use the numerical transform pair

    v^k=∑j=0N−1vje−2πikj/N,vj=1N∑k=0N−1v^ke2πikj/N.(8)\widehat v_k=\sum_{j=0}^{N-1}v_j e^{-2\pi i kj/N}, \qquad v_j=\frac1N\sum_{k=0}^{N-1}\widehat v_k e^{2\pi i kj/N}. \tag{8}

    This explicitly declared discrete spatial pair fixes every normalization in the implementation. It is not an implicit change to the site's spacetime Fourier convention. Constants, a single complex mode, Parseval's identity, and the reverse derivative are tested.

    Two layers and a real affine output map give 345 real parameters: 12 in the lift, 164 in each layer, and 5 in the projection. All are trained. The local operation and tanh⁡\tanh can create higher harmonics even though the convolution retains only five nonnegative modes.

    The same matrices Rℓ(k)R_\ell(k) can be applied at N=33,65,129N=33,65,129. This defines a way to reuse the weights. It does not establish that the nonlinear sampled operation is independent of resolution. Sampling, generated harmonics, and the distribution of inputs still matter. We compare the resulting trigonometric interpolants rather than equating a finer array with a more accurate field.

    A conventional reference with controlled products

    Write a real Fourier trial field in the orthonormal basis

    1,2cos⁡(2πkx),2sin⁡(2πkx),1≤k≤K.(9)1,\quad \sqrt2\cos(2\pi kx),\quad \sqrt2\sin(2\pi kx), \qquad 1\leq k\leq K. \tag{9}

    There are N=2K+1N=2K+1 real coefficients. The cubic Galerkin term tests u3u^3 against a basis function, so frequencies up to 4K4K occur in the product. We use M=2N=4K+2M=2N=4K+2 uniformly spaced quadrature nodes. This integrates the quartic energy and the cubic projection without trigonometric aliasing in exact arithmetic.

    If BB evaluates the basis at the quadrature nodes, the coefficient Hessian is

    Hab=[1+ε2ka2]δab+3∑jwjBjau(xj)2Bjb,(10)H_{ab} =\bigl[1+\varepsilon^2k_a^2\bigr]\delta_{ab} +3\sum_j w_j B_{ja}u(x_j)^2B_{jb}, \tag{10}

    where kak_a is the corresponding angular wavenumber. It is positive definite. Damped Newton therefore uses Cholesky solves and an energy line search. The implementation permits a rounding allowance of 16ϵmachmax⁡(1,∣Ef∣)16\epsilon_{\rm mach}\max(1,|\mathcal E_f|) in the Armijo test; the final coefficient residual is recomputed independently of line-search acceptance.

    The main reference has 129 coefficients. All 312 fixed inputs meet the requested relative coefficient residual of 10−1210^{-12}. At the first four inputs of each of the six groups below, the L2L^2 norm of the field difference between 129 and 257 coefficients is at most 1.19×10−161.19\times10^{-16}. Independent continuum residuals of those 24 saved reference fields are also evaluated, without another nonlinear solve; their largest norm is 8.47×10−138.47\times10^{-13}, with a 513-to-1025-point change below 3.36×10−173.36\times10^{-17}.

    Two independent limits check the equation and normalization. With the cubic term removed, every Fourier coefficient is

    uk=fk1+ε2k2.(11)u_k=\frac{f_k}{1+\varepsilon^2k^2}. \tag{11}

    For constant f=f0f=f_0, the solution is the unique real root of u+u3=f0u+u^3=f_0. The retained tests compare the numerical solver with both limits.

    The reduced bases use only the 96 training reference fields. An uncentered, L2L^2-weighted singular-value decomposition defines subspaces of fixed ranks 8 and 16. Each new input is solved by minimizing (2) in that subspace, with its actual source and ε\varepsilon. These are nonlinear reduced Galerkin solves, not predictions from an interpolated parameter table. They still evaluate the full quadrature; no hyperreduction speed claim is made.

    Fixed training and held-out tests

    The nominal sources are

    f(x)=c0+∑n=13ancos⁡(2πnx)+bnsin⁡(2πnx)n,(12)f(x)=c_0+\sum_{n=1}^3 \frac{a_n\cos(2\pi nx)+b_n\sin(2\pi nx)}{n}, \tag{12}

    with c0c_0 uniform on [−0.5,0.5][-0.5,0.5], each an,bna_n,b_n uniform on [−0.8,0.8][-0.8,0.8], and ε\varepsilon uniform on [0.08,0.2][0.08,0.2]. These are noiseless numerical examples with independently seeded inputs.

    Input groupNumberChange from the nominal family
    Training96None
    Validation24Reported without selecting a checkpoint
    Nominal test96Independent held-out inputs
    Higher frequencies32Add modes 5–8 with independent coefficients in [−0.4,0.4][-0.4,0.4], without a 1/n1/n factor
    Smaller ε\varepsilon32Set ε=0.04\varepsilon=0.04
    Larger ε\varepsilon32Set ε=0.4\varepsilon=0.4

    One initialization is trained on the 33-node inputs with 2000 Adam updates, batches of 16, and a fixed learning-rate schedule. The normalized training MSE ends at 8.50×10−48.50\times10^{-4}, and validation MSE at 8.09×10−48.09\times10^{-4}. The final full-training gradient norm is 0.029960.02996, exceeding the separately declared 10−410^{-4} target. The budget endpoint is retained; the calculation was not extended or restarted.

    For each input, define relative field error as ∥umethod−uref∥2/∥uref∥2\|u_{\rm method}-u_{\rm ref}\|_2/\|u_{\rm ref}\|_2. The table reports the RMS of that ratio across the named held-out group:

    MethodNominalHigher frequenciesε=0.04\varepsilon=0.04ε=0.4\varepsilon=0.4
    Neural, 33 nodes0.032950.566860.269780.35415
    Neural, 129 nodes0.032950.566320.269780.35415
    POD, rank 80.002120.066390.022580.000357
    POD, rank 161.01×10−51.01\times10^{-5}0.013240.0008329.76×10−79.76\times10^{-7}
    Direct, 33 coefficients7.72×10−117.72\times10^{-11}1.13×10−61.13\times10^{-6}3.77×10−73.77\times10^{-7}3.33×10−173.33\times10^{-17}

    The last row is measured relative to the finite reference; its smallest entries describe numerical agreement, not certified continuum precision. Direct 65-coefficient solves improve the difficult shifted groups further.

    Training and validation errors decrease during a single fixed fit. Held-out comparisons show nearly identical neural errors at 33 and 129 nodes, larger errors under distribution shifts, and more accurate POD and direct baselines.

    The left panel records the fixed optimization history. The right compares the same held-out fields. Fine-grid parameter reuse changes neither the nominal learning error nor the unfavorable comparison with the conventional methods.

    The integral response ∫u dx\int u\,dx is also checked. Its nominal neural RMS error is 0.0038240.003824; for the higher-frequency group it is 0.034210.03421 at 33 nodes. A smooth integrated observable is not immune to distribution shift.

    The residual provides another perspective. The 129-node network has residual-norm RMS 0.054810.05481 on nominal inputs and 8.20488.2048 on the higher-frequency group. These norms are evaluated on the prediction's trigonometric interpolant, using 513 nodes; its squared cubic residual has sufficiently low degree for that quadrature to avoid aliasing in exact arithmetic. Predetermined 1025-node comparisons at the first four inputs of each test group (16 cases) check the evaluation. The 24 validation fields enter only the training-history report, not this grid-transfer comparison.

    This network also fails to impose the exact oddness of the response: the nominal RMS of u^[f]+u^[−f]\widehat u[f]+\widehat u[-f] is 0.011440.01144. Exact cyclic grid-shift equivariance is built into the periodic layers, but source-sign equivariance is not. Arbitrary continuous shifts of the interpolants do not have that same guarantee after the sampled nonlinear activation and possible aliasing.

    Resolution, information, and cost

    A particularly direct counterexample uses

    f1(x)=cos⁡(2πx),f2(x)=cos⁡(2π 34x).(13)f_1(x)=\cos(2\pi x),\qquad f_2(x)=\cos(2\pi\,34x). \tag{13}

    They are identical at the 33 equally spaced input nodes. Any deterministic method that receives only those samples must return the same prediction for both. At ε=0.1\varepsilon=0.1, their separately resolved responses differ by 0.425600.42560 in L2L^2. At least one prediction must therefore have error at least 0.212800.21280. The retained coarse neural errors are 0.010820.01082 and 0.433690.43369.

    Evaluating the weights on the actual 129-node inputs distinguishes the two sources, but the high-frequency example still has error 0.291830.29183. Supplying new input information and generalizing to it are separate issues.

    There is a speed–accuracy tradeoff, not a demonstrated universal acceleration. On this machine, generating the fixed reference set and its controls took about 0.640.64 seconds, training took 1.301.30 seconds, and the POD decomposition took 0.000670.00067 seconds. Three isolated replays of 16 nominal predictions gave:

    Online methodElapsed range for 16 inputs
    Neural, 33 nodes0.1950.195–0.2350.235 ms
    Direct, 33 coefficients5.305.30–5.405.40 ms
    Direct, 65 coefficients8.698.69–9.029.02 ms
    POD, rank 168.388.38–8.488.48 ms

    These timings use one BLAS thread and exclude file output. The neural row times a forward pass on already normalized inputs; input construction, physical rescaling and trigonometric interpolation are excluded. The neural batch is faster here but much less accurate; the methods are not compared at a common error target. The POD implementation retains full quadrature and setup, so reducing the unknown count has not automatically reduced its measured cost. Offline work must be included when deciding whether many later queries justify learning.

    The companion retains the source, fitted weights, selected per-case diagnostics, and plotting data. Its documented commands can regenerate fixed data separately or compare the delivered model without retraining. No hardware-independent speedup, continuum guarantee, or high-dimensional performance claim follows from this small study.

    Summary

    A neural operator learns a response to sampled functions. Fourier layers provide a reusable grid implementation and periodic structure, while the data distribution and nonlinear sampling still control accuracy. In this example, fine-grid evaluation preserves a roughly 3.3%3.3\% nominal error instead of removing it; unfamiliar frequencies and parameters are harder. Direct and reduced Galerkin solves expose these limitations, and the monotonicity estimate explains which independently evaluated residual can control field error.

    Exercises

    1. Derive the residual bound and its boundary condition

    For real u,vu,v satisfying the same periodic conditions, prove (6). Then determine what changes if vv is not periodic while uu is.

    Solution

    Let e=v−ue=v-u. Since uu solves (1),

    r(v)=−ε2e′′+e+(v3−u3).r(v)=-\varepsilon^2e''+e+(v^3-u^3).

    Integration by parts yields

    ∫01r(v)e dx=ε2∫01(e′)2dx+∫01e2dx+∫01e2(v2+uv+u2) dx−ε2[e′e]01.\int_0^1 r(v)e\,dx =\varepsilon^2\int_0^1(e')^2dx+\int_0^1e^2dx +\int_0^1e^2(v^2+uv+u^2)\,dx -\varepsilon^2[e'e]_0^1.

    The endpoint term vanishes for periodic e,e′e,e'. All three remaining terms are nonnegative, so ∥e∥22≤∥r(v)∥2∥e∥2\|e\|_2^2\leq\|r(v)\|_2\|e\|_2. If e≠0e\ne0, divide by ∥e∥2\|e\|_2; if e=0e=0, the result is immediate.

    Without matching periodic traces, the endpoint term remains and has no fixed sign. A small interior residual alone cannot control arbitrary boundary mismatch. One must either impose the boundary domain or construct a lifting and include its contribution to the residual and error. The proof does not apply unchanged to a nonperiodic network output.

    2. Show that grid refinement cannot infer an aliased source

    Verify that the sources in (13) have identical samples at xj=j/33x_j=j/33. If the corresponding exact responses are u1,u2u_1,u_2, prove that any common prediction vv has maximum error at least ∥u1−u2∥2/2\|u_1-u_2\|_2/2. Explain what is different when actual fine-grid samples are supplied.

    Solution

    At the sample points,

    2π 34xj=2πj+2πj/33,2\pi\,34x_j=2\pi j+2\pi j/33,

    so the two cosines coincide. A deterministic map of the sampled array and the same ε\varepsilon consequently produces one vv. The triangle inequality gives

    ∥u1−u2∥2≤∥u1−v∥2+∥v−u2∥2≤2max⁡{∥u1−v∥2,∥v−u2∥2}.\|u_1-u_2\|_2 \leq\|u_1-v\|_2+\|v-u_2\|_2 \leq2\max\{\|u_1-v\|_2,\|v-u_2\|_2\}.

    For the retained fine solutions the lower bound is 0.212800.21280. Interpolating the common coarse array to more points leaves it common and cannot overcome this bound. Evaluating the two underlying analytic sources on a finer grid supplies different information. The bound for a common prediction then no longer applies, but the trained map still needs a separate generalization test on the new high-frequency input.

    References

    • Z. Li et al., “Fourier Neural Operator for Parametric Partial Differential Equations,” arXiv:2010.08895v3, HTML, §2 and §§3–4, Eqs. (1)–(5), for the operator-learning setup and Fourier-layer construction.

    Scrollable formula. Use Left and Right arrow keys to reveal hidden content.

    Scrollable table. Use Left and Right arrow keys to reveal hidden columns.

    Scrollable figure. Use Left and Right arrow keys to reveal hidden content.