- Home
- Library
- Computational Quantum Field Theory
- Solving Boundary and Evolution Equations
- Variational Neural Solvers
Variational Neural Solvers
A field can be approximated by minimizing its energy instead of squaring its differential equation. For a positive linear operator, this gives an exact relation between functional error and field error. A neural parameterization preserves that relation only when its trial functions satisfy the boundary conditions and the integral being evaluated is the correct one.
We will minimize a scalar energy with a small neural network, compare it with spectral Galerkin, and deliberately underintegrate the neural functional. The last calculation produces a value below the true minimum, exposing which part of the variational argument failed.
Preparation: The sourced scalar example in residual minimization, integration by parts and constrained optimization. The model is a classical positive elliptic problem; the energy functional here is not a quantum Hamiltonian expectation value.
The functional and its admissible space
On , define
with and . The space specifies square-integrable first derivatives and zero endpoint traces. The source term has the negative sign appropriate to the static energy with a positive source in the field equation.
Vary by . Then
The endpoint term vanishes because the variation has zero traces. Stationarity therefore gives
The positive bilinear form makes this minimizer unique in the full function space. The exact solution and integrated response are
Neural Ritz methods replace the admissible function by a parameterized trial and then approximate the integral. These are separate steps. E and Yu, §2, Eqs. (1)–(11) explicitly distinguish the trial representation, quadrature and optimizer.
An exact identity, rather than a small-loss heuristic
Write , where both and satisfy the zero endpoints. Expanding the functional gives
The weak equation is , so
The right side is nonnegative. This proves the variational bound and identifies the error it measures. It does not require the parameter optimizer to reach its minimum: every admissible trial satisfies the identity when the integrals are exact.
Taking in the weak equation gives , hence
Consequently the corrected response
obeys
The ordinary approximation has no such sign restriction. Multiplying the exact solution by a constant larger than one immediately makes its integral exceed . The quadratic correction removes the first-order error.
By contrast, minimizing weights an eigenfunction error with the square of its operator eigenvalue. The energy difference weights it with one power. Both objectives have the same exact solution in suitable spaces, but their finite-trial optimization problems and sensitivity to derivatives differ.
Training a genuinely admissible neural trial
Use the same one-hidden-layer family as the residual calculation:
All parameters are trained. The factor enforces the essential boundary condition before optimization; it does not insert the exact solution. If , the energy gradient is
Only first spatial derivatives enter this objective. A residual-square method needs second spatial derivatives, though neither observation alone establishes which finite training problem is easier.
The retained study uses , and , a -point Gauss–Legendre training rule and three prescribed starts at each value. It reuses the parameter initialization, bounds and optimizer budget of the residual page. Each fit has at most accepted iterations and objective-and-gradient calls. No validation value selects a restart or a preferred seed.
Independent - and -point rules evaluate every final state; the designated start-zero models also receive adaptive integration. For those models:
| Relative error | |||
|---|---|---|---|
The two error columns satisfy the expected factor of . At , the ordinary response error is ; the corrected response error is smaller and has a prescribed sign in the exact-integral theory.
The same thin-layer model's three starts have relative field errors , and . The last reaches the iteration cap; none of the three meets the independent projected-gradient target . Across all nine primary Ritz fits, only five meet that gradient target. A function-decrease success flag therefore does not establish stationarity or global optimality. Convexity of as a functional of does not make its composition with nonlinear neural parameters convex.
The variational statement itself remains useful even for an imperfect fit. What must be controlled is admissibility and the true value of the integral, not a promise that every neural optimizer succeeds.
Spectral Galerkin and an exact response tail
Expand in normalized zero-boundary modes
The source coefficients are
Stationarity in the span of the first odd modes gives . This is a conventional linear Galerkin solve with diagonal stiffness matrix, independent of the neural approximation.
Its integrated response is
Because the Galerkin solution is stationary within its linear subspace, . Therefore its ordinary and corrected responses coincide, and
Every omitted term is positive. A conservative integral comparison gives
To see the bound, replace each denominator by , include the omitted even integers as well, and bound the resulting decreasing sum by the integral from to infinity. It is deliberately not an optimized tail estimate.
At , gives response error ; gives and gives . The latter is similar to the designated neural corrected-response error, but obtained through a simple diagonal linear calculation with an analytic positive tail.
The numerical quadrature controls also reveal a useful limitation. At , the - and -point validation rules do not agree at the prescribed tolerance for several rapidly oscillating error integrals. Those misses are retained. The response sum and Galerkin energy identity above are available algebraically, so they need not be inferred from the underresolved validation rule. Increasing an integration order is not the same operation as increasing the trial-space dimension.
A quadrature minimum below the true minimum
An extra frozen diagnostic uses the same network and start zero, but trains its energy on only eight Gauss points. The continuum minimum is
to the displayed precision. The fit reports the training value
which is lower. Independently integrating that same retained function gives
There is no contradiction with the variational principle: the function is admissible, but is a different functional. The nonlinear trial has exploited the quadrature rather than accurately minimizing the continuum energy. Fifteen parameters contact their prescribed bounds, and the independent gradient target is missed; both facts remain in the output.
At , a fixed eight-point training rule yields a misleading low energy. The left panel compares the same retained functions with the exact field; the right compares independently evaluated response errors with the analytic Galerkin sum. The continuum minimum is not estimated from the training rule.
The independently adaptive and -point energy integrals differ by at most across the designated models, including this diagnostic. This is strong refinement evidence for those computed integrals, not a rigorous quadrature enclosure. The paper introducing Deep Ritz already warns that a functional minimized at fixed nodes may not be minimized between them: E and Yu, §2.2.
The full shared study performs prescribed fits, including residual models and this diagnostic, with objective-and-gradient calls and interior-node evaluations. On the recorded host the fits took about seconds and validation about seconds. These totals exclude the separately run deterministic checks; they are implementation-specific observations, not a general speed comparison. The small conventional solves remain inexpensive.
Summary
A legitimate neural Ritz method minimizes a known functional over admissible trial functions. Its exact energy error is a squared field-error norm, and a corrected response inherits a useful lower bound. These statements survive incomplete optimization but require the correct integral and boundary space. Fixed quadrature, parameter bounds and optimizer stopping introduce additional approximations, each of which the retained calculation tests separately.
Exercises
1. One-function Ritz approximation
Use the trial . Find its optimal coefficient, energy and corrected response for any . Explain which comparisons with the exact response have a definite sign.
Solution
For ,
Hence
The coefficient of is positive. Differentiating gives
At this stationary coefficient, , so
The inequality follows from admissibility and the variational identity, not from a fitted numerical pattern. For an arbitrary nonstationary coefficient , the corrected response is still a lower bound, but the ordinary integral need not be.
2. Which boundary problem does a penalty minimize?
Allow free endpoint values and minimize
Derive the boundary conditions at finite . Find the symmetric solution and compare with the Dirichlet limit.
Solution
The bulk variation again gives . The endpoint terms now remain:
Independent endpoint variations therefore impose Robin conditions
at each end, where at zero and at one.
Reflection symmetry and uniqueness give
At , , so satisfies the Neumann problem and has energy . It is not a Dirichlet trial. As , tends to , recovering the zero-boundary solution. Finite penalties solve a different variational problem; a value below the Dirichlet minimum is not a violation of the Dirichlet theorem.
References
- W. E and B. Yu, “The Deep Ritz method: A deep learning-based numerical algorithm for solving variational problems,” Communications in Mathematics and Statistics 6, 1–12 (2018), doi:10.1007/s40304-018-0127-z; arXiv:1710.00211v1. Consulted §2, §3.1 Eq. (13) and §3.3.
- I. E. Lagaris, A. Likas and D. I. Fotiadis, “Artificial neural networks for solving ordinary and partial differential equations,” IEEE Transactions on Neural Networks 9, 987–1000 (1998), doi:10.1109/72.712178; arXiv:physics/9705023v1, §§2–2.1 for boundary-adapted trial functions and their derivatives.
- SciPy developers, L-BFGS-B options, SciPy 1.13.1. Optimization status is reported separately from functional quadrature and continuum error.
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.