Skip to content
LESSON NOTES · 02

2. VMC and the local-energy estimator

Position in the course: Lesson 2 of 10. Complete the preceding derivation and use the explained exercises to check understanding.

Prerequisites: Variational bound; Metropolis–Hastings

Learning goal: explain the mathematical steps, reproduce the analytical examples, and state the conditions under which the conclusions hold.

1. Rewrite the expectation as a probability average

For an admissible trial state, \(E_V=\int\Psi_T^*H\Psi_TdR/\int|\Psi_T|^2dR\). At nonzero amplitude define \(E_L=(H\Psi_T)/\Psi_T\) and \(p_T=|\Psi_T|^2/\int|\Psi_T|^2\). Multiplication gives \(E_V=\int p_TE_LdR\). The normalization of the trial function cancels. For a real state and local Hamiltonian, the sampled local energy is real. Complex states require consistent complex derivatives and a real-energy estimator; do not silently apply real formulas.

For symmetric proposals the VMC acceptance is \(\min[1,|\Psi_T(R')/\Psi_T(R)|^2]\). Drift proposals are asymmetric and need their proposal ratio. Record rejected configurations just as in classical Monte Carlo. The distribution has nodes where \(\Psi_T=0\); pointwise local energy is undefined there, although measure-zero nodes need not prevent a well-defined expectation.

2. Differentiate logarithms carefully

Inside a region where a real trial function has fixed sign, let \(L=\ln|\Psi_T|\). The product rule gives \(\nabla_i\Psi_T=\Psi_T\nabla_iL\) and \(\nabla_i^2\Psi_T=\Psi_T[\nabla_i^2L+|\nabla_iL|^2]\), so

\[ E_L=-\frac12\sum_i\left[\nabla_i^2L+|\nabla_iL|^2\right]+V(R). \]

This identity reduces numerical underflow and clarifies which derivatives a wavefunction implementation needs. Finite differences can verify gradients on a small smooth model, but production Coulomb cusps and nodes need careful analytic treatment.

3. Worked oscillator benchmark

For \(H=-\tfrac12d^2/dx^2+x^2/2\) and \(\Psi_a=e^{-ax^2/2}\), \(a>0\), differentiation gives \(\Psi_a''=(a^2x^2-a)\Psi_a\). Thus

\[ E_L=\frac a2+\frac{1-a^2}{2}x^2,\quad \langle x^2\rangle=\frac1{2a},\quad E_V(a)=\frac14(a+a^{-1}). \]

The Gaussian fourth moment is \(3/(4a^2)\), giving \(\operatorname{Var}(x^2)=1/(2a^2)\) and \(\operatorname{Var}(E_L)=(1-a^2)^2/(8a^2)\). At \(a=2\), \(E_V=5/8\); at \(a=1\), \(E_L=1/2\) everywhere. These exact identities are verification targets, not executed VMC measurements.

4. Zero variance and what it does not prove

An exact full-Hamiltonian eigenstate has constant local energy almost everywhere, hence zero variance. An excited eigenstate also has zero variance. A state patched across artificial boundaries need not belong to the operator domain, so constant local energy away from a boundary alone is insufficient. Low variance is useful for efficiency and diagnostics but does not certify correct nodes, physical spin, or the ground state.

The oscillator exposes a physical tradeoff: larger \(a\) narrows the distribution, reducing potential energy to \(1/(4a)\) but increasing kinetic energy to \(a/4\). Their sum has a finite optimum. Sampling that same Gaussian more accurately cannot change the tradeoff. Distinguish analytic expectation, chosen trial family, and finite sample estimate. A stable mean does not establish a flexible ansatz or correct spin, boundary conditions, and nodes.

5. Exercises and solutions

Exercise: Differentiate \(E_V(a)\) and find the minimum.

Solution

\(dE_V/da=(1-a^{-2})/4=0\) gives \(a=1\) since \(a>0\). The second derivative is \(1/(2a^3)>0\). The state balances kinetic localization against potential spreading.

Exercise: Can a finite sampled energy be below the known exact ground energy?

Solution

Yes, sampling fluctuations can cross the bound. The variational theorem applies to the exact expectation. Persistent statistically significant violations warrant checking the estimator, Hamiltonian, derivatives, and domain assumptions.

VMC and the local-energy estimator

Original teaching schematic of the mathematics or algorithm; it is not simulation or experimental data.

6. Sources and connections

Related theory: Classical Monte Carlo · Molecular methods · Density functional theory

Software connection: CP2K · Quantum ESPRESSO · Gaussian

These software courses provide related background on energies, orbitals, or convergence management; they do not imply that the Monte Carlo or QMC examples on this page were executed there.

Quantum mechanics · Molecular methods · Monte Carlo · Molecular dynamics · QMCPACK


Previous lesson · Course overview · Next lesson