Search

Search papers and lessons

Hilbert Space

Level 3 · 15 min read

A Hilbert space is a vector space with a length and an angle defined by an inner product, complete enough that limits of sequences stay inside it.

On this page

  • Colour = topic mix
  • Linear algebra
  • Discrete math
  • Quantum physics
  • Sign in to see your progress

TL;DR

A Hilbert space is a set of vectors where you can add vectors, scale them, measure their length, and measure the angle between them. The measuring is done by an inner product, which generalises the dot product. The space also has to be complete: any sequence of vectors that is settling down must settle onto a vector that is still in the space.

Hilbert spaces are the right setting for functions, signals and quantum states, where the vectors have infinitely many coordinates. Geometry still works there, so the familiar tools of projections and right angles carry over.

Where you'll see it: in quantum mechanics, where every state of a system is a unit vector in a Hilbert space, and in Fourier analysis, where a signal is written as a sum of orthogonal waves.

Intuition

Geometry without coordinates

In the plane, a vector is an arrow. You can measure its length, you can ask whether two arrows are perpendicular, and you can drop a perpendicular from one arrow onto another. The Dot Product gives you all of this through coordinates: a⋅b=a1b1+a2b2\mathbf{a} \cdot \mathbf{b} = a_1 b_1 + a_2 b_2, and the Vector Norm is ∥a∥=a⋅a\|\mathbf{a}\| = \sqrt{\mathbf{a} \cdot \mathbf{a}}.

Now consider a function, such as f(t)=sin⁡(3t)f(t) = \sin(3t) on the interval from 0 to π\pi. You can think of it as a vector with infinitely many coordinates, one for each value of tt. Its "length" should be the square root of the integral of f(t)2f(t)^2, and the "angle" between two functions should come from the integral of their product. The geometry you already know still applies, as long as the space is set up correctly.

A Hilbert space is exactly that: a space of vectors, possibly infinite-dimensional, where length and angle are defined and where the space has no holes. Lengths and angles are what let you do geometry. Completeness is what guarantees that the geometry does not break at the edges.

Why the "no holes" part matters

Take the sequence 1,1.4,1.41,1.414,…1, 1.4, 1.41, 1.414, \dots. Every term is a rational number, and the sequence closes in on 2\sqrt{2}. If you only allowed rational numbers, that limit would not exist inside your world. The rationals have holes. The real numbers fill them.

Vector spaces have the same problem. A sequence of polynomials can converge to something that is not a polynomial. A Hilbert space fills those holes, so every convergent sequence has a limit inside the space. That is why projections, which need limits, are guaranteed to exist.

00.20.40.60.8111.522.5tf(t)
  • e^x
  • degree-2 Taylor polynomial
On [0, 1] the polynomial is already close to e^t. Adding more terms makes the gap shrink in the length sense used by Hilbert spaces, but the limit is e^t itself, which is not a polynomial.

The math

Definition: Inner product space

A vector space VV over R\mathbb{R} or C\mathbb{C} with a map ⟨⋅,⋅⟩:V×V→C\langle \cdot, \cdot \rangle : V \times V \to \mathbb{C} such that, for all x,y,z∈Vx, y, z \in V and scalars aa:

  1. Linearity in the second slot: ⟨z,ax+y⟩=a⟨z,x⟩+⟨z,y⟩\langle z, a x + y \rangle = a \langle z, x \rangle + \langle z, y \rangle. (This is the physics convention, used throughout this lesson; mathematicians often put the linearity in the first slot instead.)
  2. Conjugate symmetry: ⟨x,y⟩=⟨y,x⟩‾\langle x, y \rangle = \overline{\langle y, x \rangle}, where the bar means complex conjugate. For real spaces this is plain symmetry.
  3. Positive definiteness: ⟨x,x⟩≥0\langle x, x \rangle \geq 0, with equality only when x=0x = 0.

Every inner product defines a norm and a notion of angle:

∥x∥=⟨x,x⟩,cos⁡θ=Re⁡⟨x,y⟩∥x∥ ∥y∥.\|x\| = \sqrt{\langle x, x \rangle}, \qquad \cos\theta = \frac{\operatorname{Re}\langle x, y \rangle}{\|x\|\,\|y\|}.

