
Quantum core · institution-dependent · Interactive lesson
The canonical commutation relation
Every position–momentum result in this unit leans on one line of algebra. Hand the commutator a test function, differentiate the product, and watch two large terms cancel and leave a bare number behind. This lesson runs that derivation twice — once in x, once in p — and then works out what the number iħ makes impossible.
UPV-08.02 · Lesson 2 of 9 in this unit. Position is not a completion score.Quantum core · institution-dependent. Your university determines the required depth of these quantum topics, including the use of operators, differential equations and computation. Institution-dependent does not automatically mean optional.
Build the model
The whole relation is the product rule, wearing a factor of iħ.
The key idea
The canonical commutation relation says position and momentum fail to commute by a fixed amount: x̂p̂ − p̂x̂ is iħ times the identity operator — the same number in every state, in every representation, and at every time.
Example. Act on ψ(x) = exp(−x²/2a²): x̂p̂ψ = iħ(x²/a²)ψ while p̂x̂ψ = iħ(x²/a² − 1)ψ. Subtracting leaves iħψ, i × 1.055 × 10⁻³⁴ J s times ψ, with no a anywhere — the width of the state never enters.
The complete physical model and assumptions
x̂ and p̂ are not numbers, so x̂p̂ − p̂x̂ cannot be evaluated by cancelling symbols. It is an operator, and an operator means nothing until it acts, so hand it a differentiable, square-integrable ψ. With p̂ = −iħ d/dx the first ordering gives −iħxψ′ and the second gives −iħ(xψ)′ = −iħψ − iħxψ′. The xψ′ pieces are identical and cancel exactly; what survives is the term the product rule made by differentiating x itself, and dx/dx = 1. So [x̂, p̂]ψ = iħψ for every ψ in the domain, which says the commutator is no differential operator at all but just the number iħ times the identity. That is a strong claim and it charges for itself. A commutator of finite matrices always has zero trace and iħ times the identity does not, so no pair of finite matrices can realise it and no pair of bounded operators can either: the space must be infinite-dimensional, and x̂ and p̂ must be unbounded, defined only on a dense domain. It also inherits the fine print of its own derivation — a Cartesian coordinate running over the whole real line — so the same move applied to an angle on a circle yields a relation that is provably false. Robertson's bound for x̂ and p̂, the ladder operators and Ehrenfest's theorem are all this one line pushed through the algebra.
1A commutator is an operator: give it something to act on
You cannot evaluate x̂p̂ − p̂x̂ by staring at it, because neither symbol is a number; the expression is an instruction, and an instruction is defined by what it does. Supply a test function ψ(x) that is differentiable and square-integrable. First ordering: x̂p̂ψ = x(−iħ dψ/dx) = −iħxψ′, because p̂ differentiates and only then does x multiply what comes out. Second ordering: p̂x̂ψ = −iħ d(xψ)/dx, and now x sits inside the derivative, so the product rule returns −iħ(ψ + xψ′). Subtract, and the two −iħxψ′ pieces are identical and vanish: [x̂, p̂]ψ = −iħxψ′ + iħψ + iħxψ′ = iħψ. Nothing about ψ was used except differentiability, so the result is the operator identity [x̂, p̂] = iħ Î, valid on every state in the domain. Reverse the order and the sign reverses with it: [p̂, x̂] = −iħ. The domain is not decoration — ψ must be smooth enough to differentiate and decay fast enough that xψ and ψ′ stay square-integrable, which is why Schwartz functions are the standard home for this relation.
2The momentum representation, and the sign that flips
Run the derivation in the other basis and watch where the sign comes from. Write ψ(x) as a superposition of momentum eigenfunctions, ψ(x) = (2πħ)(−1/2) ∫ φ(p) exp(ipx/ħ) dp. Acting with p̂ = −iħ ∂/∂x on the kernel gives −iħ(ip/ħ) exp(ipx/ħ) = p exp(ipx/ħ), so in this basis p̂ is plain multiplication by p. Position is the interesting one. Since ∂/∂p exp(ipx/ħ) = (ix/ħ) exp(ipx/ħ), multiplying by x is the same as acting with −iħ ∂/∂p on the kernel — but the kernel is not where φ lives. Integrate by parts, the boundary term dies because φ vanishes as |p| → ∞, and the derivative lands on φ with its sign reversed: x̂φ = +iħ dφ/dp. Now test the commutator: iħ d(pφ)/dp − p(iħ dφ/dp) = iħφ + iħp φ′ − iħp φ′ = iħφ. Same relation, same iħ, and no reference to x at all. Guessing x̂ = −iħ d/dp by false symmetry would have returned −iħ instead, and with it momentum eigenfunctions running the wrong way.
3The fine print: Cartesian, and on the whole line
Read the derivation again and note what it assumed: a coordinate x running over all of ℝ, with p̂ = −iħ d/dx self-adjoint on that line. Change either premise and the conclusion goes. Put the particle on a circle and try [φ̂, L̂z] = iħ with L̂z = −iħ ∂/∂φ. Single-valuedness forces L̂z|m⟩ = mħ|m⟩ with m an integer, so take the diagonal element in that state: ⟨m|φ̂L̂z|m⟩ − ⟨m|L̂zφ̂|m⟩ = mħ⟨m|φ̂|m⟩ − mħ⟨m|φ̂|m⟩ = 0, while the relation demands iħ. That is the trace argument again in miniature, and it kills the relation outright: there is no self-adjoint angle operator on a circle that obeys it. The repair is to use single-valued functions of the angle, [L̂z, cos φ̂] = iħ sin φ̂ and [L̂z, sin φ̂] = −iħ cos φ̂, from which an honest uncertainty bound does follow. The half-line bites too. Radial momentum p̂ᵣ = −iħ(∂/∂r + 1/r) does satisfy [r̂, p̂ᵣ] = iħ, but it has no self-adjoint extension on the half-line, so it is not an observable and the bound it appears to imply means nothing.
4One relation, one theory: Weyl, Stone and von Neumann
Because x̂ and p̂ are unbounded, the relation as written is sensitive to domains: Nelson built a pair satisfying it on a dense domain that is nevertheless not the standard one. The sharp version exponentiates both sides into bounded unitaries. With Û(a) = exp(−iap̂/ħ) and V̂(b) = exp(ibx̂/ħ), the Weyl form reads Û(a)V̂(b) = exp(−iab/ħ) V̂(b)Û(a), and Stone and von Neumann prove that on a separable Hilbert space every irreducible representation of it is unitarily equivalent to the position representation. The position picture, the momentum picture and the oscillator's ladder picture are therefore one theory in three sets of clothes. Make that concrete: put â = √(mω/2ħ)(x̂ + ip̂/mω). Then [â, â†] = (−i/2ħ)[x̂, p̂] + (i/2ħ)[p̂, x̂] = ½ + ½ = 1, which came from the canonical relation and nothing else — and it is why the oscillator spectrum ħω(n + ½) can be derived without ever writing down a wavefunction.
Key equations
Read the units, assumptions and limits before substituting.
Acting on a test function
(x̂p̂ − p̂x̂)ψ = −iħxψ′ + iħ(ψ + xψ′) = iħψ
The xψ′ terms cancel. What survives is dx/dx = 1, lifted out by the product rule and dressed in iħ.
ψ differentiable, with xψ and ψ′ square-integrable; ħ = 1.055 × 10⁻³⁴ J sThe canonical set in three dimensions
[x̂ⱼ, p̂ₖ] = iħ δⱼₖ · [x̂ⱼ, x̂ₖ] = 0 · [p̂ⱼ, p̂ₖ] = 0
x̂ and p̂y commute, so they share an eigenbasis and carry no mutual uncertainty penalty.
j and k run over x, y, z; δⱼₖ is the Kronecker δ, so ħ appears only on matching axesThe same relation in momentum space
x̂ = +iħ ∂/∂p · iħ ∂(pφ)/∂p − iħ p ∂φ/∂p = iħφ
The relation is representation-independent: change basis and the iħ survives untouched.
φ(p) is the transform of ψ(x) on the kernel exp(+ipx/ħ), and that sign fixes the plus on x̂An angle on a circle breaks it
⟨m|[φ̂, L̂z]|m⟩ = mħ⟨m|φ̂|m⟩ − mħ⟨m|φ̂|m⟩ = 0 ≠ iħ
φψ jumps at φ = 2π, so it leaves the domain where L̂z is self-adjoint, and the integration by parts leaves a boundary term that carries the whole iħ.
L̂z = −iħ ∂/∂φ acts on single-valued functions of the angle φ in rad; L̂z|m⟩ = mħ|m⟩ with m an integer and ħ in J sThe repair: periodic functions of the angle
[L̂z, cos φ̂] = iħ sin φ̂ · [L̂z, sin φ̂] = −iħ cos φ̂
These survive where [φ̂, L̂z] = iħ cannot, and they are what an honest angle–angular-momentum bound is built from.
cos φ̂ and sin φ̂ are dimensionless and single-valued, so they keep a state inside L̂z's domain; both sides carry J sWeyl form: the relation exponentiated
exp(iap̂/ħ) x̂ exp(−iap̂/ħ) = x̂ + a
The bounded restatement Stone and von Neumann prove unique, so every representation is one theory.
a is a real displacement in m; exp(−iap̂/ħ) is the unitary carrying ψ(x) to ψ(x − a)Interactive lab
Predict first. Explore the model. Compare the result.
Explore the model
Try this. Leave a at 1.20 nm and put the probe at x = 1 nm: the dashed curves read 0.491 and −0.216, and the gap between them is 0.707, which is ψ(1). Now widen a to 2.40 nm — both dashed curves move, the gap moves with them, and the last readout stays at 1.000.
Live results
- x̂p̂ψ ÷ iħ
- 0.491
- p̂x̂ψ ÷ iħ
- -0.216
- DIFFERENCE ÷ iħ
- 0.707
- DIFFERENCE ÷ iħψ
- 1.000
Results follow this lesson’s model and assumptions. Displayed values are rounded.
Predict → change one variable → check
Plan a change before running it. Every other input stays at the saved baseline.
Saved baseline. Gaussian width a: 1.2 nm; Probe position x: 1.00 nm
This experiment is kept only while this page is open. It does not change saved course progress.
Catch the common trap
The mistake is always the second term. Students write (x̂p̂ − p̂x̂)ψ = x(−iħψ′) − (−iħxψ′) = 0, conclude that position and momentum commute, and have read p̂x̂ψ as x times p̂ψ. It is not that. x̂ acts first, so p̂ must differentiate the whole product, and d(xψ)/dx = ψ + xψ′ carries a term the other ordering never produces. That lone ψ is the entire relation: strip the iħ away and what is left is dx/dx = 1. The other half of the error is reading the result as a statement about apparatus, that measuring x kicks p. Nothing was measured. [x̂, p̂] = iħ is an algebraic identity holding on every state in the domain, including states nobody has ever prepared, and it returns the same number for a ground-state atom as for a free electron. What it forbids is a shared eigenbasis, and that is a fact about the operators, not about clumsy instruments.
Practice & worked examples
3 authored examples. Make an attempt, then reveal the reasoning one step at a time.
EasyExample 1
Take the unnormalised Gaussian ψ(x) = exp(−x²/2a²) with a = 0.50 nm. Evaluate x̂p̂ψ and p̂x̂ψ explicitly, subtract them, and say what became of a.
Sketch your answer or reasoning, then compare it with the authored solution. Your writing is not automatically graded or saved.
0 of 4 steps revealed.
- ψ′ = (−x/a²)ψ, so p̂ψ = −iħψ′ = iħ(x/a²)ψ. Multiplying by x on the left gives x̂p̂ψ = iħ(x²/a²)ψ.
- The other order puts x inside the derivative: p̂x̂ψ = −iħ d(xψ)/dx = −iħ(ψ + xψ′) = −iħψ + iħ(x²/a²)ψ = iħ(x²/a² − 1)ψ.
- Subtract: [x̂, p̂]ψ = iħ(x²/a²)ψ − iħ(x²/a² − 1)ψ = iħψ. Every term carrying x or a has cancelled.
- Check it at one point. At x = a = 0.50 nm the ratio x²/a² is 1, so x̂p̂ψ = iħψ(a) while p̂x̂ψ = 0 — a gap of exactly iħψ(a), with ħ = 1.055 × 10⁻³⁴ J s and ψ(a) = exp(−½) = 0.607.
Answer. [x̂, p̂]ψ = iħψ. The width a cancels identically, so what is left is iħ times the identity, with ħ = 1.055 × 10⁻³⁴ J s — the same on this Gaussian, on any other, and on every state in the domain.
MediumExample 2
Displace the Easy example's Gaussian to ψ(x) = exp(−(x − x₀)²/2a²), with a = 0.50 nm and x₀ = 2.0 nm. On the kernel exp(+ipx/ħ) its momentum amplitude is φ(p) ∝ exp(−a²p²/2ħ²) exp(−ipx₀/ħ). Act on φ with x̂ = +iħ d/dp, find ⟨x̂⟩, check it against position space, and say what x̂ = −iħ d/dp would have reported.
Sketch your answer or reasoning, then compare it with the authored solution. Your writing is not automatically graded or saved.
0 of 5 steps revealed.
- Differentiate: dφ/dp = (−a²p/ħ² − ix₀/ħ)φ, so x̂φ = iħ dφ/dp = (x₀ − ia²p/ħ)φ.
- Dimensions: a²p/ħ carries m² × kg m s⁻¹ ÷ kg m² s⁻¹ = m, the same as x₀, as a position must.
- Average: ⟨x̂⟩ = ∫|φ|²(x₀ − ia²p/ħ) dp ÷ ∫|φ|² dp. The phase cancels in |φ|² = exp(−a²p²/ħ²), which is even in p, so the odd imaginary term integrates to zero and ⟨x̂⟩ = x₀ = 2.0 nm — real, as the mean of a Hermitian operator must be.
- Position space agrees: |ψ(x)|² is symmetric about x₀, so ⟨x⟩ = 2.0 nm directly, and x₀ → 0 returns the centred packet with ⟨x⟩ = 0. The same φ passes the commutator test too: iħ d(pφ)/dp − p(iħ dφ/dp) = iħφ, with no x₀ or a left in it.
- The false-symmetry choice x̂ = −iħ d/dp flips every term and gives ⟨x̂⟩ = −x₀ = −2.0 nm: a packet sitting at +2.0 nm reported on the wrong side of the origin, alongside [x̂, p̂] = −iħ.
Answer. x̂φ = (x₀ − ia²p/ħ)φ and ⟨x̂⟩ = +2.0 nm, matching position space. The kernel fixes the sign: x̂ = −iħ d/dp would have put the packet at −2.0 nm.
HardExample 3
A particle on a ring is in the L̂z eigenstate ψ(φ) = exp(2iφ)/√(2π), with φ in [0, 2π) and L̂z = −iħ d/dφ. Test [φ̂, L̂z] = iħ on it: compute ⟨φ̂L̂z⟩, then ⟨L̂zφ̂⟩ both by letting L̂z act to the left and by differentiating φψ directly, and account for the gap. Then test the bound Δφ ΔLz ≥ ħ/2 that the relation would imply, and the one the repaired pair [L̂z, cos φ̂] = iħ sin φ̂ gives.
Sketch your answer or reasoning, then compare it with the authored solution. Your writing is not automatically graded or saved.
0 of 5 steps revealed.
- L̂zψ = −iħ(2i)ψ = 2ħψ, and |ψ|² = 1/2π is uniform on the ring, so ⟨φ̂⟩ = π rad and ⟨φ̂L̂z⟩ = 2ħ⟨φ̂⟩ = 2πħ.
- Let L̂z act to the left, as a Hermitian operator may on its domain: ⟨ψ|L̂zφ̂|ψ⟩ = 2ħ⟨φ̂⟩ = 2πħ, so ⟨[φ̂, L̂z]⟩ = 0, not iħ.
- Differentiate instead: L̂z(φψ) = −iħ(ψ + 2iφψ) = −iħψ + 2ħφψ, so ⟨ψ|L̂z(φψ)⟩ = 2πħ − iħ and ⟨[φ̂, L̂z]⟩ = iħ. The two routes disagree by exactly iħ.
- The gap is the boundary term of the integration by parts that moves L̂z to the left: −iħ[φ|ψ|²] from 0 to 2π = −iħ(2π − 0)/2π = −iħ. It exists because φψ is not periodic — it approaches 2πψ(0) as φ → 2π but is 0 at φ = 0 — so φ̂ carries ψ out of the domain where L̂z is Hermitian, and the relation cannot hold there.
- Spreads: ΔLz = 0 in an eigenstate, while the uniform |ψ|² gives Δφ = 2π/√12 = π/√3 = 1.81 rad. The product is 0, below ħ/2 = 5.27 × 10⁻³⁵ J s, so the bound the relation would imply is broken. The repaired pair asks only ΔLz Δ(cos φ) ≥ (ħ/2)|⟨sin φ̂⟩|, and ⟨sin φ̂⟩ = 0 on a uniform ring, so it reads 0 ≥ 0 and holds.
Answer. ⟨[φ̂, L̂z]⟩ is 0 by the Hermitian route and iħ by direct differentiation; the boundary term −iħ from the non-periodic φψ accounts for the whole gap, so the relation fails on the ring. Δφ = 1.81 rad with ΔLz = 0 breaks Δφ ΔLz ≥ ħ/2 = 5.27 × 10⁻³⁵ J s, while the repaired bound reads 0 ≥ 0 and holds.
Quick check
Select an answer and explain it before checking.
Review & continue
The canonical commutation relation says position and momentum fail to commute by a fixed amount: x̂p̂ − p̂x̂ is iħ times the identity operator — the same number in every state, in every representation, and at every time.
- Explain the relationship without looking at the equation.
- Check a sign, a unit and a model assumption in your working.
- Return to the lab or worked example if a step is still unclear.