- Home
- Library
- Computational Quantum Field Theory
- Differentiating and Optimizing Field Calculations
- Implicit Differentiation through Solvers
Implicit Differentiation through Solvers
A self-consistent mass is defined by an equation, but a computer obtains it by an algorithm. Differentiating a finite number of iterations gives the response of that algorithm's current output. Differentiating the defining equation gives the response of its locally unique solution. These derivatives can agree after convergence, but neither a solver success flag nor a failed fixed-point iteration settles the question.
We compute a coupling response in a reference-subtracted Hartree approximation. Its root is well conditioned even when a simple iteration fails. The example separates physical approximation, quadrature, root accuracy and derivative accuracy, and then extends the same reasoning to matrix-valued systems.
Preparation: Forward and reverse AD supplies JVPs and VJPs. The Hartree subtraction is developed in integral-equation solvers; the conditions needed here are restated below.
Specify what stays fixed when the coupling changes
Consider a scalar theory in dimensions with potential
The zero-mean Hartree closure replaces the cubic field term by . For a static vacuum with internal squared mass , a symmetric momentum cutoff gives
Thus the tadpole coefficient is . The action, local mass insertion and Hartree scope are supported by Baacke and Heinen, §II, Eqs.(2.1)–(2.3), and §III.A (PDF). Their nonequilibrium calculation is not being reproduced; Eq.(2) defines our static hard-cutoff approximation.
Fix a reference mass by requiring at , for every value of . Eliminating the bare parameter between the two conditions gives
As changes, is therefore retuned. This defines a different derivative from holding the bare mass fixed. Subtracting a tadpole into the mass is also discussed in Baacke and Heinen, §III.D, Eqs.(3.15)–(3.20) (PDF); our reference condition and finite regulator are explicitly those in Eq.(3).
Use as the unit of mass, with and . Hence , and below denote their dimensionless values in these units. Define
The numerical task is to solve and determine while this reference condition remains fixed. The answer concerns the internal Hartree mass, not an exact pole mass of the interacting theory.
Differentiate the equation, not the solver history
Suppose is continuously differentiable near a root and . Differentiating gives
The implicit function theorem makes this a local statement about a particular branch. It does not select among distinct roots or guarantee invertibility elsewhere. This root formulation and its JVP/VJP implementation are explained in Blondel et al., §2.1, Eqs.(1)–(6).
For our example an independent integration gives
For , . Moreover, and . Consequently there is exactly one root in , and
The negative response is compatible with the positive tadpole in Eq.(2): increasing the coupling also lowers the bare mass according to the fixed reference condition. Ignoring that retuning would change the derivative's sign in this example.
There is no positive- bifurcation of this branch. A denominator becoming small can signal a genuine large response in other equations, but that mechanism is excluded here by .
A numerical root with separately checked partial derivatives
The calculation reuses the finite-momentum quadrature from the integral-equation example. Its stable difference is
With , Gauss–Legendre quadrature on the fixed interval evaluates the integral. An AD-compatible version of Eq.(8), on the same fixed nodes, supplies and by actual dual propagation. A bracketed root solve supplies . We then apply Eq.(5), without differentiating the root solver's branches or stopping rule.
The independent benchmark solves the closed- equation and differentiates Eq.(6). Thus the closed answer is not inserted into the numerical quadrature. With order 128 quadrature:
Across the fixed orders 64, 128 and 256 and these three couplings, squared-mass differences from the closed benchmark are below and response differences below . Refinement at this scale need not be monotone: rounding and the root stopping error are already comparable to the quadrature changes.
At , centered differences of separately solved roots reproduce the derivative with errors , and at coupling steps , and . The error reaches at , then grows to at . Agreement at several steps is more informative than choosing only the most favorable one.
Residual accuracy and response accuracy
Because for positive , the exact finite-cutoff residual obeys the mean-value bound
A quadrature residual alone does not give this exact bound unless its integration error is also controlled. Here we can recompute from Eq.(6).
For the response function , its derivative with respect to the approximate root is
A bound on this expression over a root bracket turns a value-error bound into a response-error bound. In a matrix problem the analogous estimate also depends on the inverse Jacobian and the accuracy of its linear solve; see Blondel et al., §3 and Appendix D.
At fixed order 128 and , requesting root absolute tolerance gives an actual squared-mass error , closed residual and response error . The and requests happen to stop at the same numerical root: value error and response error . A tolerance is an algorithmic condition, not a predicted error equal to that number.
What differentiating a finite iteration returns
Consider the undamped iteration
Since is independent of , its derivative starts at . Forward differentiation gives
This is the exact derivative of the finite iteration program in real arithmetic. It approaches Eq.(7) only if the iteration and derivative propagation converge appropriately. For , Eq.(11) maps into itself and its derivative has magnitude below . The retained derivative errors after , , and iterations are respectively , , and .
At , the same rule gives
The next real-mass quadrature is undefined, so the program stops and records the failure. It does not clip to a small positive number. The implicit root is nevertheless , with . The iteration failed; the root did not become singular.
A declared relaxation changes the algorithm to
At its derivative on is , which lies between and . Its endpoint images lie in , so it is a contraction on that interval. Differentiating this new finite program keeps fixed. The response errors after , , and iterations are , , and .
Fixed cutoff and quadrature order 128. Left: the actual finite-iteration derivatives approach the independently checked root response. Right: the unrelaxed iteration leaves the positive-mass domain after three updates. The dashed root remains well conditioned; no Hartree phase transition is inferred from this solver failure.
The pure kernel implicit_response.py, driver implicit_checks.py and retained implicit-results.json are in examples/computational-qft/optimization/. They import the earlier Hartree value kernel read-only. The new study varies derivatives, quadrature and solver stopping; it does not repeat the earlier regulator-removal study or estimate Hartree's error relative to the exact theory.
General systems: solve for products, not an inverse
Let with , and suppose is invertible at the chosen solution. For a parameter direction , a JVP requires the linear solve
If a scalar observable is the target, solve instead
The first derivative on the right is the direct parameter dependence at fixed . Matrix-free JVPs and VJPs can apply and its transpose without forming the dense Jacobian. A preconditioner improves the solve but does not alter the equation being differentiated. An inaccurate linear solve, an inaccurate root and a nearly singular are separate possible errors.
For a fixed point , use . Invertibility of is sufficient for a local implicit derivative; convergence of the naive iteration usually needs the stronger condition that the spectral radius of be below one. Equations (11)–(14) show this distinction with an actual failed iteration.
Summary
An implicit response is determined by a defining equation, a selected branch and the conditions held fixed as parameters change. In the Hartree example, fixing a reference mass requires retuning the bare mass and produces a negative coupling response. Dual derivatives of the residual, a bracketed root and independent finite differences agree. Unrolling a finite iteration computes a different derivative until convergence; algorithmic failure does not by itself imply a singular physical response.
Exercises
1. Hold the bare mass instead
Differentiate Eq.(2) with respect to at fixed , and . Compare this with Eq.(7). Explain the large-cutoff behavior of the two responses when compared at the same finite positive .
Solution
Write . The fixed-bare equation is , so
The derivative of is the same as that of because their difference is independent of . In the reference prescription, , giving
At fixed finite , . The fixed-bare numerator grows logarithmically, whereas the subtracted numerator tends to . The common denominator tends to . Comparing these derivatives at a common requires choosing each prescription's bare input accordingly; a trajectory with one unretuned bare mass need not keep finite as changes. The difference is a difference of physical parameter conditions, not a contradiction between differentiation methods.
2. A real singular response at a fold
For , find both real branches and their derivatives. Explain why a small residual does not uniformly guarantee a small value or response error near . Contrast this with the Hartree root above.
Solution
For , , and
At , : the invertibility hypothesis fails. For there is no real root. On a chosen positive branch, an approximate satisfies the exact identity
There is no uniform residual-to-value bound as the denominator tends to zero. For instance, has residual , yet its relative value error is one and its implicit response is half the correct response. A residual also does not select the branch: both exact roots have zero residual.
By contrast, the positive-coupling Hartree example has throughout its positive-mass domain and a unique root in . Its unrelaxed iteration failure therefore cannot be attributed to this fold mechanism.
References
- Jürgen Baacke and Andreas Heinen, Nonequilibrium evolution of theory in dimensions in the 2PPI formalism (2003), arXiv:hep-ph/0212312v2, §II Eqs.(2.1)–(2.3), §III.A and §III.D Eqs.(3.15)–(3.20) (PDF). The action normalization, Hartree interpretation and tadpole subtraction are relevant; the finite static reference condition is specified separately here.
- Mathieu Blondel, Quentin Berthet, Marco Cuturi, Roy Frostig, Stephan Hoyer, Felipe Llinares-López, Fabian Pedregosa and Jean-Philippe Vert, Efficient and Modular Implicit Differentiation (2022), arXiv:2105.15183v5, §2.1 Eqs.(1)–(6), §3 and Appendix D. Root and fixed-point differentiation, Jacobian products and the sensitivity to approximate solutions.
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.