Two vectors are orthogonal when ⟨x,y⟩=0\langle x, y \rangle = 0. Orthogonality is the algebraic version of a right angle.

The Cauchy–Schwarz inequality

For any two vectors in an inner product space,

∣⟨x,y⟩∣≤∥x∥ ∥y∥.|\langle x, y \rangle| \leq \|x\| \, \|y\|.

This is what makes the angle formula well defined: the right-hand side of the cosine formula always lies between −1-1 and 11. It also gives the triangle inequality ∥x+y∥≤∥x∥+∥y∥\|x + y\| \leq \|x\| + \|y\|, so the norm really behaves like a length.

Completeness

A sequence (xn)(x_n) is Cauchy when its terms get close to each other: for every ε>0\varepsilon \gt 0 there is an NN such that ∥xm−xn∥<ε\|x_m - x_n\| \lt \varepsilon whenever m,n>Nm, n \gt N. In a complete space every Cauchy sequence converges to a point of the space.

Definition: Hilbert space

A complete inner product space: an inner product space in which every Cauchy sequence converges to an element of the space.

Finite-dimensional inner product spaces, such as Rn\mathbb{R}^n with the dot product, are always complete. The interesting cases are infinite-dimensional, where completeness is a real condition.

Orthogonal projection

Let MM be a closed subspace of a Hilbert space HH (closed meaning it contains its own limits). For every x∈Hx \in H there is a unique decomposition

x=m+r,m∈M,r⊥M.x = m + r, \qquad m \in M, \quad r \perp M.

The vector mm is the point of MM closest to xx, and ∥x∥2=∥m∥2+∥r∥2\|x\|^2 = \|m\|^2 + \|r\|^2 by the Pythagorean theorem. Completeness is what makes the closest point exist. Without it, the infimum of distances might never be reached.

Two standard examples of Hilbert spaces

The space ℓ2\ell^2 consists of sequences x=(x1,x2,… )x = (x_1, x_2, \dots) of complex numbers with ∑n∣xn∣2<∞\sum_{n} |x_n|^2 \lt \infty, and the inner product is

⟨x,y⟩=∑n=1∞xn‾ yn.\langle x, y \rangle = \sum_{n=1}^{\infty} \overline{x_n}\, y_n.

The space L2[0,1]L^2[0, 1] consists of functions ff on [0,1][0, 1] with ∫01∣f(t)∣2 dt<∞\int_0^1 |f(t)|^2 \, dt \lt \infty, with inner product

⟨f,g⟩=∫01f(t)‾ g(t) dt.\langle f, g \rangle = \int_0^1 \overline{f(t)}\, g(t) \, dt.

The Riesz–Fischer theorem, proved in 1907, says that L2L^2 is complete. That completeness is the reason functions can be treated as vectors in the first place.

Worked examples

Example
A sequence in ℓ²

Let xn=1nx_n = \dfrac{1}{n} and yn=(12)ny_n = \left(\dfrac{1}{2}\right)^n for n=1,2,3,…n = 1, 2, 3, \dots (both real).

  1. Check that xx is in ℓ2\ell^2: ∑n=1∞1n2=π26\sum_{n=1}^{\infty} \dfrac{1}{n^2} = \dfrac{\pi^2}{6}, which is finite, so ∥x∥2=π26≈1.6449\|x\|^2 = \dfrac{\pi^2}{6} \approx 1.6449 and ∥x∥≈1.2825\|x\| \approx 1.2825.
  2. Compute ∥y∥2=∑n=1∞(14)n=1/41−1/4=13\|y\|^2 = \sum_{n=1}^{\infty} \left(\dfrac{1}{4}\right)^n = \dfrac{1/4}{1 - 1/4} = \dfrac{1}{3}, so ∥y∥≈0.5774\|y\| \approx 0.5774.
  3. Compute the inner product using ∑n=1∞znn=−ln⁡(1−z)\sum_{n=1}^{\infty} \dfrac{z^n}{n} = -\ln(1 - z) with z=12z = \dfrac{1}{2}: ⟨x,y⟩=∑n=1∞1n(12)n=−ln⁡(12)=ln⁡2≈0.6931\langle x, y \rangle = \sum_{n=1}^{\infty} \dfrac{1}{n} \left(\dfrac{1}{2}\right)^n = -\ln\left(\dfrac{1}{2}\right) = \ln 2 \approx 0.6931.
  4. Check Cauchy–Schwarz: ∣⟨x,y⟩∣≈0.6931|\langle x, y \rangle| \approx 0.6931 and ∥x∥ ∥y∥≈1.2825×0.5774≈0.7405\|x\|\,\|y\| \approx 1.2825 \times 0.5774 \approx 0.7405. Since 0.6931≤0.74050.6931 \leq 0.7405, the inequality holds.

