Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

The Variational Method

Where exact solutions stop

Four model systems have carried the course so far, and each was solved exactly:

systempotentialsolved in
particle in a boxwallsLecture 3.2
harmonic oscillator12kx2\frac{1}{2}kx^2Lecture 4.2
rigid rotornone, fixed distanceLecture 4.5
hydrogenlike atom−Ze2/4πε0r-Ze^2/4\pi\varepsilon_0 rLecture 5.1

The list ends there. Add one electron to hydrogen and the Hamiltonian of helium, written in the atomic units of Lecture 5.1 (ℏ=me=e=4πε0=1\hbar = m_e = e = 4\pi\varepsilon_0 = 1), is

H^=−12∇12−2r1⏟electron 1    − 12∇22−2r2⏟electron 2  +  1r12⏟repulsion\hat{H} = \underbrace{-\tfrac{1}{2}\nabla_1^2 - \frac{2}{r_1}}_{\text{electron 1}}\;\;\underbrace{-\,\tfrac{1}{2}\nabla_2^2 - \frac{2}{r_2}}_{\text{electron 2}}\;+\;\underbrace{\frac{1}{r_{12}}}_{\text{repulsion}}

The first two pieces are hydrogenlike atoms with Z=2Z = 2, which Lecture 5.1 solved. The last piece, the repulsion between the electrons a distance r12r_{12} apart, ties the coordinates of one electron to those of the other. The equation no longer separates, and no one has found a formula for its solutions. The same term appears between every pair of electrons in every atom and molecule.

Source
<Figure size 1010x410 with 1 Axes>

Fig. The plan of the chapter. Beyond the exactly solved models there are two ways forward: guess the wavefunction and improve the guess (the variational method), or start from a solved problem and correct it step by step (perturbation theory). Both lead to the atoms and molecules of Chapters 7 and 8.

An idea already used twice

Two earlier lectures found a ground-state energy by trying a family of states and keeping the one of lowest energy.

Both answers were exact, because in each case the family happened to contain the true ground state. This lecture asks what the minimum means when it does not. The answer is the variational theorem: the minimum is then too high, and never too low.

The variational theorem

Any state is a mixture of the exact states

Let ϕ\phi be any normalized function that obeys the boundary conditions of the problem: a guess, called a trial function. Its average energy is ⟨E⟩=⟨ϕ∣H^∣ϕ⟩\langle E\rangle = \langle\phi|\hat{H}|\phi\rangle. Three steps bound it from below.

  1. Expand the guess in the exact states. The eigenfunctions of H^\hat{H} form a complete set (Lecture 3.6), whether or not anyone can write them down:

ϕ=∑ncn ψn,H^ψn=Enψn,E0≤E1≤E2≤…\phi = \sum_n c_n\,\psi_n, \qquad \hat{H}\psi_n = E_n\psi_n, \qquad E_0 \leq E_1 \leq E_2 \leq \dots

Since ϕ\phi is normalized, ∑n∣cn∣2=1\sum_n|c_n|^2 = 1.

  1. The average energy is a weighted average of the levels. A measurement of the energy returns EnE_n with probability ∣cn∣2|c_n|^2 (the Born rule of Lecture 3.6), so

⟨E⟩=⟨ϕ∣H^∣ϕ⟩=∑n∣cn∣2 En\langle E\rangle = \langle\phi|\hat{H}|\phi\rangle = \sum_n|c_n|^2\,E_n
  1. An average cannot lie below its smallest entry. Every EnE_n is at least E0E_0, so

⟨E⟩=∑n∣cn∣2 En  ≥  E0∑n∣cn∣2=E0\langle E\rangle = \sum_n|c_n|^2\,E_n \;\geq\; E_0\sum_n|c_n|^2 = E_0

Here E0E_0 stands for the lowest level, whatever its quantum number is called: n=1n = 1 for the box and for hydrogen, v=0v = 0 for the spring.

Source
<Figure size 960x420 with 2 Axes>

Fig. Left: a trial state ϕ\phi in a box (teal), pushed toward the right wall, beside the true ground state ψ1\psi_1 (dashed). Right: the weights ∣cn∣2|c_n|^2 of ϕ\phi on the exact levels. An energy measurement returns E1E_1 in 68% of trials, E2E_2 in 29%, higher levels in the rest. The average, 2.19 E12.19\,E_1, lies above E1E_1 because every single reading does.

