Skip to content

Variational Estimate for the Harmonic Oscillator

The harmonic oscillator is an unusually transparent test of the variational method. Its exact ground state and energy are already known, so every step of a trial-state calculation can be checked: admissibility, normalization, expectation values, optimization, the upper bound, and the quality of the optimized state.

The calculation also succeeds in the strongest possible way. A one-parameter Gaussian family contains the exact ground state, and minimizing its width recovers both the oscillator length and the zero-point energy. That success is a property of this well-matched ansatz, not a general promise that a one-parameter variational calculation will be exact.

Required background. The Variational Principle gives the upper bound and Trial Wavefunctions explains admissibility. Quantum Harmonic Oscillator supplies the exact spectrum for comparison.

Consider a particle of mass mm in one dimension with

H=P22m+12mω2X2.H = \frac{P^2}{2m} + \frac12m\omega^2X^2.

The parameters satisfy m>0m\gt0 and ω>0\omega\gt0.

In the position representation,

P=−iℏddx,P = -i\hbar\frac{d}{dx},

so the energy quadratic form is

qH[ψ]=ℏ22m∫−∞∞∣ψ′(x)∣2 dx+12mω2∫−∞∞x2∣ψ(x)∣2 dx.q_H[\psi] ={} \frac{\hbar^2}{2m} \int_{-\infty}^{\infty} \lvert\psi'(x)\rvert^2\,dx + \frac12m\omega^2 \int_{-\infty}^{\infty} x^2\lvert\psi(x)\rvert^2\,dx.

The competing terms identify a natural length,

ℓ=ℏmω.\ell = \sqrt{ \frac{\hbar}{m\omega} }.

We will recover this scale by optimization rather than insert it into the trial state from the start.

Choose the normalized, real, even family

ψb(x)=1(πb2)1/4exp⁡(−x22b2).\psi_b(x) = \frac{1}{(\pi b^2)^{1/4}} \exp\left( -\frac{x^2}{2b^2} \right).

The width parameter is restricted to b>0b\gt0.

The parameter bb controls the wavefunction width. It is not the position standard deviation. Since

∣ψb(x)∣2=1πbexp⁡(−x2b2),\lvert\psi_b(x)\rvert^2 = \frac{1}{\sqrt{\pi}b} \exp\left( -\frac{x^2}{b^2} \right),

the variance will be b2/2b^2/2.

This family is admissible for every b>0b\gt0: each state is square-integrable, smooth, even, and has finite kinetic and potential energy. The positivity restriction prevents a redundant sign convention and is naturally enforced by a logarithmic parameter such as b=brefeηb=b_{\mathrm{ref}}e^\eta.

The same family is often written using an inverse-square width,

α=1b2,\alpha = \frac{1}{b^2},

as

ψα(x)=(απ)1/4e−αx2/2.\psi_\alpha(x) = \left( \frac{\alpha}{\pi} \right)^{1/4} e^{-\alpha x^2/2}.

Both parameterizations describe exactly the same set of rays. Mixing their meanings is a common source of reciprocal-width errors.

The required Gaussian integrals are

∫−∞∞e−x2/b2 dx=πb,\int_{-\infty}^{\infty} e^{-x^2/b^2}\,dx = \sqrt{\pi}b, ∫−∞∞x2e−x2/b2 dx=π2b3,\int_{-\infty}^{\infty} x^2e^{-x^2/b^2}\,dx = \frac{\sqrt{\pi}}{2}b^3,

and

∫−∞∞x4e−x2/b2 dx=3π4b5.\int_{-\infty}^{\infty} x^4e^{-x^2/b^2}\,dx = \frac{3\sqrt{\pi}}{4}b^5.

The first confirms

∫−∞∞∣ψb(x)∣2 dx=1.\int_{-\infty}^{\infty} \lvert\psi_b(x)\rvert^2\,dx = 1.

Parity gives

⟨X⟩b=0,\langle X\rangle_b = 0,

and the second moment is

⟨X2⟩b=b22.\langle X^2\rangle_b = \frac{b^2}{2}.

Thus

(ΔX)b=b2.(\Delta X)_b = \frac{b}{\sqrt2}.

The fourth moment,

⟨X4⟩b=3b44,\langle X^4\rangle_b = \frac{3b^4}{4},

will later provide an energy-variance check.

Differentiate the trial state:

ψb′(x)=−xb2ψb(x),\psi_b'(x) = -\frac{x}{b^2}\psi_b(x), ψb′′(x)=(x2b4−1b2)ψb(x).\psi_b''(x) = \left( \frac{x^2}{b^4} - \frac{1}{b^2} \right) \psi_b(x).

