Skip to content
Tutorials Center
My learning

Topics

Lesson 29 of 38 · The Harmonic Oscillator

Ladder Operators: Raising and Lowering Energy

Derive the harmonic oscillator spectrum algebraically with the raising and lowering operators a and a†, build their matrices, and generate the eigenstates in Python.

The harmonic oscillator can be solved by brute force, by solving a differential equation with Hermite polynomials. It can also be solved with a few lines of algebra and no differential equation at all. The second route, using ladder operators, is the one physicists actually use, because it generalizes: the same idea describes photons in a cavity, phonons in a crystal and, in quantum field theory, particles themselves.

You will see how two operators a and a† move the oscillator up and down its equally spaced ladder of energy levels, why the spectrum has a lowest rung, and how every expectation value reduces to matrix arithmetic.

Defining a and a†

Write the Hamiltonian Ĥ = p̂²/2m + ½mω²x̂² as a sum of two squares. Because x̂ and p̂ do not commute, the factorization leaves a leftover constant. Define the lowering (annihilation) operator and the raising (creation) operator:

Text
a  = ( mω x̂ + i p̂ ) / √(2 m ħ ω)
a† = ( mω x̂ - i p̂ ) / √(2 m ħ ω)

(a† is the Hermitian conjugate of a.) Using [x̂, p̂] = iħ, a direct calculation gives

Text
[a, a†] = 1
Ĥ = ħω ( a†a + ½ )

Define the number operator N̂ = a†a. Then Ĥ = ħω(N̂ + ½), so energy eigenstates are eigenstates of N̂.

The ladder argument

Suppose |ψ⟩ is an eigenstate of Ĥ with energy E. Use the commutators [Ĥ, a] = -ħω a and [Ĥ, a†] = +ħω a† (they follow from [a, a†] = 1):

Text
Ĥ (a†|ψ⟩) = (E + ħω) (a†|ψ⟩)
Ĥ (a |ψ⟩) = (E - ħω) (a |ψ⟩)

So a† produces a state with energy higher by exactly ħω, and a one lower by ħω. That is the ladder.

Does it go down forever? No. The energy cannot fall below 0, because ⟨ψ|Ĥ|ψ⟩ = ⟨p²⟩/2m + ½mω²⟨x²⟩ ≥ 0 (a sum of non-negative terms). So there must be a lowest state |0⟩ where the ladder stops:

Text
a |0⟩ = 0

Then Ĥ|0⟩ = ħω(a†a + ½)|0⟩ = ½ħω |0⟩. The energy ladder is therefore

Text
E_n = ħω (n + ½),   n = 0, 1, 2, ...

with |n⟩ obtained by climbing n steps from |0⟩. This is the same spectrum you got from the differential equation, derived using only the commutator [a, a†] = 1.

Matrix elements

Normalizing the states properly gives the useful rules

Text
a  |n⟩ = √n       |n - 1⟩
a† |n⟩ = √(n + 1) |n + 1⟩
N̂  |n⟩ = n        |n⟩

The √n factors come from requiring ⟨n|n⟩ = 1 and ⟨n|a†a|n⟩ = n. Every state follows from the vacuum:

Text
|n⟩ = (a†)ⁿ / √(n!) |0⟩

Position and momentum are recovered by inverting the definitions:

Text
x̂ = √(ħ / 2mω) (a + a†)          (= x₀ (a + a†)/√2)
p̂ = i √(mħω / 2) (a† - a)

This lets you compute any expectation value algebraically. For example in |n⟩, ⟨x̂⟩ = 0 (because a and a† change n, so ⟨n|a|n⟩ = 0), and

Text
⟨x̂²⟩ = (ħ / 2mω)(2n + 1),   ⟨p̂²⟩ = (mħω / 2)(2n + 1)

so σ_x σ_p = (ħ/2)(2n + 1) = ħ(n + ½): the ground state saturates the uncertainty bound ħ/2, and higher states exceed it.

The ground state wavefunction

The condition a|0⟩ = 0 is a first-order differential equation:

Text
( mω x + ħ d/dx ) ψ₀(x) = 0   →   ψ₀(x) = (mω / πħ)^{1/4} e^{-mω x² / (2ħ)}

The ground state is a Gaussian, with width set by x₀ = √(ħ/mω): ψ₀ ∝ e^{-x²/(2x₀²)}. Excited states follow by applying a† repeatedly; each application multiplies by a polynomial, which leads to the Hermite polynomials of the next lesson.

The a and a† operators are not themselves observables (they are not Hermitian), but they are enormously useful tools. When you meet a problem with equally spaced levels, look for ladder operators.

Building the matrices

In the basis |0⟩, |1⟩, |2⟩, ..., the matrix of a has the numbers √1, √2, √3, ... on the superdiagonal. The matrices are infinite, but truncating at a size N is accurate for low-lying states. The first editor builds them, checks [a, a†] = 1 (the truncation spoils only the very last diagonal entry), builds Ĥ, x̂, p̂ in units ħ = m = ω = 1, and confirms ⟨x²⟩ and σ_x σ_p.

Python Ladder-operator matrices

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The last loop shows something physical: ⟨x⟩ for a superposition of |0⟩ and |1⟩ oscillates like cos(ωt), exactly like a classical oscillator, even though energy eigenstates alone are stationary.

Generating the eigenfunctions with a†

In the position representation, with ξ = x/x₀, the raising operator is a† = (ξ - d/dξ)/√2. Starting from the Gaussian ψ₀ = π^{-1/4} e^{-ξ²/2}, repeatedly applying a†/√(n+1) yields each ψ_{n+1}. The second editor does this symbolically with sympy and then checks orthonormality of the first four functions by exact integration.

Python Climbing the ladder symbolically

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

You should see that ψ₁ = √2 ξ ψ₀, that ψ₂ contains 2ξ² − 1, and so on: these are Hermite polynomials times the Gaussian.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What is the commutator [a, a†]?

    From [x̂, p̂] = iħ one obtains [a, a†] = 1. This single relation produces the whole spectrum.
  2. 2. What does a† do to an energy eigenstate |n⟩?

    a† is the raising operator: a†|n⟩ = √(n+1)|n+1⟩.
  3. 3. Why does the energy ladder have a lowest rung?

    Repeated lowering would eventually give negative energy, impossible for a sum of squares. The ladder must end at a state annihilated by a.
  4. 4. Which expression gives the Hamiltonian in terms of the ladder operators?

    Ĥ = ħω(N̂ + ½) with N̂ = a†a. (Note that ħω a a† = ħω(N̂ + 1) is a different operator.)

Summary

  • a = (mωx̂ + ip̂)/√(2mħω) and a† = (mωx̂ − ip̂)/√(2mħω) satisfy [a, a†] = 1, and Ĥ = ħω(a†a + ½).
  • a† raises and a lowers the energy by ħω; the lowest state obeys a|0⟩ = 0, giving E_n = ħω(n + ½).
  • a|n⟩ = √n|n−1⟩, a†|n⟩ = √(n+1)|n+1⟩, and x̂ ∝ a + a†, p̂ ∝ i(a† − a) turn every expectation value into matrix algebra.
  • ψ₀ is a Gaussian; excited states come from repeated application of a†.

Next: Oscillator Wavefunctions and Hermite Polynomials