Skip to content
Tutorials Center
My learning

Topics

Lesson 26 of 38 · Operators, Observables and Uncertainty

Commutators and the Uncertainty Principle

Define the commutator, derive [x, p] = iħ, state the general uncertainty relation, and check ΔxΔp ≥ ħ/2 numerically for a Gaussian and for box states.

In classical mechanics the order of two measurements never matters: you can find a particle's position and then its momentum, or the other way around, and you get the same numbers. In quantum mechanics the operators for some observables do not commute, meaning the order in which you apply them changes the result. That single algebraic fact is the origin of the Heisenberg uncertainty principle, and it explains which properties can have definite values at the same time and which cannot.

This lesson defines the commutator, computes the most important one, [x, p], and states the uncertainty relation precisely. We will also correct some common misconceptions about what uncertainty means.

The commutator

For two operators  and B̂, the commutator is

Text
[Â, B̂] = ÂB̂ - B̂Â

If [Â, B̂] = 0 the operators commute. Otherwise the order matters. The commutator is itself an operator, so to compute it you apply it to an arbitrary test function f.

The position-momentum commutator

Apply x̂p̂ - p̂x̂ to f(x):

Text
x̂p̂ f   = x · (-iħ f')               = -iħ x f'
p̂x̂ f   = -iħ d/dx (x f)             = -iħ (f + x f')
[x̂, p̂] f = -iħ x f' + iħ (f + x f') = iħ f

Since this holds for every f,

Text
[x̂, p̂] = iħ

This is the fundamental relation of quantum mechanics (the canonical commutation relation). Everything that differs from classical mechanics can be traced back to it. For comparison, the classical analogue involves the Poisson bracket {x, p} = 1, and the quantum commutator is iħ times that.

Some useful commutators follow by the product rules [A, BC] = [A, B]C + B[A, C]:

Text
[x̂, p̂²] = 2iħ p̂
[x̂², p̂] = 2iħ x̂
[Ĥ, x̂]  = -(iħ / m) p̂        for Ĥ = p̂²/2m + V(x)

Operators that depend only on position, such as V(x), commute with x̂ and with each other.

Compatible observables

If two Hermitian operators commute, they have a common set of eigenfunctions, so the two observables can have sharp values at the same time. If they do not commute, a state generally cannot be an eigenstate of both. Examples:

  • x̂ and p̂ do not commute: no state has a definite position and momentum.
  • Ĥ and the parity operator Π̂ (which flips x → -x) commute for a symmetric potential, so energy eigenstates can be chosen with definite parity: the box states and oscillator states are alternately even and odd.
  • The three components of angular momentum do not commute with one another, but L² commutes with each of them (an important fact for the later chapters).

The uncertainty relation

Define the standard deviation of an observable A in a state ψ as σ_A = √(⟨A²⟩ - ⟨A⟩²). For any two Hermitian operators, the general uncertainty relation (Robertson, 1929) is

Text
σ_A σ_B ≥ (1/2) | ⟨[Â, B̂]⟩ |

The right-hand side uses the expectation value of the commutator in that very state. For position and momentum, [x̂, p̂] = iħ, whose magnitude is ħ, so

Text
σ_x σ_p ≥ ħ / 2

This is the Heisenberg uncertainty principle in its precise form (Kennard, 1927). Here ħ/2 ≈ 5.27 × 10⁻³⁵ J·s.

What uncertainty means, and what it does not

  • It is a statement about statistical spreads: if you prepare many identical systems and measure x in half of them and p in the other half, the standard deviations obey the inequality. It is a property of the state, not of a clumsy instrument.
  • It does not only say that measuring position "disturbs" momentum. Even if you had a perfect measuring device, the state itself has these spreads. (Separate results about measurement disturbance exist, but they are a different, subtler topic.)
  • A state can have a sharp position (the wavefunction is very narrow), but then its momentum distribution is very wide, and the other way round. A plane wave has a perfectly sharp momentum and completely undefined position.
  • The relation between energy and time, ΔE Δt ≳ ħ/2, has a different character: time is a parameter, not an operator, and Δt must be interpreted (for example as the time it takes for an expectation value to change appreciably). It does not follow from [x, p] = iħ in the same way.

A quick estimate of confinement energy

Confining a particle to a region of size Δx forces σ_p ≳ ħ / (2Δx), so its kinetic energy is at least about σ_p² / 2m = ħ² / (8mΔx²). For an electron in Δx = 0.1 nm (about the size of an atom) this is about 1 eV, the correct scale for atomic energies. This is why atoms do not collapse and why matter has a minimum size.

Verifying the commutator symbolically

The first editor confirms [x, p] f = iħ f and a couple of the derived commutators with sympy, acting on a generic function f(x).

Python Commutators with sympy

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.

Checking the inequality numerically

The second editor computes σ_x and σ_p on a grid, using units ħ = 1. The momentum spread comes from ⟨p²⟩ = ħ² ∫|ψ'|² dx and ⟨p⟩ = ∫ ψ* (-iħ ψ') dx, with derivatives taken by np.gradient. We test:

  • a Gaussian, ψ ∝ exp(-x²/(4σ²)), which is the one state shape that reaches the minimum σ_x σ_p = ħ/2 (a minimum-uncertainty state),
  • the first four states of the infinite well (length 1). The exact result for the box is σ_x σ_p / ħ = √(n²π²/12 - 1/2), which is about 0.568 for n = 1 and grows with n.
Python Uncertainty product for a Gaussian and box states

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.

All products satisfy ≥ 0.5, the Gaussian sits right at 0.5 and the box states stay above it. Note that the box ground state has a larger product than the Gaussian: its wavefunction has sharp walls, which adds momentum spread.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What is the value of the commutator [x̂, p̂]?

    Acting on any function f, x̂p̂f − p̂x̂f = iħf, so [x̂, p̂] = iħ.
  2. 2. If two Hermitian operators commute, then

    Commuting observables are compatible: they share eigenfunctions, so a state can have definite values of both.
  3. 3. The uncertainty relation σ_x σ_p ≥ ħ/2 is a statement about

    It describes the spreads of results for identically prepared systems. It follows from the state's wavefunction, not from imperfect instruments.
  4. 4. Which state reaches the minimum σ_x σ_p = ħ/2?

    Gaussians are minimum-uncertainty states. The box ground state gives about 0.568ħ, and a plane wave has σ_x infinite.

Summary

  • The commutator [Â, B̂] = ÂB̂ − B̂Â measures how much the order of two operators matters.
  • [x̂, p̂] = iħ is the basic commutation relation.
  • Commuting observables share eigenfunctions and can be sharp together; non-commuting ones cannot.
  • The general uncertainty relation is σ_A σ_B ≥ ½|⟨[Â, B̂]⟩|; for position and momentum σ_x σ_p ≥ ħ/2.
  • Gaussian wave packets reach the minimum; confinement raises kinetic energy by about ħ²/(8mΔx²).

Next: Two-Level Systems and Matrix Mechanics