Direct substitution gives

⟨T⟩b=−ℏ22m∫−∞∞ψb(x)ψb′′(x) dx=−ℏ22m(⟨X2⟩bb4−1b2)=ℏ24mb2.\begin{aligned} \langle T\rangle_b &= -\frac{\hbar^2}{2m} \int_{-\infty}^{\infty} \psi_b(x)\psi_b''(x)\,dx \\ &= -\frac{\hbar^2}{2m} \left( \frac{\langle X^2\rangle_b}{b^4} - \frac{1}{b^2} \right) \\ &= \frac{\hbar^2}{4mb^2}. \end{aligned}

Integration by parts supplies a useful check. The Gaussian and its derivative vanish at infinity, so

⟨T⟩b=ℏ22m∫−∞∞∣ψb′(x)∣2 dx=ℏ24mb2.\langle T\rangle_b = \frac{\hbar^2}{2m} \int_{-\infty}^{\infty} \lvert\psi_b'(x)\rvert^2\,dx = \frac{\hbar^2}{4mb^2}.

This form makes positivity explicit. Narrowing the state increases its momentum gradients and makes the kinetic energy diverge as b−2b^{-2}.

The corresponding momentum moments are

⟨P⟩b=0,⟨P2⟩b=ℏ22b2,\langle P\rangle_b = 0, \qquad \langle P^2\rangle_b = \frac{\hbar^2}{2b^2},

and therefore

(ΔP)b=ℏ2b.(\Delta P)_b = \frac{\hbar}{\sqrt2b}.

Every member of the family saturates

(ΔX)b(ΔP)b=ℏ2.(\Delta X)_b(\Delta P)_b = \frac{\hbar}{2}.

Minimum uncertainty alone does not select the ground-state width; the Hamiltonian determines which minimum-uncertainty Gaussian has the lowest energy.

The quadratic potential requires only ⟨X2⟩b\langle X^2\rangle_b:

⟨V⟩b=12mω2⟨X2⟩b=mω2b24.\begin{aligned} \langle V\rangle_b &= \frac12m\omega^2 \langle X^2\rangle_b \\ &= \frac{m\omega^2b^2}{4}. \end{aligned}

The potential term has the opposite width dependence from the kinetic term. A broad state reduces gradients but samples larger values of x2x^2.

Adding the two contributions gives

E(b)=⟨ψb∣H∣ψb⟩=ℏ24mb2+mω2b24.E(b) = \langle\psi_b\rvert H\lvert\psi_b\rangle = \frac{\hbar^2}{4mb^2} + \frac{m\omega^2b^2}{4}.

The upper-bound theorem guarantees

E(b)≥E0E(b) \geq E_0

for every b>0b\gt0, where E0E_0 is the true ground-state energy. It does not yet tell us which width gives the best bound.

Introduce the dimensionless width ratio

s=bℓ.s = \frac{b}{\ell}.

Using ℓ2=ℏ/(mω)\ell^2=\hbar/(m\omega), the energy becomes

ε(s)≡E(b)ℏω=14s2+s24.\varepsilon(s) \equiv \frac{E(b)}{\hbar\omega} = \frac{1}{4s^2} + \frac{s^2}{4}.

All dimensions have disappeared. The two terms are the kinetic and potential contributions in units of ℏω\hbar\omega.

Kinetic, potential, and total Gaussian variational energies plotted against the width ratio, with a minimum at the exact oscillator width.

The kinetic contribution falls as s−2s^{-2} while the potential contribution rises as s2s^2. Their sum has its unique minimum at s=b/ℓ=1s=b/\ell=1, where the two contributions are equal and the Gaussian coincides with the exact ground state.

The limiting behavior is physically sensible:

Width regime Kinetic energy Potential energy Total energy
s→0s\to0 diverges tends to zero diverges
s=1s=1 ℏω/4\hbar\omega/4 ℏω/4\hbar\omega/4 ℏω/2\hbar\omega/2
s→∞s\to\infty tends to zero diverges diverges

Differentiating with respect to the dimensional width gives

dEdb=−ℏ22mb3+12mω2b.\frac{dE}{db} = -\frac{\hbar^2}{2mb^3} + \frac12m\omega^2b.

The stationary equation is

mω2b=ℏ2mb3,m\omega^2b = \frac{\hbar^2}{mb^3},

or

