- Home
- Library
- Computational Quantum Field Theory
- Variational Monte Carlo and Neural Quantum States
- Stochastic Reconfiguration and Natural Gradients
Stochastic Reconfiguration and Natural Gradients
A small change of neural parameters need not be a small change of quantum state. Some parameter directions merely rescale the wavefunction; others change its correlations strongly. Ordinary gradient descent measures steps in parameter coordinates. Stochastic reconfiguration instead uses the distance between normalized states to choose a direction.
We derive that metric, explain its null directions and regularization, and compare ordinary gradients with two shifted-metric updates on the same six-spin state. Every method receives the same number of samples and the same fixed update schedule. The two shifted updates let us compare the regularization strengths at fixed sample budget.
Preparation: neural amplitudes and phases, local energies and normalized gradients, and positive semidefinite matrices.
Remove changes that do not change the quantum ray
Let be an unnormalized state and . The parameter derivative contains a component parallel to the state, which changes its scale or phase. Define the projective tangent vector
It satisfies for . Its Gram matrix is the quantum geometric tensor:
For real parameter displacements, the infinitesimal squared distance between rays is
For a holomorphic complex parameterization it is . This follows by expanding the normalized overlap, or the Fubini–Study distance , to second order. The direct formula and its covariance form are given in Vicentini et al., §3.5, Eqs. (21)–(23).
When the amplitudes have suitable support, gives
This identity does not authorize division at a moving node. If but , the direct Gram matrix can contain a contribution absent from the Born covariance. The two-component node example has direct metric 1 while the support-restricted covariance gives 0.
For a real positive wavefunction, , so the classical Fisher matrix of the Born distribution is . A complex state can change its relative phases without changing ; that classical Fisher matrix then misses part of the quantum geometry.
The projected imaginary-time direction
Normalized imaginary-time evolution satisfies
Restrict the change to the variational tangent space and minimize
over real velocities. The normal equations are
The real energy gradient is . An optimization update written as
therefore uses twice the force appearing in the imaginary-time equation. With no shift and in the infinitesimal limit, this convention corresponds to imaginary-time increment . The learning rate is not silently identified with physical time.
Equivalently, unregularized natural gradient chooses the steepest energy decrease at fixed infinitesimal state distance. This local geometric statement does not guarantee global minimization of a nonconvex energy landscape. The projection and singular-direction treatment originate in Sorella's stochastic-reconfiguration formulation, §V.2, Eqs. (39)–(45), whose discussion also recognizes local minima.
Real-time variational dynamics is a different projection: with the convention , real parameters satisfy in the corresponding least-squares formulation. Holomorphic complex parameters give . The real-time article checks that evolution against an exact quench; optimizing the energy is not a substitute for it.
Null directions and noisy weak directions
If , then . A redundant global amplitude and global phase are exact examples. More generally, a vector lies in the metric null space when . An exact force has no component along an exact redundant direction, but an inverse of a numerically nearly singular matrix can magnify roundoff or statistical fluctuations.
A zero tangent can also occur at a poorly chosen parameter point. In the real, even-projected RBM, setting every visible bias, hidden bias and weight to zero produces a uniform state. The visible-bias derivatives are odd and vanish under the even projection; the hidden derivatives contain . Thus every first derivative vanishes at that point even though the uniform state's energy is not minimal. No inversion of the zero metric can create a missing first-order tangent. The production fits begin at fixed nonzero random parameters, rather than claiming that SR resolves such a stationary parameterization automatically.
For independent samples, the retained estimators use
and the analogous covariance with local energy for . These are unbiased at a fixed state. The matrix has limited rank, however, and a finite batch can omit configurations that distinguish weak tangent directions. Inverting is nonlinear:
in general. Unbiased input covariances do not imply an unbiased natural-gradient step.
A positive diagonal shift stabilizes the solve but penalizes motion in the chosen parameter coordinates. It is not the same operation as removing a known exact gauge direction. Eigenvalue truncation is another choice, with its own threshold dependence. Neither procedure should be described merely as making an otherwise unchanged algorithm faster.
A controlled comparison on six spins
Use the same periodic Pauli Hamiltonian,
and the same even-projected real RBM with hidden spins and parameters. Every trajectory starts from the identical parameter vector, drawn once with seed components and standard deviation .
Three methods are fixed before sampling: ordinary gradients, SR with , and SR with . Each performs updates. The learning rate is for updates 0–499 and thereafter. If the proposed parameter update has Euclidean norm above , it is rescaled to that norm. This cap is part of all three algorithms and its activations are counted.
For each method we run one enumerated trajectory and eight sampled trajectories. Each sampled update uses iid draws from the fully enumerated Born distribution. Replicas have independent streams; corresponding replicas across methods share uniforms, producing paired comparisons. The total is training draws. Enumerating the distribution and computing the metric add work beyond the shared sample budget.
The table uses direct final state energies evaluated after the fixed number of updates.
| Method | Enumerated final | Sampled mean final | Between-replica SD |
|---|---|---|---|
| gradient | |||
| SR, | |||
| SR, |
Here . The SD is the spread of eight optimizer outcomes, not a standard error for one state's energy and not an uncertainty in the exact reference. The shift changes the finite-budget result materially. Under this schedule, ordinary gradients leave a larger energy excess at the final step.
The update cap never activates for ordinary gradients. It activates 8–9 times in each sampled shift- run and 6 times in each shift- run. The largest scaled residual of any shifted linear solve is . That validates the linear algebra at the chosen shifts; it does not establish that the unshifted physical tangent or its weak directions were estimated accurately.
For example, the initial enumerated metric's smallest eigenvalue is and its largest is . The recorded numerical rank is 26 using the declared threshold times the largest eigenvalue. At the last sampled update of the designated shift- run, the recorded rank is 25. Small negative eigenvalues of order are consistent with roundoff in a covariance Gram matrix; materially negative values would stop the calculation. No eigenvalue flooring or silent inverse cutoff is used in these updates.
All curves evaluate the current state energy directly every ten updates. Thin curves retain the eight sampled trajectories; dashed curves use enumerated forces and metrics. The methods share initial parameters, sample budgets and learning-rate schedule. Their differing shift and cap effects remain part of the comparison.
What the comparison establishes
SR exploits state geometry effectively for this fixed finite problem, but the final gradients are nonzero and the prescribed budgets are not convergence proofs. The independent energy-coverage study uses fresh samples only after the states are frozen. Its uncertainty measures the estimator at a fixed state; it does not cover optimizer bias or regulator error.
The shared checks compare the direct Gram matrix with Born covariances where support permits, verify added amplitude/phase null directions, and test real and imaginary derivatives independently. Learned parameter vectors and all plotted trajectories are retained in examples/computational-qft/neural-quantum-states/. The default verification commands read those states without repeating the fits or sampling.
The calculation also distinguishes an exact coordinate redundancy from an uncertain small eigenvalue. Removing the former is a geometric identity. Suppressing the latter is an approximation whose effect should be measured through physical observables and alternative declared regularization choices.
Summary
Stochastic reconfiguration measures parameter changes through their effect on the normalized quantum state. Its Gram matrix makes redundant directions visible and supplies an imaginary-time-inspired descent direction. Sampling, diagonal shifts and finite steps change that ideal projection. The six-spin comparison retains each of those choices and shows their effects without turning a successful shifted solve into a claim of converged many-body physics.
Exercises
1. Global amplitude and phase are null directions
Extend any nonzero state family by , with real . Compute its projective derivatives in the two added directions. Compare the resulting quantum metric with the Fisher matrix of its Born probabilities.
Solution
The derivatives are and . Subtracting the parallel component in the definition of gives zero for both. Their metric rows and columns therefore vanish, as do their exact forces because .
The Born probabilities are unchanged under either parameter, so their classical scores and Fisher rows also vanish. This agreement holds for these global changes. For a relative-phase parameter, such as , the Born probabilities remain constant while the projective metric is . The classical Fisher matrix is zero and misses this physical phase direction.
2. Descent and the coordinate dependence of a shift
Let be positive semidefinite, let be the exact real energy gradient, and let . Show that is a nonascending infinitesimal direction. Then take and change coordinates by , where and . Compare applying the same numerical shift in the two coordinate systems.
Solution
The first-order energy change is
for , because the shifted matrix is positive definite. A positive cap factor preserves this first-order sign. Higher-order terms can spoil descent for a finite step, and a noisy estimated gradient need not have the same sign as the true directional derivative.
In coordinates, and . Applying there and mapping back gives
Shifting directly in coordinates gives in both components. The directions agree when or in the unshifted nonsingular limit, but not generally. A shift proportional to the identity therefore specifies a penalty in a particular coordinate system; it is not an invariant part of the Fubini–Study metric.
References
- S. Sorella, “Generalized Lanczos Algorithm for Variational Quantum Monte Carlo,” Physical Review B 64, 024512 (2001), doi:10.1103/PhysRevB.64.024512, arXiv:cond-mat/0009149v1. Section II and §V.2, especially Eqs. (39)–(45), for projection, optimization and singular directions.
- F. Vicentini et al., “NetKet 3: Machine Learning Toolbox for Many-Body Quantum Systems,” SciPost Physics Codebases 7 (2022), doi:10.21468/SciPostPhysCodeb.7, arXiv:2112.10526v2. Sections 3.5, 4.1 and 4.3: direct quantum geometry, nodal condition, gradient convention and time-dependent projection. No package benchmark is reproduced here.
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.