In brief. The variational energy is the mean of a local energy over configurations sampled from ∣Ψθ∣2. The local energy is cheap for sparse Hamiltonians, and its variance vanishes at an eigenstate, so the estimate gets more precise as the ansatz improves. Samples from a Markov chain are correlated; a reported error bar is only meaningful after a binning or autocorrelation analysis of a dedicated evaluation of the final state.
Variational Monte Carlo (VMC) turns the Rayleigh–Ritz principle into a stochastic algorithm. For a trial state ∣Ψθ⟩,
Eθ=⟨Ψθ∣Ψθ⟩⟨Ψθ∣H∣Ψθ⟩≥E0,
and the two sums over the configuration basis hidden in this ratio are replaced by an average over samples drawn from ∣Ψθ∣2. The method rests on two facts: the energy is the mean of a local quantity that is cheap to evaluate for a sparse Hamiltonian, and that quantity has zero variance when ∣Ψθ⟩ is an eigenstate.
The local energy estimator
Work in an orthonormal basis {∣σ⟩} (spin configurations, occupation numbers, particle positions). Insert two resolutions of the identity:
The sum over σ′ runs only over configurations connected to σ by a nonzero matrix element. For a lattice Hamiltonian with N sites and short-range terms there are O(N) such configurations, so one local energy costs O(N) wavefunction ratios. The normalization of Ψθ never enters: only ratios Ψθ(σ′)/Ψθ(σ) are needed, which is why unnormalized ansätze such as neural networks are usable at all.
For the spin-21 Heisenberg model H=J∑⟨i,j⟩Si⋅Sj in the Sz basis with σi=±1,
where σ(ij) is σ with spins i and j exchanged. The off-diagonal term contributes only on antiparallel bonds. After the Marshall sublattice rotation on a bipartite lattice the off-diagonal coefficient becomes −21 and the ground state has positive amplitudes; for frustrated couplings no such rotation exists and the ratio carries a nontrivial sign, see the J₁–J₂ benchmark page.
Eloc is complex in general. Its mean is real because H is Hermitian; the imaginary part of the sample mean is pure noise and a useful sanity check.
Sampling
Samples from pθ are produced by a Markov chain with Metropolis–Hastings acceptance
A(σ→σ′)=min[1,q(σ′∣σ)q(σ∣σ′)Ψθ(σ)Ψθ(σ′)2]
for a proposal q. Single-spin flips are the generic choice; exchange moves on nearest-neighbour pairs conserve Stotz and restrict the chain to one magnetization sector, which is how the Sz=0 sector of a Ketboard instance is enforced in practice. Autoregressive architectures bypass the chain entirely and draw exact, independent samples from pθ (Sharir et al., arXiv:1902.04057; Hibat-Allah et al., arXiv:2002.02973), at the price of constraining the functional form.
Sampling ∣Ψθ∣2 is always a positive distribution, so VMC has no sign problem in the Monte Carlo sense. The sign problem reappears as a representation problem: the ansatz must encode the sign or phase structure of the ground state, and for frustrated or fermionic Hamiltonians this is where the difficulty lives.
The zero-variance property
If H∣Ψθ⟩=E∣Ψθ⟩ then Eloc(σ)=E for every configuration with nonzero amplitude. Hence the energy variance
vanishes exactly at any eigenstate, and the statistical error of the estimator vanishes with it.
Noise shrinks as the ansatz improves. The statistical error bar on Eθ scales as Varθ(H)/Neff, so a better wavefunction needs fewer samples for the same precision. This is the opposite of what happens for most other observables.
The variance bounds the energy error. Temple's inequality gives, when Eθ lies below the first excited energy E1,
0≤Eθ−E0≤E1−EθVarθ(H),
and Weinstein's bound guarantees an eigenvalue within Varθ(H) of Eθ. The variance is therefore the only intrinsic quality measure available when the exact energy is unknown. The dimensionless V-score NVarθ(H)/(Eθ−E∞)2 of Wu et al. (arXiv:2302.04919) builds on exactly this.
Variance extrapolation is not a variational energy. Plotting E against Var(H) for a family of states and extrapolating to zero variance produces estimates that are typically more accurate than any member of the family, but no longer satisfy E≥E0 and depend on the extrapolation model. Ketboard records the directly evaluated Eθ only; extrapolated values belong in the paper, not in the table.
Report Varθ(H), or the variance per site, next to every energy. Two states with the same energy and different variances are not equally close to the ground state.
Error bars and autocorrelation
Markov-chain samples are correlated, and the naive standard error Var(Eloc)/Ns underestimates the true uncertainty, often by an order of magnitude. Let ρ(t) be the normalized autocorrelation of the sequence Eloc(σ1),Eloc(σ2),… at lag t. The integrated autocorrelation time
τint=21+t=1∑∞ρ(t)
sets the effective number of independent samples Neff=Ns/(2τint), and the variance of the sample mean Eˉ is
Var(Eˉ)=Ns2τintVar(Eloc)(Ns≫τint).
Estimating τint by summing the empirical ρ(t) requires a truncation window, because the tail of the estimated autocorrelation is itself noisy; the standard rule truncates at the smallest W with W≥cτint(W) for c≈5–10 (Sokal's windowing; the Γ-method of Wolff, arXiv:hep-lat/0306017, includes an error estimate for τint itself).
The binning (blocking) analysis avoids estimating ρ(t) explicitly. Partition the chain into Nb consecutive blocks of length b, form the block means Eˉk, and compute
σ^b2=Nb(Nb−1)1k=1∑Nb(Eˉk−Eˉ)2.
As b grows past a few τint the block means decorrelate and σ^b2 saturates; the plateau value is the variance of Eˉ, and τint follows from the ratio of the plateau to the naive estimate. Doubling b until the plateau is reached, with at least Nb≳30 blocks left, is the usual procedure (Ambegaokar and Troyer, arXiv:0906.0943). A binning curve that is still rising at the largest block size means the chain is too short for a trustworthy error bar.
With M independent chains, the variance of the chain means gives a second estimate; the ratio of between-chain to within-chain variance (the Gelman–Rubin R^) exposes chains stuck in different regions of configuration space, a common failure for ansätze with sharp sign structure. Discard the warm-up portion of each chain; the length needed is itself of order several τint, measured from a cold or random start.
Two pitfalls are specific to variational calculations:
Optimization traces are not measurements. Energies recorded during optimization are correlated through the parameter trajectory, and their scatter mixes statistical noise with parameter drift. A reported energy must come from a separate evaluation of the final, fixed state with its own binning analysis.
Samples shared between the energy and the gradient. The same configurations are normally used for both, which is fine for the estimate but means the gradient noise is correlated with the energy noise; the fluctuation of Eθ below E0 in a single short evaluation is not a violation of the variational principle, only of statistics.
Report Eˉ, its standard error from the plateau, τint or the block size used, Ns, the number of chains, and the variance Varθ(H). State whether the quoted uncertainty is one standard error of the mean; Ketboard displays the uncertainty with its declared meaning and never invents one.
Where the gradient comes from
The same samples give the energy gradient without any extra Hamiltonian evaluations. With the log-derivatives Ok(σ)=∂θklogΨθ(σ),
which is also a zero-variance estimator at an eigenstate because the centred local energy Eloc−Eθ vanishes there. How this gradient is turned into a parameter update is the subject of the optimization page.
References
W. L. McMillan, Ground state of liquid He⁴, Phys. Rev. 138, A442 (1965). The first variational Monte Carlo calculation.
F. Becca, S. Sorella, Quantum Monte Carlo Approaches for Correlated Systems, Cambridge University Press (2017). Textbook treatment of estimators, sampling and stochastic reconfiguration.
A. W. Sandvik, Computational studies of quantum spin systems, arXiv:1101.3281 (2010). Lecture notes; Monte Carlo error analysis in Section 3.
U. Wolff, Monte Carlo errors with less errors, arXiv:hep-lat/0306017 (2003). The Γ-method for autocorrelation analysis, with an error estimate for τint.
V. Ambegaokar, M. Troyer, Estimating errors reliably in Monte Carlo simulations of the Ehrenfest model, arXiv:0906.0943 (2009). The binning analysis from first principles.
D. Wu et al., Variational benchmarks for quantum many-body problems, arXiv:2302.04919 (2023). The V-score and the varbench dataset.
O. Sharir, Y. Levine, N. Wies, G. Carleo, A. Shashua, Deep autoregressive models for the efficient variational simulation of many-body quantum systems, arXiv:1902.04057 (2019). Exact sampling from autoregressive NQS.
M. Hibat-Allah, M. Ganahl, L. E. Hayward, R. G. Melko, J. Carrasquilla, Recurrent neural network wave functions, arXiv:2002.02973 (2020).
Edit this page
Corrections, sharper derivations and missing references are welcome. Edit the Markdown on GitHub and open a pull request; LaTeX is rendered at build time.