b4=ℏ2m2ω2=ℓ4.b^4 = \frac{\hbar^2}{m^2\omega^2} = \ell^4.

Because b>0b\gt0, the only stationary width is

b⋆=ℓ.b_\star = \ell.

The second derivative is

d2Edb2=3ℏ22mb4+12mω2,\frac{d^2E}{db^2} = \frac{3\hbar^2}{2mb^4} + \frac12m\omega^2,

which is positive for every b>0b\gt0. In particular,

d2Edb2∣b=ℓ=2mω2>0.\left. \frac{d^2E}{db^2} \right|_{b=\ell} = 2m\omega^2 \gt0.

The stationary point is therefore the unique global minimum. Substitution gives

Evar=E(ℓ)=12ℏω.E_{\mathrm{var}} = E(\ell) = \frac12\hbar\omega.

The dimensionless expression can also be rearranged as

ε(s)=12+14(s−1s)2≥12.\begin{aligned} \varepsilon(s) &= \frac12 + \frac14 \left( s- \frac1s \right)^2 \\ &\geq \frac12. \end{aligned}

Equality holds only at s=1s=1. This is the arithmetic–geometric-mean inequality in a form that displays the nonnegative energy excess.

For numerical work, write

s=eη,η∈R.s = e^\eta, \qquad \eta\in\mathbb R.

Then positivity is automatic and

ε(η)=12cosh⁡(2η).\varepsilon(\eta) = \frac12\cosh(2\eta).

The optimum is η⋆=0\eta_\star=0. Near it,

ε(η)=12+η2+O(η4).\varepsilon(\eta) = \frac12 + \eta^2 + O(\eta^4).

The absence of a linear term is the local stationarity expected at a variational optimum. General parameter gradients, Hessians, and reparameterizations are developed in Variational Parameters.

At the optimum,

ψb⋆(x)=1(πℓ2)1/4exp⁡(−x22ℓ2),\psi_{b_\star}(x) = \frac{1}{(\pi\ell^2)^{1/4}} \exp\left( -\frac{x^2}{2\ell^2} \right),

which is the exact normalized oscillator ground state. The variational family happened to contain the target eigenvector.

This can be checked without importing the known spectrum. Acting with the Hamiltonian on a general family member gives the local-energy expression

Hψb(x)ψb(x)=ℏ22mb2+12(mω2−ℏ2mb4)x2.\frac{H\psi_b(x)}{\psi_b(x)} = \frac{\hbar^2}{2mb^2} + \frac12 \left( m\omega^2 - \frac{\hbar^2}{mb^4} \right) x^2.

At b=ℓb=\ell, the coefficient of x2x^2 vanishes and

Hψℓ=12ℏω ψℓ.H\psi_\ell = \frac12\hbar\omega\,\psi_\ell.

Thus the optimized state satisfies the full eigenvalue equation. To establish that it is the ground state without assuming the known spectrum, use H=ℏω(a†a+1/2)≥ℏω/2H=\hbar\omega(a^\dagger a+1/2)\ge\hbar\omega/2; the normalized Gaussian attains this lower bound. Zero residual by itself would identify an eigenstate, not its index.

For b≠ℓb\ne\ell, the local energy depends on xx, so the state is not an eigenstate. Its energy variance is

(ΔH)b2=⟨H2⟩b−E(b)2=(ℏω)28(s2−s−2)2.\begin{aligned} (\Delta H)_b^2 &= \langle H^2\rangle_b - E(b)^2 \\ &= \frac{(\hbar\omega)^2}{8} \left( s^2-s^{-2} \right)^2. \end{aligned}

It vanishes only at s=1s=1. For a normalized state in the operator domain, this variance is also the squared residual norm,

(ΔH)b2=∥(H−E(b))ψb∥2.(\Delta H)_b^2 = \left\lVert (H-E(b))\psi_b \right\rVert^2.

Energy minimization and residual vanishing therefore agree at the optimum in this example. In a restricted family that does not contain an eigenstate, the minimum energy generally has a nonzero residual outside the trial tangent space.

The Variational Monte Carlo Preview recasts this same local energy as a sampled estimator and explains how its variance controls both residual diagnostics and statistical uncertainty.

The exact ground-state energy is

E0=12ℏω,E_0 = \frac12\hbar\omega,

so the variational excess at arbitrary width is

E(b)−E0=ℏω4(s−1s)2.E(b)-E_0 = \frac{\hbar\omega}{4} \left( s- \frac1s \right)^2.

In the logarithmic coordinate,

