Skip to content
Tutorials Center
My learning

Topics

Lesson 5 of 39 · Hilbert Space and Dirac Notation

Hilbert Spaces

Understand complex vector spaces with an inner product, orthonormal bases, completeness and L² functions, the mathematical home of quantum states.

Wave functions, spin states and photon polarizations look very different, yet they obey the same rules: you can add them, scale them by complex numbers and measure an overlap between two of them. A Hilbert space is the mathematical structure that captures exactly these features. Once you see quantum states as vectors, much of quantum mechanics becomes linear algebra with a few extra rules.

This lesson defines the structure, shows the two most important examples (ℂⁿ and the space of square-integrable functions), and verifies key properties numerically.

What is a Hilbert space?

A Hilbert space ℋ is a complex vector space with three ingredients.

  1. Linear structure. If |ψ⟩ and |φ⟩ are in ℋ, so is a|ψ⟩ + b|φ⟩ for complex numbers a, b. This is the superposition principle.
  2. Inner product. For every pair there is a complex number ⟨φ|ψ⟩ that is linear in the second slot, satisfies ⟨φ|ψ⟩ = ⟨ψ|φ⟩*, and has ⟨ψ|ψ⟩ ≥ 0 with equality only for the zero vector.
  3. Completeness. Every Cauchy sequence of vectors converges to a vector in the space. (In finite dimensions this is automatic; in infinite dimensions it is what makes limits behave.)

The norm is ‖ψ‖ = √⟨ψ|ψ⟩. A state is a vector with ‖ψ‖ = 1, and the overlap |⟨φ|ψ⟩|² is a probability.

Mathematicians usually put the linearity in the first slot of the inner product; physicists put it in the second. This track follows the physics convention, ⟨φ|aψ⟩ = a⟨φ|ψ⟩.

Two examples you must know

Space Vectors Inner product Used for
ℂⁿ columns (c₁, ..., cₙ) Σ aᵢ* bᵢ spin, qubits, finite level systems
L²(ℝ) functions with ∫|ψ|² dx < ∞ ∫ φ*(x) ψ(x) dx a particle on a line

The condition ∫|ψ|² dx < ∞ is why only square-integrable wave functions are normalizable states. Plane waves e^{ikx} are not in L²: they are useful idealizations, treated in Lesson 5 of this chapter.

Two inequalities that do real work

The Cauchy–Schwarz inequality is |⟨φ|ψ⟩|² ≤ ⟨φ|φ⟩ ⟨ψ|ψ⟩. It guarantees that overlaps between normalized states are at most 1, so they can be probabilities. It is also the engine behind the general uncertainty principle.

The triangle inequality ‖ψ + φ‖ ≤ ‖ψ‖ + ‖φ‖ makes the norm a good measure of distance between states.

Python Inner products and Cauchy–Schwarz in C^n

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 ratio is never above 1, and it equals 1 exactly when the vectors are proportional.

Orthonormal bases and expansions

A set {|eₙ⟩} is orthonormal if ⟨eₘ|eₙ⟩ = δₘₙ. It is a basis (complete) if every state can be written

Text
|ψ⟩ = Σₙ cₙ |eₙ⟩,   cₙ = ⟨eₙ|ψ⟩

Normalization then reads Σₙ |cₙ|² = 1 (Parseval's identity), and |cₙ|² is the probability of finding the system in basis state n. The completeness relation is Σₙ |eₙ⟩⟨eₙ| = 1, which you will use constantly in the next lesson.

In infinite dimensions you cannot compute with all basis vectors, so you truncate. Take the particle-in-a-box states on [0, 1], eₙ(x) = √2 sin(nπx), and expand the function ψ(x) = x(1 − x), scaled to unit norm. Watch the captured probability approach 1 as you include more states.

Python Completeness: expanding in box eigenfunctions

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.

Only odd n contribute, because ψ is symmetric about x = ½ while e_n for even n is antisymmetric. The cumulative sum climbs toward 1 very quickly because the function is smooth. A function with a sharp kink would need many more terms.

Dimension and the continuum

ℂⁿ has dimension n. A box particle has a countably infinite basis (n = 1, 2, 3, ...), so its Hilbert space is separable. A free particle's position basis |x⟩ is a continuum, yet it still lives in the same separable L² space: the vectors |x⟩ are not themselves normalizable states but generalized eigenvectors, a point developed in Lesson 5.

From vectors to states

Add and scale Superposition
Inner product Overlap amplitude
Complete Limits stay inside
1 / 2

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. Which property of the inner product makes |⟨φ|ψ⟩|² ≤ 1 for normalized states?

    Cauchy–Schwarz bounds the overlap by the product of the norms, which equals 1 for normalized states.
  2. 2. In the expansion |ψ⟩ = Σ cₙ|eₙ⟩ with an orthonormal basis, the coefficient cₙ equals

    Taking the inner product of both sides with ⟨eₙ| and using orthonormality gives cₙ = ⟨eₙ|ψ⟩.
  3. 3. Why does only odd n contribute when expanding x(1−x) in the box states sin(nπx)?

    The overlap of a symmetric function with an antisymmetric one is zero, so those coefficients vanish.
  4. 4. Which function space is the usual Hilbert space for one particle on a line?

    Normalizable wave functions satisfy ∫|ψ|² dx < ∞, which defines L²(ℝ).

Summary

  • A Hilbert space is a complete complex vector space with an inner product; quantum states are unit vectors in it.
  • ℂⁿ models finite-level systems and L² models particles in space.
  • Cauchy–Schwarz guarantees overlaps are valid probabilities.
  • An orthonormal basis gives coefficients cₙ = ⟨eₙ|ψ⟩ with Σ|cₙ|² = 1.
  • Truncated expansions converge faster for smoother states.

Next: Bras, Kets and Operators