- Home
- Library
- Computational Quantum Field Theory
- Differentiating and Optimizing Field Calculations
- Constrained Optimization and Physical Parameters
Constrained Optimization and Physical Parameters
How little energy can a field carry while retaining a prescribed charge? A numerical optimizer can find a stationary point, but the charge constraint, a continuous symmetry, and the units of its variables all affect what its stopping test means.
We solve a finite complex-scalar example in two ways: with a Lagrange multiplier and by eliminating the momentum exactly. A completed square supplies a global lower bound independent of either algorithm. An excited stationary solution and a poorly scaled calculation show why a small optimizer residual needs interpretation.
Preparation: Canonical fields in Hamiltonian field theory and the charge-generator sign in Noether's theorem. Derivatives here are analytic; automatic differentiation provides another way to evaluate the same Jacobians.
Charge fixes a rotating minimum
Consider a classical complex field on a periodic one-dimensional lattice. Write
There are sites, spacing , and length . The momentum density obeys ; the canonical discrete momentum is . With , use
This charge follows the site's current . Thus , and the phase transformation is . Periodicity cancels the spatial flux, so . This is a genuine global charge. The integral of a single real field would not serve the same purpose.
Fix . Since preserves the Euclidean norm in component space,
Equality requires a spatially constant field and . The charge then gives . Therefore
The minimizing initial data evolve as . The charge supports a rotating configuration, not a nonzero static field. This finite classical calculation does not compute the spectrum of an interacting quantum field theory.
Multipliers, stationarity, and a global certificate
Let , where . The constrained Lagrangian is
Its stationarity equations, after dividing field gradients by , are
Eliminating gives . The minimum has , but other eigenmodes also solve these equations. For ,
A nonzero can therefore have exactly vanishing stationarity residual and still fail to minimize the energy. The nonlinear charge equality makes the feasible set nonconvex. General KKT conditions are not automatically sufficient here; the completed square is the independent global argument. The distinction between necessary stationarity and convex sufficiency is developed in Boyd and Vandenberghe, §5.5.3, pp.243–244 (PDF).
There is also a simple dual certificate. Completing the square with instead of gives
Its unrestricted infimum is zero for and minus infinity otherwise. The dual lower bound is consequently on that interval. Its maximum, , equals the exhibited feasible energy. This explicit equality establishes optimality without a general claim of strong duality for nonlinear constraints.
Remove a flat direction only for the stated task
Rotating both and by a constant phase preserves and . The phase direction is a null vector of the Lagrangian Hessian at the minimum. An energy minimization cannot select one phase.
For this phase-invariant objective, we choose the positive local representative with and . All fixed-phase runs below return that positive sign. This coordinate choice requires . It does not turn a physical global symmetry into a gauge redundancy, and would be inappropriate if the requested observable depended on that phase. In the full optimizer the phase condition is a linear equality. In the reduced optimizer we remove that component from the variables.
The charge gradient and the phase gradient are independent at the chosen minimum. Restricting the Hessian of to their common tangent space removes the phase null direction and tests curvature along feasible perturbations. This is a local diagnostic; the square still supplies the global proof.
Eliminate the momentum instead
For any nonzero , put . Every momentum satisfying the charge constraint can be written
The two terms are orthogonal, so its kinetic energy is . The minimum at fixed has , leaving
Reconstructing the eliminated momentum enforces charge algebraically. The zero field is outside the reduced domain. This procedure minimizes over momentum exactly; it does not parameterize every feasible momentum or discard an uncontrolled dynamical term. It reduces the numerical problem from 32 variables with two equalities to 15 phase-fixed field components in the example below.
The two formulations have different numerical failure modes. A multiplier solve can leave a small constraint residual; elimination can produce steep derivatives near a forbidden denominator. Neither formulation removes the need to inspect physical gradients and the objective.
Scale the variables before interpreting a tolerance
Introduce and . Then
The target energy, charge, and constant-field components are now order one. A variable transformation sends gradients to and Hessians to . The optimizer tests derivatives in its own coordinates; a fixed numerical tolerance has no invariant meaning under arbitrary changes of .
For the retained comparison define the normalized physical residual
Here is recomputed from the final fields. The companion also retains the solver's multiplier and coordinate residual. This independent residual tests the full physical stationarity equations, not only the phase-fixed coordinate problem.
The retained optimization
The calculation fixes , , , and . Three deterministic, nonuniform starts are declared in charged_quadratic.py; the third also has a charge-orthogonal momentum component. No random initialization is selected for success.
The multiplier method uses SciPy 1.13.1 trust-constr, exact first/second derivatives, dense QR constraint projections, a gradient/constraint tolerance , trust-radius tolerance , and 500 iterations. Elimination uses BFGS with its analytic gradient, tolerance , and the same iteration cap. SciPy distinguishes a gradient stop from a trust-radius stop and reports evaluation counts separately. SciPy 1.13.1, trust-constr, BFGS.
| Formulation | Start | Stop | Iterations | |
|---|---|---|---|---|
| Multiplier, normalized | 1 | Trust radius | 32 | |
| Eliminated, normalized | 1 | Precision loss | 9 | |
| Multiplier, normalized | 2 | Trust radius | 36 | |
| Eliminated, normalized | 2 | Gradient | 12 | |
| Multiplier, normalized | 3 | Trust radius | 40 | |
| Eliminated, normalized | 3 | Gradient | 11 | |
| Multiplier, poor coordinates | 1 | Coordinate gradient | 23 | |
| Eliminated, poor coordinates | 1 | Precision loss | 59 | |
| Multiplier, phase unfixed | 1 | Trust radius | 28 |
The six normalized runs attain energy one within and charge within . That rounded energy agreement does not establish a accurate field or gradient: the energy is quadratic in small deviations near a stationary minimum. The positive completed-square residuals are evaluated directly, avoiding subtraction of two nearly equal energies.
For the poor-coordinate multiplier control, . The reduced control alternates these factors among its field coordinates. Both use the same physical start as their normalized counterpart. The multiplier's coordinate residual is , but its physical residual is . Its charge misses by ; the tiny energy below is therefore not a violation of the bound at its actual charge. The unfixed-phase run still reaches the minimum: a flat direction can cause ambiguity without necessarily preventing convergence.
The same physical objective is expressed in different coordinates. The physical residual uses in every run; the coordinate residual uses the optimizer's variables. The dashed line marks the requested tolerance, not a bound on every reported quantity. All stops, including precision loss, are retained.
Independent controls give and rotation/square-identity errors below . Directional differences check the supplied derivatives at several step sizes. The ground-state tangent Hessian has smallest eigenvalue in the declared physical coordinates. The first helical stationary mode instead has energy and tangent eigenvalue . Its small KKT residual is compatible with being a saddle.
The pure model, driver, and retained output are charged_quadratic.py, charge_optimization.py, and charge-results.json in the optimization example directory. The finite problem has an exact analytic minimum; it does not test continuum extrapolation or global convergence of a general nonlinear optimizer.
Summary
A constraint is part of the physical problem, while a tolerance belongs to a chosen numerical representation. Multipliers expose stationarity and elimination can enforce a constraint exactly. The charge example also needs a phase representative and physically scaled residuals. Its global minimum follows from a completed square, which distinguishes a correct minimum from an excited KKT solution and a successful stop from an accurate gradient.
Exercises
- Allow either sign of . Find the minimum energy and the full range of dual multipliers for which is finite. What changes at ?
Solution
The square with arbitrary contains . For every term is nonnegative, and the zero field gives infimum zero. If , a constant field with can be scaled to make the expression tend to minus infinity. The best dual lower bound is thus
For nonzero charge, choose , constant , and . These fields realize both the charge and the bound. Negative charge reverses the rotation. At zero charge the minimizing field and momentum both vanish because . Its phase is undefined, so the nonzero-field phase chart and reduced formula with should not be used to describe that endpoint.
- Show directly that a nonuniform Fourier stationary state is not a constrained minimum. Construct a charge-preserving path that initially leaves its energy stationary but then lowers it.
Solution
Let be a constant real-component field and the helical Fourier field, each normalized by , with . Their eigenvalues are and . Define
Choose and , so for every . Its energy is . Minimizing this radial variable gives and
The first derivative vanishes at the Fourier state, but the second derivative is negative. This is a feasible descent direction, independent of any numerical Hessian eigensolver. With both component fields aligned along the first axis at site zero, it also lies in the chosen phase chart near .
References
- Stephen Boyd and Lieven Vandenberghe, Convex Optimization (Cambridge University Press, 2004), author PDF, §5.5.3, pp.243–244, Eq.(5.49): KKT conditions and their convex sufficiency assumptions.
- SciPy developers, SciPy 1.13.1 Manual, trust-constr and BFGS: coordinate tolerances, derivatives, evaluation counts and termination statuses used in the companion.
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.