E(b)−E0ℏω=sinh⁡2η.\frac{E(b)-E_0}{\hbar\omega} = \sinh^2\eta.

The squared overlap with the exact ground state is

F(s)=∣⟨ψℓ∣ψb⟩∣2=2s1+s2=1cosh⁡η.\begin{aligned} F(s) &= \left\lvert \langle\psi_\ell\vert\psi_b\rangle \right\rvert^2 \\ &= \frac{2s}{1+s^2} \\ &= \frac{1}{\cosh\eta}. \end{aligned}

Near the optimum,

1−F=η22+O(η4),1-F = \frac{\eta^2}{2} + O(\eta^4),

while

E−E0ℏω=η2+O(η4).\frac{E-E_0}{\hbar\omega} = \eta^2 + O(\eta^4).

Both are second order here, but they quantify different objects. In more complicated variational families, a small energy error need not imply that every observable or wavefunction feature is comparably accurate.

At the stationary width,

⟨T⟩⋆=⟨V⟩⋆=14ℏω.\langle T\rangle_\star = \langle V\rangle_\star = \frac14\hbar\omega.

This is the harmonic-oscillator virial relation. In the present one-parameter family, changing bb is a scale transformation: the kinetic term scales as b−2b^{-2} and the quadratic potential as b2b^2. Stationarity under that scaling forces the two terms to balance.

Every trial Gaussian also saturates the position–momentum uncertainty relation. The optimizer chooses the member whose position and momentum spreads balance the coefficients in the Hamiltonian. The broader physical interpretation of this balance is developed in Zero-Point Energy.

A wrong-width centered Gaussian is a squeezed vacuum relative to the oscillator’s natural quadratures. With s=eηs=e^\eta, its energy is

E=12ℏωcosh⁡(2η).E = \frac12\hbar\omega\cosh(2\eta).

The sign convention for the squeezing parameter may reverse η\eta, but the energy is unchanged. The state interpretation is developed in Squeezed States: First Encounter.

The centered real ansatz already respects the parity and time-reversal properties of the nondegenerate ground state. To see what those choices save, enlarge the family to

ψb,xc,pc(x)=1(πb2)1/4×exp⁡[−(x−xc)22b2]×exp⁡[ipc(x−xc)ℏ].\psi_{b,x_c,p_c}(x) ={} \frac{1}{(\pi b^2)^{1/4}} \times \exp\left[ -\frac{(x-x_c)^2}{2b^2} \right] \times \exp\left[ \frac{i p_c(x-x_c)}{\hbar} \right].

Its moments are

⟨X⟩=xc,⟨P⟩=pc,\langle X\rangle = x_c, \qquad \langle P\rangle = p_c, ⟨X2⟩=xc2+b22,\langle X^2\rangle = x_c^2 + \frac{b^2}{2},

and

⟨P2⟩=pc2+ℏ22b2.\langle P^2\rangle = p_c^2 + \frac{\hbar^2}{2b^2}.

Therefore

E(b,xc,pc)=ℏ24mb2+mω2b24+pc22m+12mω2xc2.E(b,x_c,p_c) ={} \frac{\hbar^2}{4mb^2} + \frac{m\omega^2b^2}{4} + \frac{p_c^2}{2m} + \frac12m\omega^2x_c^2.

Every added term is nonnegative. The optimizer returns

xc,⋆=0,pc,⋆=0,b⋆=ℓ.x_{c,\star} = 0, \qquad p_{c,\star} = 0, \qquad b_\star = \ell.

Building exact symmetries into the ansatz removed two parameters whose optimum was known in advance. Displacements and phase-space motion become useful for different targets, such as coherent states and displaced oscillators, but they do not improve this ground-state calculation.

Exact recovery can hide the distinction between the theorem and the ansatz. Consider instead the normalized exponential

χa(x)=1ae−∣x∣/a,a>0.\chi_a(x) = \frac{1}{\sqrt a} e^{-\lvert x\rvert/a}, \qquad a\gt0.

This state has the correct even parity and is in the Hamiltonian’s quadratic-form domain, but its cusp and exponential tail do not match the smooth Gaussian oscillator ground state.

Using the form expression for kinetic energy,

∫−∞∞∣χa′(x)∣2 dx=1a2,\int_{-\infty}^{\infty} \lvert\chi_a'(x)\rvert^2\,dx = \frac{1}{a^2},

and

⟨X2⟩χ=a22.\langle X^2\rangle_\chi = \frac{a^2}{2}.

Its variational energy is