Interpretation: the two sequences point in fairly similar directions. The cosine of the angle between them is 0.6931/0.7405≈0.9360.6931 / 0.7405 \approx 0.936, a little under 21 degrees.

Example
Angle between functions in L²[0, 1]

Let f(t)=1f(t) = 1 and g(t)=tg(t) = t.

  1. Norm of ff: ∥f∥2=∫0112 dt=1\|f\|^2 = \int_0^1 1^2 \, dt = 1, so ∥f∥=1\|f\| = 1.
  2. Norm of gg: ∥g∥2=∫01t2 dt=13\|g\|^2 = \int_0^1 t^2 \, dt = \dfrac{1}{3}, so ∥g∥=13≈0.5774\|g\| = \dfrac{1}{\sqrt{3}} \approx 0.5774.
  3. Inner product: ⟨f,g⟩=∫01t dt=12\langle f, g \rangle = \int_0^1 t \, dt = \dfrac{1}{2}.
  4. Cosine of the angle: cos⁡θ=1/21⋅1/3=32≈0.866\cos\theta = \dfrac{1/2}{1 \cdot 1/\sqrt{3}} = \dfrac{\sqrt{3}}{2} \approx 0.866, so θ=30∘\theta = 30^\circ.

Interpretation: the constant function and the line tt are 30 degrees apart in the geometry of L2[0,1]L^2[0, 1], even though they are not arrows you can draw. The projection of gg onto the constant function is ⟨f,g⟩∥f∥2f=12\dfrac{\langle f, g\rangle}{\|f\|^2} f = \dfrac{1}{2}, which is the best constant approximation to tt in the least-squares sense.

Example
Projection in ℝ³ (the finite case, to see the picture)

Let x=(1,2,3)x = (1, 2, 3) and let MM be the plane spanned by e1=(1,0,0)e_1 = (1, 0, 0) and e2=(0,1,0)e_2 = (0, 1, 0).

  1. The projection onto MM keeps the first two coordinates: m=(1,2,0)m = (1, 2, 0).
  2. The residual is r=x−m=(0,0,3)r = x - m = (0, 0, 3), and ⟨r,e1⟩=⟨r,e2⟩=0\langle r, e_1 \rangle = \langle r, e_2 \rangle = 0, so r⊥Mr \perp M.
  3. Pythagoras: ∥x∥2=1+4+9=14\|x\|^2 = 1 + 4 + 9 = 14, and ∥m∥2+∥r∥2=5+9=14\|m\|^2 + \|r\|^2 = 5 + 9 = 14.

The same steps work in ℓ2\ell^2 or L2L^2 once the subspace is closed, which is the content of the projection theorem.

Tradeoffs and failure modes

Hilbert spaces are the right tool when you need lengths, angles and projections. They are the wrong tool when your space has no natural inner product, or when the natural norm is not one that comes from an inner product.

SituationWhat goes wrongBetter choice
Measuring errors with the largest deviation (max norm)The max norm comes from no inner product, so right angles and projections are not availableWork in a Banach space (a complete normed space), which has a norm but no angles
Forgetting that the subspace must be closedThe closest point may not exist, so the projection is not definedTake the closure of the subspace first
Mixing up finite and infinite casesIntuition from R3\mathbb{R}^3 fails in infinite dimensions, for example closed unit balls are not compactCheck each theorem's hypotheses before reusing a picture
Assuming every subspace is closedA dense subspace such as the polynomials in L2[0,1]L^2[0,1] is not closedUse the closure, which is all of L2[0,1]L^2[0,1] in this case
Forgetting complex conjugationThe inner product is not symmetric for complex vectors, and the squared modulus $\langle e, \psi\rangle

The main alternative when angles are not needed is a Banach space: a complete normed space. Hilbert spaces are a special case in which the norm comes from an inner product, and that extra structure is what gives you orthogonal projections.

