Inner Products & Norms

4 hours ~6 min read

Inner Products & Norms

The inner product is how quantum mechanics measures overlap between states — and overlap is probability. The Born rule, orthogonality of distinguishable outcomes, normalization of states, and the geometry of the Bloch sphere all reduce to the single structure we build here. Get the conjugate-linear convention right and everything downstream is clean.

Learning Objectives

After this lesson you will be able to:

  1. State the axioms of a complex inner product and compute u,v\langle u, v\rangle on Cn\mathbb{C}^n.
  2. Prove and apply the Cauchy–Schwarz and triangle inequalities.
  3. Test vectors for orthogonality and normalize them.
  4. Run Gram–Schmidt to produce an orthonormal basis.
  5. Expand a vector in an orthonormal basis via projection, and state Parseval's identity.

Intuition

In Rn\mathbb{R}^n the dot product uv=kukvku \cdot v = \sum_k u_k v_k measures how much two vectors "agree": it's largest when they point the same way, zero when perpendicular. It also defines length: u=uu\|u\| = \sqrt{u\cdot u}.

Over C\mathbb{C} we need a twist. If we naïvely used kukvk\sum_k u_k v_k, the "length squared" of v=(i,0)Tv = (i, 0)^T would be i2+0=1<0i^2 + 0 = -1 < 0 — nonsense for a length. The fix is to conjugate one factor: v,v=kvkvk=kvk20\langle v, v\rangle = \sum_k v_k^* v_k = \sum_k |v_k|^2 \ge 0. That single conjugation is the whole story of complex inner products, and it's exactly what makes i-state2|\langle i\text{-state}\rangle|^2 a valid probability later.


Theory

Definition: complex inner product

An inner product on a complex vector space VV is a map $\langle\cdot,\cdot\rangle : V\times V \to \mathbb{C}satisfying,forall satisfying, for all u,v,w \in Vand and a \in \mathbb{C}$:

(I1) conjugate symmetry:u,v=v,u(I2) linearity in the 2nd argument:u,av+w=au,v+u,w(I3) positive-definiteness:v,v0,v,v=0    v=0 \begin{aligned} &\textbf{(I1) conjugate symmetry:} && \langle u, v\rangle = \overline{\langle v, u\rangle} \\ &\textbf{(I2) linearity in the 2nd argument:} && \langle u,\, a v + w\rangle = a\langle u,v\rangle + \langle u,w\rangle \\ &\textbf{(I3) positive-definiteness:} && \langle v, v\rangle \ge 0,\quad \langle v,v\rangle = 0 \iff v = 0 \end{aligned}

Convention (physics / this program). We make the inner product linear in the second argument and conjugate-linear in the first: au,v=au,v\langle a u, v\rangle = \overline{a}\langle u,v\rangle, which follows from (I1)+(I2). This matches Dirac notation ϕψ\langle\phi|\psi\rangle (next lesson) and [NC]. Many mathematics texts (e.g. [Axl]) put linearity in the first argument instead — be alert when reading across sources. See Appendix C.