Eϕ=E0+ϵ2 ⟨χ∣H^∣χ⟩1+ϵ2≈E0+ϵ2(⟨χ∣H^∣χ⟩−E0)E_\phi = \frac{E_0 + \epsilon^2\,\langle\chi|\hat{H}|\chi\rangle}{1 + \epsilon^2} \approx E_0 + \epsilon^2\left(\langle\chi|\hat{H}|\chi\rangle - E_0\right)

An error of size ϵ\epsilon in the function costs only ϵ2\epsilon^2 in the energy. A guess that is 10% wrong can give an energy good to about 1%. The reverse also holds: a good energy does not certify the wavefunction, and other properties computed from it are less accurate.

The recipe: guess, compute, minimize

  1. Guess. Choose a trial function ϕ\phi with the right boundary conditions and a sensible shape: no more nodes than a ground state should have, large where the potential is low. Put adjustable parameters in it.

  2. Compute. Evaluate Eϕ=⟨ϕ∣H^∣ϕ⟩/⟨ϕ∣ϕ⟩E_\phi = \langle\phi|\hat{H}|\phi\rangle/\langle\phi|\phi\rangle as a function of the parameters.

  3. Minimize. Set the derivative with respect to each parameter to zero. The minimum is the best energy that family of functions can give, and it is still an upper bound.

One formula saves work in step 2. Integrating by parts, with ϕ\phi vanishing at the ends of the range,