History

David Hilbert studied infinite systems of linear equations and integral equations between 1904 and 1910. He worked with infinitely many variables and treated them as points of a space with a notion of distance. His lectures collected in 1912 laid much of the groundwork.

Erhard Schmidt and Frigyes Riesz developed the geometry of these spaces in the years that followed. The completeness of L2L^2 was established by Riesz and by Ernst Sigismund Fischer, independently, in 1907.

The name "Hilbert space" was given in the late 1920s by John von Neumann. Physicists needed a setting for the new quantum mechanics of the 1920s, in which states are vectors and observable quantities are operators. Von Neumann's 1932 book on the mathematical foundations of quantum mechanics made the Hilbert space the standard language for the subject. It caught on because the same tools worked for both infinite-dimensional function spaces and the finite-dimensional spaces that physicists used for spin.

Check yourself

QuestionRecall: what two properties must an inner product have so that the norm ∥x∥=⟨x,x⟩\|x\| = \sqrt{\langle x, x\rangle} is a real, non-negative length?Show answer

It must be positive definite: ⟨x,x⟩≥0\langle x, x \rangle \geq 0, with equality only for x=0x = 0. This makes the square root real and zero only at the zero vector. It must also be conjugate symmetric, ⟨x,y⟩=⟨y,x⟩‾\langle x, y \rangle = \overline{\langle y, x \rangle}, which forces ⟨x,x⟩\langle x, x \rangle to be real. Together with linearity in the second slot, these are the axioms of an inner product.

QuestionCompute ⟨f,g⟩\langle f, g\rangle in L2[0,1]L^2[0,1] for f(t)=tf(t) = t and g(t)=t2g(t) = t^2, and find ∥f∥\|f\|.Show answer

⟨f,g⟩=∫01t⋅t2 dt=∫01t3 dt=14\langle f, g \rangle = \int_0^1 t \cdot t^2 \, dt = \int_0^1 t^3 \, dt = \dfrac{1}{4}. Also ∥f∥2=∫01t2 dt=13\|f\|^2 = \int_0^1 t^2 \, dt = \dfrac{1}{3}, so ∥f∥=13≈0.5774\|f\| = \dfrac{1}{\sqrt{3}} \approx 0.5774. As a check, Cauchy–Schwarz needs ∥g∥2=∫01t4 dt=15\|g\|^2 = \int_0^1 t^4 \, dt = \dfrac{1}{5}, and ∥f∥ ∥g∥=115≈0.2582≥0.25\|f\|\,\|g\| = \dfrac{1}{\sqrt{15}} \approx 0.2582 \geq 0.25.

QuestionWhy does the orthogonal projection onto a subspace MM need MM to be closed?Show answer

The projection of xx is the point of MM closest to xx. Existence of a closest point requires that the distances ∥x−m∥\|x - m\| for m∈Mm \in M have a minimiser, and the minimising sequence must converge to a point that lies in MM. If MM is not closed, the limit can fall outside MM, and then no closest point exists inside MM. Completeness of the whole space makes the limit exist, and closedness of MM makes it lie in MM.

QuestionA qubit is in the state ψ=(35,4i5)\psi = \left(\dfrac{3}{5}, \dfrac{4i}{5}\right) in the basis e0=(1,0)e_0 = (1, 0), e1=(0,1)e_1 = (0, 1). What is the probability of measuring e0e_0? What is the probability of measuring e1e_1?Show answer

First check that the state is normalised: ∣3/5∣2+∣4i/5∣2=9/25+16/25=1|3/5|^2 + |4i/5|^2 = 9/25 + 16/25 = 1. The Born rule says the probability of outcome eke_k is ∣⟨ek,ψ⟩∣2|\langle e_k, \psi \rangle|^2. Here ⟨e0,ψ⟩=3/5\langle e_0, \psi\rangle = 3/5, so P(e0)=9/25=0.36P(e_0) = 9/25 = 0.36. Also ⟨e1,ψ⟩=4i/5\langle e_1, \psi \rangle = 4i/5, so P(e1)=16/25=0.64P(e_1) = 16/25 = 0.64. The probabilities add to 1, as they must for a normalised state in an orthonormal basis.

Sources