A vector space with an inner product is an inner product space. (Finite-dimensional inner product spaces over C\mathbb{C} are automatically complete, hence are Hilbert spaces — the term you'll hear constantly. Completeness only bites in infinite dimensions, which we avoid.)

The standard inner product on Cn\mathbb{C}^n

u,v:=k=1nukvk=uv, \langle u, v\rangle := \sum_{k=1}^{n} \overline{u_k}\, v_k = u^\dagger v,

where u=uTu^\dagger = \overline{u}^{\,T} is the conjugate transpose (a row vector). Check the axioms: (I1) $\overline{\langle v,u\rangle} = \overline{\sum \overline{v_k} u_k} = \sum v_k \overline{u_k} = \langle u,v\rangle;(I2)islinearityofthesumin; (I2) is linearity of the sum in v;(I3); (I3) \langle v,v\rangle = \sum |v_k|^2 \ge 0$ with equality iff every vk=0v_k = 0.

⚠️ NumPy: np.vdot(u, v) conjugates its first argument, matching our convention exactly. np.dot does not conjugate — wrong for complex vectors.

Norm

The inner product induces a norm (length):

v:=v,v=kvk2. \|v\| := \sqrt{\langle v, v\rangle} = \sqrt{\textstyle\sum_k |v_k|^2}.

A vector with v=1\|v\| = 1 is a unit vector; normalizing means vv/vv \mapsto v / \|v\|. Physical quantum states are unit vectors — this is the normalization condition ψψ=1\langle\psi|\psi\rangle = 1 you'll impose in Term 1.

Cauchy–Schwarz inequality

For all u,vu, v in an inner product space,

u,vuv \boxed{\,|\langle u, v\rangle| \le \|u\|\,\|v\|\,}

with equality iff uu and vv are linearly dependent.

Proof. If v=0v = 0 both sides are 00. Otherwise, for any λC\lambda \in \mathbb{C}, 0uλv2=uλv,uλv0 \le \|u - \lambda v\|^2 = \langle u-\lambda v,\, u-\lambda v\rangle. Expand using the axioms:

0u,uλv,uλu,v+λ2v,v. 0 \le \langle u,u\rangle - \overline{\lambda}\langle v,u\rangle - \lambda\langle u,v\rangle + |\lambda|^2\langle v,v\rangle.

Choose λ=v,uv,v\lambda = \dfrac{\langle v, u\rangle}{\langle v, v\rangle} (the projection coefficient). Using v,u=u,v\langle v,u\rangle = \overline{\langle u,v\rangle}, the cross terms combine and simplify to

0u2u,v2v2        u,v2u2v2. 0 \le \|u\|^2 - \frac{|\langle u,v\rangle|^2}{\|v\|^2} \;\;\Longrightarrow\;\; |\langle u,v\rangle|^2 \le \|u\|^2\|v\|^2 .

Taking square roots gives the result. Equality holds iff uλv=0u - \lambda v = 0, i.e. u,vu,v are dependent. ∎

Cauchy–Schwarz is the workhorse inequality of quantum information — it bounds state overlaps, underlies the uncertainty principle (Term 1.3), and guarantees fidelities lie in [0,1][0,1].

Triangle inequality

u+vu+v\|u + v\| \le \|u\| + \|v\|. Proof: $|u+v|^2 = |u|^2 + 2,\mathrm{Re}\langle u,v\rangle + |v|^2 \le |u|^2 + 2|\langle u,v\rangle| + |v|^2 \le |u|^2 + 2|u||v| + |v|^2 = (|u|+|v|)^2$, using Re(z)z\mathrm{Re}(z)\le|z| then Cauchy–Schwarz. ∎

Orthogonality and orthonormal bases

  • uvu \perp v (orthogonal) means u,v=0\langle u, v\rangle = 0. Physically, orthogonal states are perfectly distinguishable by a measurement.
  • A set {e1,,en}\{e_1,\dots,e_n\} is orthonormal if ei,ej=δij\langle e_i, e_j\rangle = \delta_{ij} (orthogonal and each of unit norm).
  • Orthonormal sets are automatically independent, so an orthonormal spanning set is an orthonormal basis (ONB).

Expansion in an ONB. If {ek}\{e_k\} is an ONB, then for any vv,

v=kek,vek. v = \sum_k \langle e_k, v\rangle\, e_k .

The coordinate is just the projection ek,v\langle e_k, v\rangleno linear system to solve. This is why orthonormal bases are so convenient, and why the computational basis {0,}\{|0\rangle,\dots\} is chosen orthonormal. The squared coordinates obey Parseval's identity:

v2=kek,v2. \|v\|^2 = \sum_k |\langle e_k, v\rangle|^2 .

For a normalized state and a measurement basis {ek}\{e_k\}, the terms ek,v2|\langle e_k, v\rangle|^2 are exactly the Born-rule probabilities and Parseval says they sum to 11.

Gram–Schmidt orthonormalization

Any basis can be turned into an orthonormal one. Given independent {v1,,vn}\{v_1,\dots,v_n\}, define

uk=vkj<kej,vkej,ek=ukuk. u_k = v_k - \sum_{j<k} \langle e_j, v_k\rangle\, e_j, \qquad e_k = \frac{u_k}{\|u_k\|}.

Each step subtracts off the components already accounted for, leaving a vector orthogonal to the previous eje_j, then normalizes. The result {e1,,en}\{e_1,\dots,e_n\} is an ONB with the same span.


Worked Examples

Example 1 — Inner product, norm, and a probability

Let ψ=12(1,i)T|\psi\rangle = \tfrac{1}{\sqrt2}(1,\, i)^T and the measurement basis {0,1}\{|0\rangle, |1\rangle\}.

Norm: ψ,ψ=12(11+ii)=12(1+(i)(i))=12(1+1)=1.\langle\psi,\psi\rangle = \tfrac12(\overline{1}\cdot 1 + \overline{i}\cdot i) = \tfrac12(1 + (-i)(i)) = \tfrac12(1+1) = 1. So ψ|\psi\rangle is already normalized. The overlap with 1=(0,1)T|1\rangle = (0,1)^T is 1ψ=012+1i2=i2\langle 1|\psi\rangle = \overline{0}\cdot\tfrac{1}{\sqrt2} + \overline{1}\cdot\tfrac{i}{\sqrt2} = \tfrac{i}{\sqrt2}, so the probability of outcome "1" is 1ψ2=i22=12|\langle 1|\psi\rangle|^2 = \big|\tfrac{i}{\sqrt2}\big|^2 = \tfrac12. By Parseval the two outcome probabilities are 12,12\tfrac12,\tfrac12 and sum to 11. ✓

Example 2 — Gram–Schmidt in C2\mathbb{C}^2

Orthonormalize v1=(1,1)Tv_1 = (1, 1)^T, v2=(1,0)Tv_2 = (1, 0)^T.

e1=v1/v1=12(1,1)Te_1 = v_1/\|v_1\| = \tfrac{1}{\sqrt2}(1,1)^T. Then

u2=v2e1,v2e1,e1,v2=12(11+10)=12. u_2 = v_2 - \langle e_1, v_2\rangle e_1,\qquad \langle e_1, v_2\rangle = \tfrac{1}{\sqrt2}(\overline{1}\cdot 1 + \overline{1}\cdot 0) = \tfrac{1}{\sqrt2}.

u2=(1,0)T1212(1,1)T=(1,0)T12(1,1)T=(12,12)T.u_2 = (1,0)^T - \tfrac{1}{\sqrt2}\cdot\tfrac{1}{\sqrt2}(1,1)^T = (1,0)^T - \tfrac12(1,1)^T = (\tfrac12, -\tfrac12)^T. Norm u2=14+14=12\|u_2\| = \sqrt{\tfrac14+\tfrac14} = \tfrac{1}{\sqrt2}, so e2=12(1,1)Te_2 = \tfrac{1}{\sqrt2}(1,-1)^T. The ONB {12(1,1)T,12(1,1)T}\{\tfrac{1}{\sqrt2}(1,1)^T, \tfrac{1}{\sqrt2}(1,-1)^T\} is exactly {+,}\{|+\rangle, |-\rangle\}. Check: e1,e2=12(11)=0\langle e_1, e_2\rangle = \tfrac12(1 - 1) = 0. ✓


Hands-on (Python)

import numpy as np

def inner(u, v):
    """⟨u, v⟩ with our convention: conjugate-linear in u, linear in v."""
    return np.vdot(u, v)            # vdot conjugates its FIRST argument — exactly right

def norm(v):
    return np.sqrt(np.real(inner(v, v)))   # ⟨v,v⟩ is real & ≥ 0; drop tiny imaginary noise

def normalize(v):
    return v / norm(v)

psi = normalize(np.array([1, 1j], dtype=complex))
print(norm(psi))                                   # 1.0
ket1 = np.array([0, 1], dtype=complex)
print(abs(inner(ket1, psi))**2)                    # 0.4999... = Born probability of outcome "1"
def gram_schmidt(vectors):
    """Return an orthonormal basis spanning the same space (modified Gram–Schmidt)."""
    basis = []
    for v in vectors:
        w = v.astype(complex).copy()
        for e in basis:
            w = w - inner(e, v) * e               # subtract projections onto earlier vectors
        n = norm(w)
        if n > 1e-12:                              # skip vectors that are (numerically) dependent
            basis.append(w / n)
    return basis

E = gram_schmidt([np.array([1, 1]), np.array([1, 0])])
for e in E:
    print(np.round(e, 3))
# [0.707+0.j 0.707+0.j]   -> |+>
# [ 0.707+0.j -0.707+0.j] -> |->

# Verify orthonormality: the Gram matrix G[i,j] = ⟨e_i, e_j⟩ should be the identity.
G = np.array([[inner(a, b) for b in E] for a in E])
print(np.allclose(G, np.eye(len(E))))              # True
# Expansion in an ONB via projection (no linear solve needed):
v = np.array([2, 3j], dtype=complex)
coords = [inner(e, v) for e in E]                  # ⟨e_k, v⟩
recon = sum(c * e for c, e in zip(coords, E))
print(np.allclose(recon, v))                       # True
print(np.isclose(norm(v)**2, sum(abs(c)**2 for c in coords)))  # Parseval: True

Exercises

E1 (easy). Compute u,v\langle u, v\rangle, u\|u\|, and v\|v\| for u=(1,i)Tu = (1, i)^T, v=(2,i)Tv = (2, -i)^T, and verify Cauchy–Schwarz numerically.

Solution

u,v=12+i(i)=2+(i)(i)=2+i2=21=1\langle u,v\rangle = \overline{1}\cdot 2 + \overline{i}\cdot(-i) = 2 + (-i)(-i) = 2 + i^2 = 2 - 1 = 1. u=1+1=2\|u\| = \sqrt{1+1} = \sqrt2, v=4+1=5\|v\| = \sqrt{4+1} = \sqrt5. Then $|\langle u,v\rangle| = 1 \le \sqrt{10} = |u||v|$. ✓

E2 (easy). Show +=12(1,1)T|+\rangle = \tfrac1{\sqrt2}(1,1)^T and =12(1,1)T|-\rangle = \tfrac1{\sqrt2}(1,-1)^T form an ONB, and expand 0=(1,0)T|0\rangle = (1,0)^T in it.

Solution

+=12(11+1(1))=0\langle +|-\rangle = \tfrac12(1\cdot1 + 1\cdot(-1)) = 0 and both have norm 11, so they're an ONB. Coordinates: +0=12\langle +|0\rangle = \tfrac1{\sqrt2}, 0=12\langle -|0\rangle = \tfrac1{\sqrt2}. Hence 0=12++12|0\rangle = \tfrac1{\sqrt2}|+\rangle + \tfrac1{\sqrt2}|-\rangle. (Born check: each outcome probability is 12\tfrac12, summing to 1.)

E3 (medium). Prove the parallelogram law u+v2+uv2=2u2+2v2\|u+v\|^2 + \|u-v\|^2 = 2\|u\|^2 + 2\|v\|^2 from the inner-product axioms.

Solution

Expand both: u±v2=u2±2Reu,v+v2\|u\pm v\|^2 = \|u\|^2 \pm 2\,\mathrm{Re}\langle u,v\rangle + \|v\|^2. Adding the ++ and - versions cancels the cross terms, leaving 2u2+2v22\|u\|^2 + 2\|v\|^2. ∎

E4 (medium). When does equality u,v=uv|\langle u,v\rangle| = \|u\|\|v\| hold? Prove your claim and give the physical meaning for normalized quantum states.

Solution

Equality iff uλv=0u - \lambda v = 0 for the λ\lambda in the Cauchy–Schwarz proof, i.e. u,vu,v are linearly dependent (u=λvu = \lambda v). For normalized states ψϕ=1|\langle\psi|\phi\rangle| = 1 means $|\psi\rangle = e^{i\theta}|\phi\rangle$ — they are the same physical state up to global phase and are indistinguishable by any measurement.

E5 (hard). Let {ek}\{e_k\} be an ONB and define the Gram matrix of vectors {vi}\{v_i\} by Gij=vi,vjG_{ij} = \langle v_i, v_j\rangle. Prove {vi}\{v_i\} is linearly independent iff GG is invertible.

Solution

Suppose icivi=0\sum_i c_i v_i = 0 for some coefficients c=(ci)c=(c_i). Take vj,\langle v_j, \cdot\rangle of both sides: ivj,vici=0\sum_i \langle v_j, v_i\rangle c_i = 0 for all jj, i.e. GG^\top... more carefully, with our convention vj,icivi=iciGji=(Gc)j=0\langle v_j, \sum_i c_i v_i\rangle = \sum_i c_i G_{ji} = (Gc)_j = 0, so Gc=0Gc = 0. If GG is invertible the only solution is c=0c=0 ⇒ independence. Conversely if the viv_i are dependent, a nonzero cc gives civi=0\sum c_i v_i = 0, hence Gc=0Gc = 0 with c0c \neq 0, so GG is singular. ∎ (This is exactly the matrix_rank independence test, recast through the inner product.)


Checkpoint

  1. Why must a complex inner product conjugate one argument? What goes wrong otherwise?
  2. State Cauchy–Schwarz and its equality condition; what does equality mean for quantum states?
  3. What does it mean physically for two states to be orthogonal?
  4. Why is expanding a vector in an orthonormal basis easier than in a general basis?
  5. State Parseval's identity and connect it to the Born rule summing to 11.
Answers
  1. Without conjugation v,v\langle v,v\rangle could be negative/complex (e.g. v=(i,0)v=(i,0) gives 1-1), so it couldn't define a length or a probability. Conjugating gives vk20\sum|v_k|^2 \ge 0.
  2. u,vuv|\langle u,v\rangle| \le \|u\|\|v\|, equality iff u,vu,v dependent; for normalized states equality means equal up to global phase — physically identical, indistinguishable.
  3. Orthogonal states are perfectly distinguishable: a measurement can tell them apart with certainty.
  4. Coordinates are projections ek,v\langle e_k, v\rangle — no linear system to solve — and Parseval gives the norm instantly.
  5. v2=kek,v2\|v\|^2 = \sum_k |\langle e_k,v\rangle|^2. For a normalized state the right side is the sum of Born probabilities, which equals v2=1\|v\|^2 = 1.

Further Reading

  • [Axl] Axler, Linear Algebra Done Right, Ch. 6 — inner product spaces, Gram–Schmidt (note: linear in the first argument there).
  • [NC] Nielsen & Chuang, §2.1.4 — inner products, Gram–Schmidt, our conjugate convention.
  • [Pre] Preskill, Ph219, Ch. 2 — Hilbert spaces.

← Prev: Complex Vector Spaces · Up: Term 0 · Next: Dirac Notation

Ready to measure your state?

5 exercises · 10 checkpoint questions

Start the quiz