⟨ϕ∣T^∣ϕ⟩=−ℏ22m∫ϕ ϕ′′ dx=ℏ22m∫(ϕ′)2dx\langle\phi|\hat{T}|\phi\rangle = -\frac{\hbar^2}{2m}\int\phi\,\phi''\,dx = \frac{\hbar^2}{2m}\int\left(\phi'\right)^2dx

so the kinetic energy needs only the first derivative: it is large wherever the function is steep.

No parameter: a parabola in a box

Source
<Figure size 960x350 with 3 Axes>

Fig. Three guesses (teal) for the ground state of a box, drawn over the exact one (gray), with the area between them in red. (a) A tent, with a kink in the middle. (b) The parabola of the example. (c) The parabola plus a second term, built below. Each energy lies above E1E_1, and the closer the shape, the lower the energy.

One parameter: hydrogen with a Gaussian

The ground state of hydrogen is e−r/a0e^{-r/a_0}, with E1=−12EhE_1 = -\frac{1}{2}E_h. Suppose the guess is a Gaussian instead, ϕ=e−αr2\phi = e^{-\alpha r^2}, with the exponent α\alpha free. In atomic units H^=−12∇2−1/r\hat{H} = -\frac{1}{2}\nabla^2 - 1/r, and the recipe runs as follows.

  1. Normalize. ⟨ϕ∣ϕ⟩=∫0∞e−2αr2 4πr2 dr=(π/2α)3/2\langle\phi|\phi\rangle = \int_0^\infty e^{-2\alpha r^2}\,4\pi r^2\,dr = (\pi/2\alpha)^{3/2}.

  2. Compute the two parts of the energy. The integrals are in the dropdown below; divided by the normalization they give

⟨T⟩=3α2,⟨V⟩=−22απ,E(α)=3α2−22απ\langle T\rangle = \frac{3\alpha}{2}, \qquad \langle V\rangle = -2\sqrt{\frac{2\alpha}{\pi}}, \qquad E(\alpha) = \frac{3\alpha}{2} - 2\sqrt{\frac{2\alpha}{\pi}}
  1. Minimize. A large α\alpha is a tight Gaussian: the kinetic energy grows in proportion to α\alpha, the attraction only as α\sqrt{\alpha}. Setting dE/dα=0dE/d\alpha = 0:

32−2πα=0⟹α=89π=0.283 a0−2\frac{3}{2} - \sqrt{\frac{2}{\pi\alpha}} = 0 \quad\Longrightarrow\quad \alpha = \frac{8}{9\pi} = 0.283\ a_0^{-2}
E=−43π Eh=−0.424 Eh=−11.5 eVE = -\frac{4}{3\pi}\,E_h = -0.424\,E_h = -11.5\ \text{eV}
Source
<Figure size 960x420 with 2 Axes>

Fig. Hydrogen with the trial function e−αr2e^{-\alpha r^2}. Left: the average kinetic, potential and total energy for every exponent α\alpha. The total has its minimum, −0.424 Eh-0.424\,E_h, at α=0.283 a0−2\alpha = 0.283\,a_0^{-2} and stays above the exact −12Eh-\frac{1}{2}E_h (dashed) everywhere. Right: the best Gaussian against the exact e−r/a0e^{-r/a_0}, both normalized.

The recipe does not need a formula for the exact answer. Pick a well and tune the width of a Gaussian trial function; the dashed level is the exact ground state, solved numerically for comparison.

Helium: a charge that is not 2

Helium is where the exact solutions stopped. Drop the repulsion 1/r121/r_{12} from its Hamiltonian, and what is left is a sum of two He+^+ Hamiltonians, one for each electron. A Hamiltonian that is a sum separates: the energies add and the wavefunctions multiply. Both electrons then sit in the 1s orbital of He+^+, e−2re^{-2r} in atomic units, and the state of the atom is the product

ϕ(r1,r2)=ψ1s(r1) ψ1s(r2)∝e−2r1 e−2r2\phi(r_1, r_2) = \psi_{1s}(r_1)\,\psi_{1s}(r_2) \propto e^{-2r_1}\,e^{-2r_2}

This independent-electron product is not an eigenfunction of the true Hamiltonian, which still contains the repulsion. It is a guess, and the variational method can improve it.

Source
<Figure size 800x420 with 1 Axes>

Fig. The average energy of helium for the trial function e−ζ(r1+r2)e^{-\zeta(r_1 + r_2)}. The bare nuclear charge, ζ=2\zeta = 2, gives -74.8 eV. The minimum is at ζ=27/16\zeta = 27/16, with -77.5 eV. The exact energy, -79.0 eV, lies below both.

trial functionenergy (EhE_h)energy (eV)above the exact value
e−ζ(r1+r2)e^{-\zeta(r_1 + r_2)} with ζ=2\zeta = 2-2.750-74.84.2 eV
the same with ζ=27/16\zeta = 27/16-2.848-77.51.5 eV
Hylleraas, three parameters (1929)-2.9024-78.980.04 eV
exact-2.9037-79.01

Linear combinations: the method chemists use

Mix fixed functions

Nonlinear parameters such as α\alpha and ζ\zeta sit inside exponentials, and each new one makes the minimization harder. A second kind of trial function avoids that. Choose a set of fixed functions f1,f2,…,fNf_1, f_2, \dots, f_N, the basis functions, and let only the mixing coefficients vary:

ϕ=c1f1+c2f2+⋯+cNfN\phi = c_1f_1 + c_2f_2 + \dots + c_Nf_N

Minimizing the energy with respect to the coefficients needs no searching. It leads to a matrix eigenvalue problem, the kind Lecture 3.5 solved with eigh.

Two functions, step by step

Take N=2N = 2 and real functions and coefficients.

  1. Write the energy. Insert ϕ=c1f1+c2f2\phi = c_1f_1 + c_2f_2 into E=⟨ϕ∣H^∣ϕ⟩/⟨ϕ∣ϕ⟩E = \langle\phi|\hat{H}|\phi\rangle/\langle\phi|\phi\rangle and multiply out:

E=c12H11+2c1c2H12+c22H22c12S11+2c1c2S12+c22S22E = \frac{c_1^2H_{11} + 2c_1c_2H_{12} + c_2^2H_{22}}{c_1^2S_{11} + 2c_1c_2S_{12} + c_2^2S_{22}}
Hij=⟨fi∣H^∣fj⟩,Sij=⟨fi∣fj⟩H_{ij} = \langle f_i|\hat{H}|f_j\rangle, \qquad S_{ij} = \langle f_i|f_j\rangle

The HijH_{ij} are the matrix elements of the Hamiltonian, the sandwiches of Lecture 3.5. The SijS_{ij} are overlaps: the basis functions need not be orthogonal or normalized. H^\hat{H} is Hermitian, so H12=H21H_{12} = H_{21}.

  1. Minimize. Clear the fraction, E×(denominator)=numeratorE\times(\text{denominator}) = \text{numerator}, and differentiate both sides with respect to c1c_1. At the minimum ∂E/∂c1=0\partial E/\partial c_1 = 0, which leaves

E(2c1S11+2c2S12)=2c1H11+2c2H12E\left(2c_1S_{11} + 2c_2S_{12}\right) = 2c_1H_{11} + 2c_2H_{12}

Collect the terms, and do the same for c2c_2:

c1(H11−ES11)+c2(H12−ES12)=0c1(H12−ES12)+c2(H22−ES22)=0\begin{aligned} c_1\left(H_{11} - ES_{11}\right) + c_2\left(H_{12} - ES_{12}\right) &= 0\\ c_1\left(H_{12} - ES_{12}\right) + c_2\left(H_{22} - ES_{22}\right) &= 0 \end{aligned}
  1. Solve. These are two linear equations for c1c_1 and c2c_2. They always have the useless solution c1=c2=0c_1 = c_2 = 0. Another solution exists only if the determinant of the coefficients vanishes, and that condition fixes EE.

The two-level problem

The smallest case, two orthonormal basis functions, is worth solving once and keeping: it returns in every remaining lecture of this chapter. Call the energies of the two functions E1=H11E_1 = H_{11} and E2=H22E_2 = H_{22}, with E1≤E2E_1 \leq E_2, and the matrix element that connects them v=H12v = H_{12}. The secular determinant is the quadratic equation (E1−E)(E2−E)−v2=0(E_1 - E)(E_2 - E) - v^2 = 0.

Source
<Figure size 960x420 with 2 Axes>

Fig. The two-level problem. Left: the levels E1E_1 and E2E_2 before mixing, and the roots E−E_- and E+E_+ after. Right: the energy of every normalized mixture cos⁡θ f1+sin⁡θ f2\cos\theta\,f_1 + \sin\theta\,f_2. Its lowest and highest points are the two roots; f1f_1 alone and f2f_2 alone lie in between.

The box again, with two polynomials

roots        : [ 4.93487 51.06513]
exact E1, E3 : [ 4.9348  44.41322]
c2 / c1      : 1.1331

Hydrogen from several Gaussians

One Gaussian gave hydrogen 85% of its binding energy. A sum of Gaussians with different exponents does better, and the coefficients come from the same matrix equation. For s-type Gaussians e−ar2e^{-ar^2} and e−br2e^{-br^2} the matrix elements are known formulas (atomic units):

Sab=(πa+b)3/2,Hab=3aba+b Sab−2πa+bS_{ab} = \left(\frac{\pi}{a + b}\right)^{3/2}, \qquad H_{ab} = \frac{3ab}{a + b}\,S_{ab} - \frac{2\pi}{a + b}
lowest root: -0.49698 hartree   (exact: -0.5)
Source
<Figure size 960x420 with 2 Axes>

Fig. Hydrogen from one to five Gaussians, each set with its best exponents. Left: the lowest root steps down toward the exact −12Eh-\frac{1}{2}E_h and never passes it. Right: the sums of one, two and three Gaussians against the exact e−r/a0e^{-r/a_0}. Tight Gaussians build up the cusp at the nucleus.

The variational method needs a guess and returns a bound, with no estimate of how far above the truth the bound lies. When the problem is a small change to one that is already solved, no guess is needed: perturbation theory corrects the known answer directly.

Problems

Problem 1: A tent in a box

Use the tent function, ϕ=x\phi = x for 0≤x≤L/20 \leq x \leq L/2 and ϕ=L−x\phi = L - x for L/2≤x≤LL/2 \leq x \leq L, as a trial function for the ground state of a particle in a box. Find EϕE_\phi and compare it with E1E_1 and with the parabola of the first example.

Problem 2: A Lorentzian in a spring

Use ϕ=1/(x2+b2)\phi = 1/(x^2 + b^2), with bb as the parameter, as a trial function for the ground state of the harmonic oscillator, H^=−(ℏ2/2μ) d2/dx2+12kx2\hat{H} = -(\hbar^2/2\mu)\,d^2/dx^2 + \frac{1}{2}kx^2. Show that E(b)=ℏ2/4μb2+12kb2E(b) = \hbar^2/4\mu b^2 + \frac{1}{2}kb^2, minimize it, and compare the result with 12ℏω\frac{1}{2}\hbar\omega. Why does this trial function do so much worse than a Gaussian? Useful integrals over all xx:

∫dx(x2+b2)2=π2b3,∫x2 dx(x2+b2)2=π2b\int\frac{dx}{(x^2 + b^2)^2} = \frac{\pi}{2b^3}, \qquad \int\frac{x^2\,dx}{(x^2 + b^2)^2} = \frac{\pi}{2b}
∫x2 dx(x2+b2)4=π16b5\int\frac{x^2\,dx}{(x^2 + b^2)^4} = \frac{\pi}{16b^5}

Problem 3: Where the 1.3% comes from

The normalized parabola ϕ=30/L5 x(L−x)\phi = \sqrt{30/L^5}\,x(L - x) has the expansion coefficients cn=⟨ψn∣ϕ⟩=815/n3π3c_n = \langle\psi_n|\phi\rangle = 8\sqrt{15}/n^3\pi^3 for odd nn and zero for even nn in the states of the box. (a) Find the probabilities of measuring E1E_1, E3E_3 and E5E_5. (b) Compute the average energy from ∑n∣cn∣2En\sum_n|c_n|^2E_n and check it against the example. (c) How large is the error in the wavefunction, and how large is the error in the energy?

Problem 4: A V-shaped well

A particle moves in the well V(x)=F∣x∣V(x) = F|x|. Use the Gaussian ϕ=e−ax2\phi = e^{-ax^2} as a trial function. With ⟨T⟩=ℏ2a/2m\langle T\rangle = \hbar^2a/2m and ⟨∣x∣⟩=1/2πa\langle|x|\rangle = 1/\sqrt{2\pi a} for this function, write E(a)E(a), minimize it, and show that the best energy is 32(ℏ2F2/2πm)1/3=0.813 (ℏ2F2/m)1/3\frac{3}{2}\left(\hbar^2F^2/2\pi m\right)^{1/3} = 0.813\,(\hbar^2F^2/m)^{1/3}. The exact ground-state energy is 0.809 (ℏ2F2/m)1/30.809\,(\hbar^2F^2/m)^{1/3}. How close is the bound, and which way is it off? Check your value against the widget above, which uses ℏ=m=F=1\hbar = m = F = 1.

Problem 5: Two orbitals that overlap

Two identical basis functions on neighboring atoms have H11=H22=αH_{11} = H_{22} = \alpha, H12=βH_{12} = \beta and an overlap S12=SS_{12} = S, with S11=S22=1S_{11} = S_{22} = 1. Solve the secular determinant and find the two energies and their coefficients. Which level moves farther from α\alpha?

Problem 6: Two-electron ions

The helium example gives E(ζ)=ζ2−2Zζ+58ζE(\zeta) = \zeta^2 - 2Z\zeta + \frac{5}{8}\zeta hartree for any nucleus of charge ZZ with two electrons. (a) Show that the best exponent is ζ=Z−516\zeta = Z - \frac{5}{16} and the best energy −(Z−516)2-(Z - \frac{5}{16})^2. (b) Evaluate it for H−^- (Z=1Z = 1) and Li+^+ (Z=3Z = 3) and compare with the exact energies, -0.5278 and -7.2799 hartree. (c) A hydrogen atom plus a free electron at rest has the energy -0.5 hartree. Does this trial function predict that H−^- is stable? It is, in fact. What does that tell you about the difference between a bound and an estimate?

Problem 7: A bound for an excited state

The first excited state of the box, ψ2\psi_2, is antisymmetric about the middle. Use the antisymmetric trial function ϕ=x(L−x)(L/2−x)\phi = x(L - x)(L/2 - x) to bound E2E_2. Why is the result an upper bound to E2E_2 and not merely to E1E_1?

Problem 8: One more Gaussian

(a) Explain in two sentences why adding a basis function to a linear variational calculation can never raise the lowest root. (b) Test it. In the three-Gaussian cell above, add a fourth exponent of your choice and rerun; then try several values between 0.05 and 50. Does the energy ever rise above -0.49698? (c) Which values of the fourth exponent help most, very small ones, very large ones, or ones between those already present? Relate your answer to the two things a Gaussian gets wrong about the hydrogen atom.