Eχ(a)=ℏ22ma2+mω2a24.E_\chi(a) = \frac{\hbar^2}{2ma^2} + \frac{m\omega^2a^2}{4}.

For t=a/ℓt=a/\ell,

Eχ(t)ℏω=12t2+t24.\frac{E_\chi(t)}{\hbar\omega} = \frac{1}{2t^2} + \frac{t^2}{4}.

Stationarity gives

t⋆4=2,t⋆=21/4,t_\star^4 = 2, \qquad t_\star = 2^{1/4},

and hence

Eχ,⋆=ℏω2>12ℏω.E_{\chi,\star} = \frac{\hbar\omega}{\sqrt2} \gt \frac12\hbar\omega.

This is a valid but non-exact upper bound. The optimizer has found the best state in the exponential family; it cannot remove the family’s structural mismatch.

The cusp also illustrates why the form domain matters. A naive second derivative of e−∣x∣/ae^{-\lvert x\rvert/a} misses a delta distribution at the origin. The positive quadratic-form expression using the weak first derivative gives the correct variational kinetic energy without pretending that χa\chi_a lies in the strong operator domain.

Gaussian Variational Methods extends the calculation to coupled coordinates and correlated bases. Anharmonic Oscillator by Variational Methods shows what remains of the width optimization when no Gaussian is exact.

Use the local energy and the Gaussian moments to derive

(ΔH)b2=(ℏω)28(s2−s−2)2.(\Delta H)_b^2 = \frac{(\hbar\omega)^2}{8} \left( s^2-s^{-2} \right)^2.

Why does its vanishing give stronger information than dE/db=0dE/db=0?

Solution

Write the local energy as

EL(x)=A+Bx2,E_L(x) = A+Bx^2,

where

A=ℏ22mb2,B=12(mω2−ℏ2mb4).\begin{aligned} A &= \frac{\hbar^2}{2mb^2}, \\ B &= \frac12 \left( m\omega^2 - \frac{\hbar^2}{mb^4} \right). \end{aligned}

Only the Bx2Bx^2 term fluctuates. Since

Var⁡(X2)=⟨X4⟩−⟨X2⟩2=b42,\operatorname{Var}(X^2) = \langle X^4\rangle - \langle X^2\rangle^2 = \frac{b^4}{2},

we obtain

(ΔH)b2=B2b42.(\Delta H)_b^2 = B^2\frac{b^4}{2}.

Substituting b=sℓb=s\ell and ℓ2=ℏ/(mω)\ell^2=\hbar/(m\omega) yields the stated expression. It vanishes only when s=1s=1.

The condition dE/db=0dE/db=0 means that the residual is orthogonal to the single tangent direction generated by changing bb. Zero variance means the full residual vanishes, so the state is an exact eigenstate.

Extend to an isotropic oscillator in d dimensions

Section titled “Extend to an isotropic oscillator in d dimensions”

For

H=∑j=1d(Pj22m+12mω2Xj2),H = \sum_{j=1}^{d} \left( \frac{P_j^2}{2m} + \frac12m\omega^2X_j^2 \right),

use the product Gaussian

Ψb(x)=∏j=1dψb(xj).\Psi_b(\mathbf x) = \prod_{j=1}^{d} \psi_b(x_j).

Find the optimized width and energy.

Solution

Each Cartesian factor contributes independently,

E1(b)=ℏ24mb2+mω2b24.E_1(b) = \frac{\hbar^2}{4mb^2} + \frac{m\omega^2b^2}{4}.

Therefore

Ed(b)=dE1(b).E_d(b) = dE_1(b).

Multiplication by the positive constant dd does not change the minimizing width, so

b⋆=ℓ.b_\star = \ell.

The optimized energy is

Ed,⋆=d2ℏω.E_{d,\star} = \frac{d}{2}\hbar\omega.

The product family contains the exact isotropic-oscillator ground state, so the bound is saturated.

Set b=ℓb=\ell, pc=0p_c=0, and xc=ϵℓx_c=\epsilon\ell. Compare the energy error, the error in ⟨X⟩\langle X\rangle, and the ground-state fidelity for small ϵ\epsilon.

Solution

E−E0=ℏωϵ2/2E-E_0=\hbar\omega\epsilon^2/2 while ⟨X⟩=ϵℓ\langle X\rangle=\epsilon\ell is first order. Gaussian integration gives F=e−ϵ2/2=1−ϵ2/2+O(ϵ4)F=e^{-\epsilon^2/2}=1-\epsilon^2/2+O(\epsilon^4). Small energy error or large fidelity does not make every observable’s error second order.