QuantumCore

Lesson 3 · 60 min · core

Inner Products, Norms & Gram–Schmidt

Loading progress…

The inner product ⟨u∣v⟩=∑iui‾vi\langle u\vert v\rangle=\sum_i\overline{u_i}v_i on Cn\mathbb{C}^n (antilinear in the first slot), norms and normalisation, full proofs of Cauchy–Schwarz, the triangle inequality and Pythagoras, orthonormal bases with Parseval's identity, and the Gram–Schmidt procedure with worked C2\mathbb{C}^2 and C3\mathbb{C}^3 examples.

Prerequisites: Complex Vector Spaces $\mathbb{C}^n$

Objectives and key results
  • Compute ⟨u∣v⟩\langle u\vert v\rangle on Cn\mathbb{C}^n, conjugating the entries of the first argument.

  • Compute norms and normalise vectors so that ∥v∥=1\lVert v\rVert=1.

  • Prove and apply the Cauchy–Schwarz inequality ∣⟨u∣v⟩∣≤∥u∥ ∥v∥\lvert\langle u\vert v\rangle\rvert\le\lVert u\rVert\,\lVert v\rVert and the triangle inequality.

  • Orthonormalise a list of vectors with the Gram–Schmidt procedure and expand vectors in an orthonormal basis using ci=⟨ei∣v⟩c_i=\langle e_i\vert v\rangle.

definition · Standard inner product on C^n
⟨u∣v⟩=∑i=1nui‾ vi,∥v∥=⟨v∣v⟩\langle u\vert v\rangle=\sum_{i=1}^{n}\overline{u_i}\,v_i,\qquad \lVert v\rVert=\sqrt{\langle v\vert v\rangle}
theorem · Cauchy–Schwarz inequality
∣⟨u∣v⟩∣≤∥u∥ ∥v∥\lvert\langle u\vert v\rangle\rvert\le\lVert u\rVert\,\lVert v\rVert
theorem · Triangle inequality
∥u+v∥≤∥u∥+∥v∥\lVert u+v\rVert\le\lVert u\rVert+\lVert v\rVert
algorithm · Gram–Schmidt
ek=vk−∑j<k⟨ej∣vk⟩ ej∥vk−∑j<k⟨ej∣vk⟩ ej∥e_k=\frac{v_k-\sum_{j<k}\langle e_j\vert v_k\rangle\,e_j}{\bigl\lVert v_k-\sum_{j<k}\langle e_j\vert v_k\rangle\,e_j\bigr\rVert}
identity · Parseval
∥v∥2=∑i∣⟨ei∣v⟩∣2\lVert v\rVert^2=\sum_{i}\lvert\langle e_i\vert v\rangle\rvert^2

The inner product on $\mathbb{C}^n$#

A vector space tells us how to add and scale states; an inner product adds geometry: lengths, angles and, above all, overlaps. In quantum mechanics the overlap ⟨ϕ∣ψ⟩\langle\phi\vert\psi\rangle between two states is the amplitude for finding a system prepared in ∣ψ⟩\lvert\psi\rangle in the state ∣ϕ⟩\lvert\phi\rangle, and its modulus squared is a probability. Getting the inner product exactly right, including where the complex conjugate goes, is therefore not a matter of taste.

On Rn\mathbb{R}^n the dot product u⋅v=∑iuiviu\cdot v=\sum_iu_iv_i gives v⋅v=∑ivi2≥0v\cdot v=\sum_iv_i^2\ge0. On Cn\mathbb{C}^n the naive formula fails: for v=(1,i)Tv=(1,i)^T we would get 12+i2=01^2+i^2=0 for a nonzero vector. The fix is to conjugate one argument, because zˉz=∣z∣2≥0\bar z z=\lvert z\rvert^2\ge0.

Definition

Standard inner product and norm

For u,v∈Cnu,v\in\mathbb{C}^n the inner product is ⟨u∣v⟩=∑i=1nui‾ vi=u†v\langle u\vert v\rangle=\sum_{i=1}^n\overline{u_i}\,v_i=u^\dagger v, where u†=uˉTu^\dagger=\bar u^{T} is the conjugate transpose (a row vector). The norm is ∥v∥=⟨v∣v⟩=∑i∣vi∣2\lVert v\rVert=\sqrt{\langle v\vert v\rangle}=\sqrt{\sum_i\lvert v_i\rvert^2}. A vector with ∥v∥=1\lVert v\rVert=1 is a unit vector (normalised); two vectors with ⟨u∣v⟩=0\langle u\vert v\rangle=0 are orthogonal.

Proposition

The inner-product axioms hold on Cn\mathbb{C}^n

For all u,v,w∈Cnu,v,w\in\mathbb{C}^n and a,b∈Ca,b\in\mathbb{C}: (i) conjugate symmetry ⟨u∣v⟩=⟨v∣u⟩‾\langle u\vert v\rangle=\overline{\langle v\vert u\rangle}; (ii) linearity in the second slot ⟨u∣av+bw⟩=a⟨u∣v⟩+b⟨u∣w⟩\langle u\vert av+bw\rangle=a\langle u\vert v\rangle+b\langle u\vert w\rangle; (iii) positive-definiteness ⟨v∣v⟩≥0\langle v\vert v\rangle\ge0 with equality only for v=0v=0. Consequently the first slot is antilinear: ⟨au+bw∣v⟩=aˉ⟨u∣v⟩+bˉ⟨w∣v⟩\langle au+bw\vert v\rangle=\bar a\langle u\vert v\rangle+\bar b\langle w\vert v\rangle.

Proof (7 steps)
  1. Step 1:
    ⟨v∣u⟩‾=∑ivi‾ ui‾=∑ivi ui‾=∑iui‾ vi=⟨u∣v⟩\overline{\langle v\vert u\rangle}=\overline{\sum_i\overline{v_i}\,u_i}=\sum_i v_i\,\overline{u_i}=\sum_i\overline{u_i}\,v_i=\langle u\vert v\rangle
    (i) Conjugation respects sums and products, zˉˉ=z\bar{\bar z}=z, and multiplication commutes.
  2. Step 2:
    ⟨u∣av+bw⟩=∑iui‾(avi+bwi)=a∑iui‾vi+b∑iui‾wi\langle u\vert av+bw\rangle=\sum_i\overline{u_i}(av_i+bw_i)=a\sum_i\overline{u_i}v_i+b\sum_i\overline{u_i}w_i
    (ii) Distribute inside each term and pull the constants a,ba,b out of the sums.
  3. Step 3:
    =a⟨u∣v⟩+b⟨u∣w⟩=a\langle u\vert v\rangle+b\langle u\vert w\rangle
    Recognise the two sums as inner products.
  4. Step 4:
    ⟨v∣v⟩=∑ivi‾vi=∑i∣vi∣2≥0\langle v\vert v\rangle=\sum_i\overline{v_i}v_i=\sum_i\lvert v_i\rvert^2\ge0
    (iii) Each term is a modulus squared, a non-negative real number.
  5. Step 5:
    ∑i∣vi∣2=0  ⟺  vi=0 ∀i  ⟺  v=0\sum_i\lvert v_i\rvert^2=0\iff v_i=0\ \forall i\iff v=0
    A sum of non-negative reals vanishes only when every term does, and ∣z∣=0\lvert z\rvert=0 only for z=0z=0.
  6. Step 6:
    ⟨au+bw∣v⟩=⟨v∣au+bw⟩‾=a⟨v∣u⟩+b⟨v∣w⟩‾\langle au+bw\vert v\rangle=\overline{\langle v\vert au+bw\rangle}=\overline{a\langle v\vert u\rangle+b\langle v\vert w\rangle}
    Antilinearity: flip the arguments with (i), then use (ii).
  7. Step 7:
    =aˉ ⟨v∣u⟩‾+bˉ ⟨v∣w⟩‾=aˉ⟨u∣v⟩+bˉ⟨w∣v⟩=\bar a\,\overline{\langle v\vert u\rangle}+\bar b\,\overline{\langle v\vert w\rangle}=\bar a\langle u\vert v\rangle+\bar b\langle w\vert v\rangle
    Conjugation respects sums and products; apply (i) once more.

∎

Worked example (an inner product). Let u=(1+i, 2−i)Tu=(1+i,\ 2-i)^T and v=(3, i)Tv=(3,\ i)^T. Conjugate the entries of uu first: u‾=(1−i, 2+i)\overline{u}=(1-i,\ 2+i). Then

⟨u∣v⟩=(1−i)⋅3+(2+i)⋅i=(3−3i)+(2i+i2)=3−3i+2i−1=2−i.\langle u\vert v\rangle=(1-i)\cdot3+(2+i)\cdot i=(3-3i)+(2i+i^2)=3-3i+2i-1=2-i .

Swapping the arguments conjugates the answer: ⟨v∣u⟩=3(1+i)+(−i)(2−i)=3+3i−2i+i2=2+i=2−i‾\langle v\vert u\rangle=3(1+i)+(-i)(2-i)=3+3i-2i+i^2=2+i=\overline{2-i}, as axiom (i) demands.

Worked example (normalisation). For w=(1+i, 2)Tw=(1+i,\ 2)^T, ∥w∥2=∣1+i∣2+∣2∣2=2+4=6\lVert w\rVert^2=\lvert1+i\rvert^2+\lvert2\rvert^2=2+4=6, so the normalised vector is w^=w/∥w∥=16(1+i, 2)T\hat w=w/\lVert w\rVert=\tfrac{1}{\sqrt6}(1+i,\ 2)^T. As a qubit state this is 1+i6∣0⟩+26∣1⟩\tfrac{1+i}{\sqrt6}\lvert0\rangle+\tfrac{2}{\sqrt6}\lvert1\rangle, with outcome probabilities 26=13\tfrac26=\tfrac13 and 46=23\tfrac46=\tfrac23. Note also ⟨(1,i)T∣(i,1)T⟩=1⋅i+(−i)⋅1=0\langle(1,i)^T\vert(i,1)^T\rangle=1\cdot i+(-i)\cdot1=0: these two vectors are orthogonal although neither has a zero entry.

Cauchy–Schwarz, the triangle inequality and Pythagoras#

The Cauchy–Schwarz inequality is the most useful inequality in quantum information. It says that an overlap can never exceed the product of the lengths, and it is the reason that the fidelity ∣⟨ψ∣ϕ⟩∣2\lvert\langle\psi\vert\phi\rangle\rvert^2 between two unit vectors is a number between 00 and 11. The proof below projects uu onto vv, removes that component, and observes that what is left has non-negative squared length.

Theorem

Cauchy–Schwarz inequality

For all u,v∈Cnu,v\in\mathbb{C}^n: ∣⟨u∣v⟩∣≤∥u∥ ∥v∥\lvert\langle u\vert v\rangle\rvert\le\lVert u\rVert\,\lVert v\rVert, with equality if and only if uu and vv are linearly dependent (one is a complex multiple of the other).

Proof (9 steps)
  1. Step 1:
    v=0:∣⟨u∣0⟩∣=0=∥u∥⋅0v=0:\quad \lvert\langle u\vert 0\rangle\rvert=0=\lVert u\rVert\cdot0
    If v=0v=0 both sides vanish (linearity in the second slot gives ⟨u∣0⟩=0\langle u\vert0\rangle=0) and u,0u,0 are dependent, so assume v≠0v\ne0 from now on.
  2. Step 2:
    λ:=⟨v∣u⟩∥v∥2,w:=u−λv\lambda:=\frac{\langle v\vert u\rangle}{\lVert v\rVert^2},\qquad w:=u-\lambda v
    Define the component of uu along vv and the remainder ww; ∥v∥2>0\lVert v\rVert^2>0 by positive-definiteness.
  3. Step 3:
    ⟨v∣w⟩=⟨v∣u⟩−λ⟨v∣v⟩=⟨v∣u⟩−⟨v∣u⟩∥v∥2∥v∥2=0\langle v\vert w\rangle=\langle v\vert u\rangle-\lambda\langle v\vert v\rangle=\langle v\vert u\rangle-\frac{\langle v\vert u\rangle}{\lVert v\rVert^2}\lVert v\rVert^2=0
    Linearity in the second slot; the remainder is orthogonal to vv. Taking conjugates, ⟨w∣v⟩=0\langle w\vert v\rangle=0 too.
  4. Step 4:
    ∥u∥2=⟨w+λv∣w+λv⟩=⟨w∣w⟩+λ⟨w∣v⟩+λˉ⟨v∣w⟩+λˉλ⟨v∣v⟩\lVert u\rVert^2=\langle w+\lambda v\vert w+\lambda v\rangle=\langle w\vert w\rangle+\lambda\langle w\vert v\rangle+\bar\lambda\langle v\vert w\rangle+\bar\lambda\lambda\langle v\vert v\rangle
    Write u=w+λvu=w+\lambda v and expand: linear in the second slot, antilinear in the first.
  5. Step 5:
    =∥w∥2+∣λ∣2∥v∥2=∥w∥2+∣⟨v∣u⟩∣2∥v∥2=\lVert w\rVert^2+\lvert\lambda\rvert^2\lVert v\rVert^2=\lVert w\rVert^2+\frac{\lvert\langle v\vert u\rangle\rvert^2}{\lVert v\rVert^2}
    The cross terms vanish by orthogonality; substitute ∣λ∣2=∣⟨v∣u⟩∣2/∥v∥4\lvert\lambda\rvert^2=\lvert\langle v\vert u\rangle\rvert^2/\lVert v\rVert^4.
  6. Step 6:
    0≤∥w∥2=∥u∥2−∣⟨v∣u⟩∣2∥v∥20\le\lVert w\rVert^2=\lVert u\rVert^2-\frac{\lvert\langle v\vert u\rangle\rvert^2}{\lVert v\rVert^2}
    Rearrange; a squared norm is non-negative.
  7. Step 7:
    ∣⟨u∣v⟩∣2=∣⟨v∣u⟩∣2≤∥u∥2∥v∥2\lvert\langle u\vert v\rangle\rvert^2=\lvert\langle v\vert u\rangle\rvert^2\le\lVert u\rVert^2\lVert v\rVert^2
    Multiply by ∥v∥2>0\lVert v\rVert^2>0; conjugate symmetry gives ∣⟨u∣v⟩∣=∣⟨v∣u⟩‾∣=∣⟨v∣u⟩∣\lvert\langle u\vert v\rangle\rvert=\lvert\overline{\langle v\vert u\rangle}\rvert=\lvert\langle v\vert u\rangle\rvert.
  8. Step 8:
    ∣⟨u∣v⟩∣≤∥u∥ ∥v∥\lvert\langle u\vert v\rangle\rvert\le\lVert u\rVert\,\lVert v\rVert
    Both sides are non-negative, so take square roots.
  9. Step 9:
    equality  ⟺  ∥w∥=0  ⟺  u=λv\text{equality}\iff\lVert w\rVert=0\iff u=\lambda v
    Equality holds exactly when the discarded term ∥w∥2\lVert w\rVert^2 is zero, i.e. when uu is a multiple of vv; conversely if u=μvu=\mu v then ∣⟨u∣v⟩∣=∣μ∣∥v∥2=∥u∥∥v∥\lvert\langle u\vert v\rangle\rvert=\lvert\mu\rvert\lVert v\rVert^2=\lVert u\rVert\lVert v\rVert.

∎

Numerical check. With u=(1+i, 2−i)Tu=(1+i,\ 2-i)^T, v=(3, i)Tv=(3,\ i)^T from above: ∣⟨u∣v⟩∣=∣2−i∣=5≈2.236\lvert\langle u\vert v\rangle\rvert=\lvert2-i\rvert=\sqrt5\approx2.236, while ∥u∥2=2+5=7\lVert u\rVert^2=2+5=7 and ∥v∥2=9+1=10\lVert v\rVert^2=9+1=10, so ∥u∥∥v∥=70≈8.367\lVert u\rVert\lVert v\rVert=\sqrt{70}\approx8.367. The inequality holds with plenty of room, as it should for vectors that are far from parallel.

Corollary

Triangle inequality

For all u,v∈Cnu,v\in\mathbb{C}^n: ∥u+v∥≤∥u∥+∥v∥\lVert u+v\rVert\le\lVert u\rVert+\lVert v\rVert.

Proof (5 steps)
  1. Step 1:
    ∥u+v∥2=⟨u+v∣u+v⟩=⟨u∣u⟩+⟨u∣v⟩+⟨v∣u⟩+⟨v∣v⟩\lVert u+v\rVert^2=\langle u+v\vert u+v\rangle=\langle u\vert u\rangle+\langle u\vert v\rangle+\langle v\vert u\rangle+\langle v\vert v\rangle
    Expand using linearity in the second slot and antilinearity in the first (all coefficients are 11).
  2. Step 2:
    =∥u∥2+⟨u∣v⟩+⟨u∣v⟩‾+∥v∥2=∥u∥2+2 Re⟨u∣v⟩+∥v∥2=\lVert u\rVert^2+\langle u\vert v\rangle+\overline{\langle u\vert v\rangle}+\lVert v\rVert^2=\lVert u\rVert^2+2\,\mathrm{Re}\langle u\vert v\rangle+\lVert v\rVert^2
    Conjugate symmetry, and z+zˉ=2 Re zz+\bar z=2\,\mathrm{Re}\,z.
  3. Step 3:
    ≤∥u∥2+2∣⟨u∣v⟩∣+∥v∥2\le\lVert u\rVert^2+2\lvert\langle u\vert v\rangle\rvert+\lVert v\rVert^2
    Re z≤∣z∣\mathrm{Re}\,z\le\lvert z\rvert for every complex zz, since ∣z∣2=(Re z)2+(Im z)2\lvert z\rvert^2=(\mathrm{Re}\,z)^2+(\mathrm{Im}\,z)^2.
  4. Step 4:
    ≤∥u∥2+2∥u∥∥v∥+∥v∥2=(∥u∥+∥v∥)2\le\lVert u\rVert^2+2\lVert u\rVert\lVert v\rVert+\lVert v\rVert^2=\bigl(\lVert u\rVert+\lVert v\rVert\bigr)^2
    Cauchy–Schwarz, then recognise a perfect square.
  5. Step 5:
    ∥u+v∥≤∥u∥+∥v∥\lVert u+v\rVert\le\lVert u\rVert+\lVert v\rVert
    Take non-negative square roots.

∎

Corollary

Pythagorean theorem

If ⟨u∣v⟩=0\langle u\vert v\rangle=0 then ∥u+v∥2=∥u∥2+∥v∥2\lVert u+v\rVert^2=\lVert u\rVert^2+\lVert v\rVert^2. More generally, for pairwise orthogonal v1,…,vkv_1,\dots,v_k: ∥∑ivi∥2=∑i∥vi∥2\lVert\sum_iv_i\rVert^2=\sum_i\lVert v_i\rVert^2.

Proof (3 steps)
  1. Step 1:
    ∥u+v∥2=∥u∥2+2 Re⟨u∣v⟩+∥v∥2\lVert u+v\rVert^2=\lVert u\rVert^2+2\,\mathrm{Re}\langle u\vert v\rangle+\lVert v\rVert^2
    First two lines of the triangle-inequality proof.
  2. Step 2:
    =∥u∥2+2 Re(0)+∥v∥2=∥u∥2+∥v∥2=\lVert u\rVert^2+2\,\mathrm{Re}(0)+\lVert v\rVert^2=\lVert u\rVert^2+\lVert v\rVert^2
    Orthogonality kills the cross term.
  3. Step 3:
    ∥∑i=1kvi∥2=∑i,j⟨vi∣vj⟩=∑i⟨vi∣vi⟩=∑i∥vi∥2\Bigl\lVert\sum_{i=1}^{k}v_i\Bigr\rVert^2=\sum_{i,j}\langle v_i\vert v_j\rangle=\sum_{i}\langle v_i\vert v_i\rangle=\sum_i\lVert v_i\rVert^2
    Expand the double sum; all terms with i≠ji\ne j vanish by pairwise orthogonality.

∎

Orthonormal bases and Parseval#

Definition

Orthonormal basis

A list e1,…,ene_1,\dots,e_n is orthonormal if ⟨ei∣ej⟩=δij\langle e_i\vert e_j\rangle=\delta_{ij} (Kronecker delta: 11 if i=ji=j, 00 otherwise). An orthonormal list is automatically linearly independent: if ∑jcjej=0\sum_jc_je_j=0, taking the inner product with eie_i gives ci=0c_i=0. An orthonormal list of length n=dim⁡Vn=\dim V is therefore an orthonormal basis. The computational basis ∣0⟩,∣1⟩\lvert0\rangle,\lvert1\rangle and the basis ∣+⟩,∣−⟩\lvert+\rangle,\lvert-\rangle are both orthonormal bases of C2\mathbb{C}^2.

Theorem

Coefficients and Parseval’s identity

If e1,…,ene_1,\dots,e_n is an orthonormal basis, then every vv satisfies v=∑i⟨ei∣v⟩ eiv=\sum_i\langle e_i\vert v\rangle\,e_i and ∥v∥2=∑i∣⟨ei∣v⟩∣2\lVert v\rVert^2=\sum_i\lvert\langle e_i\vert v\rangle\rvert^2.

Proof (4 steps)
  1. Step 1:
    v=∑j=1ncj ejv=\sum_{j=1}^{n}c_j\,e_j
    Expand vv in the basis (coordinates exist and are unique).
  2. Step 2:
    ⟨ei∣v⟩=∑j=1ncj⟨ei∣ej⟩=∑j=1ncj δij=ci\langle e_i\vert v\rangle=\sum_{j=1}^{n}c_j\langle e_i\vert e_j\rangle=\sum_{j=1}^{n}c_j\,\delta_{ij}=c_i
    Take the inner product with eie_i, use linearity in the second slot and orthonormality.
  3. Step 3:
    ⇒ v=∑i=1n⟨ei∣v⟩ ei\Rightarrow\ v=\sum_{i=1}^{n}\langle e_i\vert v\rangle\,e_i
    Substitute ci=⟨ei∣v⟩c_i=\langle e_i\vert v\rangle back into the expansion.
  4. Step 4:
    ∥v∥2=∑i=1n∥ciei∥2=∑i=1n∣ci∣2∥ei∥2=∑i=1n∣⟨ei∣v⟩∣2\lVert v\rVert^2=\sum_{i=1}^{n}\lVert c_ie_i\rVert^2=\sum_{i=1}^{n}\lvert c_i\rvert^2\lVert e_i\rVert^2=\sum_{i=1}^{n}\lvert\langle e_i\vert v\rangle\rvert^2
    The vectors cieic_ie_i are pairwise orthogonal, so Pythagoras applies; ∥ce∥=∣c∣∥e∥\lVert ce\rVert=\lvert c\rvert\lVert e\rVert and ∥ei∥=1\lVert e_i\rVert=1.

∎

Worked example. Using the ±\pm basis, the coefficients of v=(3+i, 1−i)Tv=(3+i,\,1-i)^T from the previous lesson are c+=22c_+=2\sqrt2 and c−=2(1+i)c_-=\sqrt2(1+i). Parseval predicts ∥v∥2=∣c+∣2+∣c−∣2=8+2⋅2=12\lVert v\rVert^2=\lvert c_+\rvert^2+\lvert c_-\rvert^2=8+2\cdot2=12, and directly ∥v∥2=∣3+i∣2+∣1−i∣2=10+2=12\lVert v\rVert^2=\lvert3+i\rvert^2+\lvert1-i\rvert^2=10+2=12. The coefficients were computed as inner products, c±=⟨±∣v⟩c_\pm=\langle\pm\vert v\rangle, which is much faster than inverting a change-of-basis matrix; this shortcut works precisely because the basis is orthonormal.

The Gram–Schmidt procedure#

Orthonormal bases are so convenient that we want to be able to manufacture one from any linearly independent list. The Gram–Schmidt procedure does this one vector at a time: take the next vector, subtract its components along the directions already built, and normalise what remains. The order of the input vectors matters, and with our convention the projection coefficient is ⟨ej∣vk⟩\langle e_j\vert v_k\rangle with the already-built vector eje_j conjugated.

Theorem

Gram–Schmidt orthonormalisation

Let v1,…,vmv_1,\dots,v_m be linearly independent. Define recursively uk=vk−∑j<k⟨ej∣vk⟩eju_k=v_k-\sum_{j<k}\langle e_j\vert v_k\rangle e_j and ek=uk/∥uk∥e_k=u_k/\lVert u_k\rVert. Then for every kk: uk≠0u_k\ne0, the list e1,…,eke_1,\dots,e_k is orthonormal, and span⁡{e1,…,ek}=span⁡{v1,…,vk}\operatorname{span}\{e_1,\dots,e_k\}=\operatorname{span}\{v_1,\dots,v_k\}.

Proof (8 steps)
  1. Step 1:
    k=1: u1=v1≠0,  e1=v1∥v1∥,  ∥e1∥=1,  span⁡{e1}=span⁡{v1}k=1:\ u_1=v_1\ne0,\ \ e_1=\frac{v_1}{\lVert v_1\rVert},\ \ \lVert e_1\rVert=1,\ \ \operatorname{span}\{e_1\}=\operatorname{span}\{v_1\}
    Base case: an independent list contains no zero vector, and a nonzero multiple spans the same line.
  2. Step 2:
    assume: e1,…,ek−1 orthonormal,  span⁡{ej}j<k=span⁡{vj}j<k\text{assume: } e_1,\dots,e_{k-1}\ \text{orthonormal},\ \ \operatorname{span}\{e_j\}_{j<k}=\operatorname{span}\{v_j\}_{j<k}
    Induction hypothesis for k−1k-1.
  3. Step 3:
    uk=0 ⇒ vk=∑j<k⟨ej∣vk⟩ej∈span⁡{v1,…,vk−1}u_k=0\ \Rightarrow\ v_k=\sum_{j<k}\langle e_j\vert v_k\rangle e_j\in\operatorname{span}\{v_1,\dots,v_{k-1}\}
    If the remainder vanished, vkv_k would be a combination of earlier eje_j, hence (hypothesis) of earlier vjv_j, contradicting independence. So uk≠0u_k\ne0 and eke_k is well defined with ∥ek∥=1\lVert e_k\rVert=1.
  4. Step 4:
    ⟨ei∣uk⟩=⟨ei∣vk⟩−∑j<k⟨ej∣vk⟩⟨ei∣ej⟩(i<k)\langle e_i\vert u_k\rangle=\langle e_i\vert v_k\rangle-\sum_{j<k}\langle e_j\vert v_k\rangle\langle e_i\vert e_j\rangle\qquad(i<k)
    Take the inner product of uku_k with an earlier eie_i; linearity in the second slot.
  5. Step 5:
    =⟨ei∣vk⟩−∑j<k⟨ej∣vk⟩ δij=⟨ei∣vk⟩−⟨ei∣vk⟩=0=\langle e_i\vert v_k\rangle-\sum_{j<k}\langle e_j\vert v_k\rangle\,\delta_{ij}=\langle e_i\vert v_k\rangle-\langle e_i\vert v_k\rangle=0
    Orthonormality of e1,…,ek−1e_1,\dots,e_{k-1} leaves only the j=ij=i term.
  6. Step 6:
    ⟨ei∣ek⟩=⟨ei∣uk⟩∥uk∥=0(i<k)\langle e_i\vert e_k\rangle=\frac{\langle e_i\vert u_k\rangle}{\lVert u_k\rVert}=0\quad(i<k)
    Scaling by the positive real 1/∥uk∥1/\lVert u_k\rVert; hence e1,…,eke_1,\dots,e_k is orthonormal.
  7. Step 7:
    ek=1∥uk∥(vk−∑j<k⟨ej∣vk⟩ej)∈span⁡{v1,…,vk}e_k=\frac{1}{\lVert u_k\rVert}\Bigl(v_k-\sum_{j<k}\langle e_j\vert v_k\rangle e_j\Bigr)\in\operatorname{span}\{v_1,\dots,v_k\}
    Each eje_j with j<kj<k lies in span⁡{v1,…,vk−1}\operatorname{span}\{v_1,\dots,v_{k-1}\} by hypothesis, so span⁡{e1..ek}⊆span⁡{v1..vk}\operatorname{span}\{e_1..e_k\}\subseteq\operatorname{span}\{v_1..v_k\}.
  8. Step 8:
    vk=∥uk∥ ek+∑j<k⟨ej∣vk⟩ej∈span⁡{e1,…,ek}v_k=\lVert u_k\rVert\,e_k+\sum_{j<k}\langle e_j\vert v_k\rangle e_j\in\operatorname{span}\{e_1,\dots,e_k\}
    Solve the definition of uku_k for vkv_k; together with the hypothesis this gives the reverse inclusion, so the spans are equal. Induction completes the proof.

∎

Derivation

Worked example in C2\mathbb{C}^2: v1=(1,i)Tv_1=(1,i)^T, v2=(1,0)Tv_2=(1,0)^T

  1. Step 1:
    ∥v1∥2=∣1∣2+∣i∣2=2 ⇒ e1=12(1i)\lVert v_1\rVert^2=\lvert1\rvert^2+\lvert i\rvert^2=2\ \Rightarrow\ e_1=\frac{1}{\sqrt2}\begin{pmatrix}1\\i\end{pmatrix}
    Normalise the first vector.
  2. Step 2:
    ⟨e1∣v2⟩=12(1ˉ⋅1+iˉ⋅0)=12\langle e_1\vert v_2\rangle=\frac{1}{\sqrt2}\bigl(\bar1\cdot1+\bar i\cdot0\bigr)=\frac{1}{\sqrt2}
    Projection coefficient; the entries of e1e_1 are conjugated (iˉ=−i\bar i=-i multiplies 00 here).
  3. Step 3:
    u2=(10)−12⋅12(1i)=(1−12−i2)=(12−i2)u_2=\begin{pmatrix}1\\0\end{pmatrix}-\frac{1}{\sqrt2}\cdot\frac{1}{\sqrt2}\begin{pmatrix}1\\i\end{pmatrix}=\begin{pmatrix}1-\tfrac12\\-\tfrac i2\end{pmatrix}=\begin{pmatrix}\tfrac12\\-\tfrac i2\end{pmatrix}
    Subtract the component along e1e_1.
  4. Step 4:
    ∥u2∥2=14+14=12 ⇒ e2=2(12−i2)=12(1−i)\lVert u_2\rVert^2=\tfrac14+\tfrac14=\tfrac12\ \Rightarrow\ e_2=\sqrt2\begin{pmatrix}\tfrac12\\-\tfrac i2\end{pmatrix}=\frac{1}{\sqrt2}\begin{pmatrix}1\\-i\end{pmatrix}
    ∣−i2∣2=14\lvert-\tfrac i2\rvert^2=\tfrac14; divide by ∥u2∥=12\lVert u_2\rVert=\tfrac1{\sqrt2}.
  5. Step 5:
    ⟨e1∣e2⟩=12(1ˉ⋅1+iˉ⋅(−i))=12(1+(−i)(−i))=12(1−1)=0 ✓\langle e_1\vert e_2\rangle=\tfrac12\bigl(\bar1\cdot1+\bar i\cdot(-i)\bigr)=\tfrac12\bigl(1+(-i)(-i)\bigr)=\tfrac12(1-1)=0\ \checkmark
    Verify orthogonality: (−i)(−i)=i2=−1(-i)(-i)=i^2=-1. The result is the circular basis ∣+i⟩,∣−i⟩\lvert{+i}\rangle,\lvert{-i}\rangle.
Derivation

Worked example in C3\mathbb{C}^3: v1=(1,1,0)Tv_1=(1,1,0)^T, v2=(0,i,1)Tv_2=(0,i,1)^T, v3=(1,0,0)Tv_3=(1,0,0)^T

  1. Step 1:
    e1=12(110)e_1=\frac{1}{\sqrt2}\begin{pmatrix}1\\1\\0\end{pmatrix}
    ∥v1∥2=1+1+0=2\lVert v_1\rVert^2=1+1+0=2.
  2. Step 2:
    ⟨e1∣v2⟩=12(1⋅0+1⋅i+0⋅1)=i2\langle e_1\vert v_2\rangle=\frac{1}{\sqrt2}(1\cdot0+1\cdot i+0\cdot1)=\frac{i}{\sqrt2}
    The entries of e1e_1 are real, so conjugation changes nothing here.
  3. Step 3:
    u2=(0i1)−i2⋅12(110)=(−i2i21)u_2=\begin{pmatrix}0\\i\\1\end{pmatrix}-\frac{i}{\sqrt2}\cdot\frac{1}{\sqrt2}\begin{pmatrix}1\\1\\0\end{pmatrix}=\begin{pmatrix}-\tfrac i2\\\tfrac i2\\1\end{pmatrix}
    Subtract i2(1,1,0)T\tfrac i2(1,1,0)^T.
  4. Step 4:
    ∥u2∥2=14+14+1=32 ⇒ e2=23(−i2i21)=16(−ii2)\lVert u_2\rVert^2=\tfrac14+\tfrac14+1=\tfrac32\ \Rightarrow\ e_2=\sqrt{\tfrac23}\begin{pmatrix}-\tfrac i2\\\tfrac i2\\1\end{pmatrix}=\frac{1}{\sqrt6}\begin{pmatrix}-i\\i\\2\end{pmatrix}
    2/3⋅12=16\sqrt{2/3}\cdot\tfrac12=\tfrac{1}{\sqrt6} and 2/3=26\sqrt{2/3}=\tfrac{2}{\sqrt6}.
  5. Step 5:
    ⟨e1∣v3⟩=12,⟨e2∣v3⟩=16 (−i)‾⋅1=i6\langle e_1\vert v_3\rangle=\frac{1}{\sqrt2},\qquad \langle e_2\vert v_3\rangle=\frac{1}{\sqrt6}\,\overline{(-i)}\cdot1=\frac{i}{\sqrt6}
    Only the first entry of v3v_3 is nonzero; conjugating −i-i gives ii.
  6. Step 6:
    u3=(100)−12(110)−i6(−ii2)=(1−12−16−12+16−i3)=(13−13−i3)u_3=\begin{pmatrix}1\\0\\0\end{pmatrix}-\frac12\begin{pmatrix}1\\1\\0\end{pmatrix}-\frac{i}{6}\begin{pmatrix}-i\\i\\2\end{pmatrix}=\begin{pmatrix}1-\tfrac12-\tfrac16\\-\tfrac12+\tfrac16\\-\tfrac{i}{3}\end{pmatrix}=\begin{pmatrix}\tfrac13\\-\tfrac13\\-\tfrac i3\end{pmatrix}
    i6⋅16=i6\tfrac{i}{\sqrt6}\cdot\tfrac{1}{\sqrt6}=\tfrac i6, and i6⋅(−i)=16\tfrac i6\cdot(-i)=\tfrac16, i6⋅i=−16\tfrac i6\cdot i=-\tfrac16, i6⋅2=i3\tfrac i6\cdot2=\tfrac i3.
  7. Step 7:
    ∥u3∥2=19+19+19=13 ⇒ e3=13(1−1−i)\lVert u_3\rVert^2=\tfrac19+\tfrac19+\tfrac19=\tfrac13\ \Rightarrow\ e_3=\frac{1}{\sqrt3}\begin{pmatrix}1\\-1\\-i\end{pmatrix}
    Divide by ∥u3∥=13\lVert u_3\rVert=\tfrac1{\sqrt3}, i.e. multiply by 3\sqrt3.
  8. Step 8:
    ⟨e1∣e3⟩=16(1−1+0)=0,⟨e2∣e3⟩=118(i⋅1+(−i)(−1)+2(−i))=0 ✓\langle e_1\vert e_3\rangle=\tfrac{1}{\sqrt6}(1-1+0)=0,\qquad \langle e_2\vert e_3\rangle=\tfrac{1}{\sqrt{18}}\bigl(i\cdot1+(-i)(-1)+2(-i)\bigr)=0\ \checkmark
    Conjugate the entries of e2e_2 to (i,−i,2)(i,-i,2); the three terms i+i−2ii+i-2i cancel.
( e1 ∣ e2 ∣ e3 )=(12−i61312i6−13026−i3)\bigl(\,e_1\ \big\vert\ e_2\ \big\vert\ e_3\,\bigr)=\begin{pmatrix}\tfrac{1}{\sqrt2}&-\tfrac{i}{\sqrt6}&\tfrac{1}{\sqrt3}\\[2pt]\tfrac{1}{\sqrt2}&\tfrac{i}{\sqrt6}&-\tfrac{1}{\sqrt3}\\[2pt]0&\tfrac{2}{\sqrt6}&-\tfrac{i}{\sqrt3}\end{pmatrix}
Gram–Schmidt output for the C^3 example: columns e1, e2, e3 form a unitary matrix3×3

Unitary verified: U†U=IU^\dagger U = I (max deviation 2.2e-16)

Check your understanding#

Quick check

Compute ∥(1+i, 2)T∥\lVert(1+i,\ 2)^T\rVert (decimal).

tolerance ±0.001

Quick check

For u=(1+i, 2−i)Tu=(1+i,\ 2-i)^T and v=(3, i)Tv=(3,\ i)^T, what is Re ⟨u∣v⟩\mathrm{Re}\,\langle u\vert v\rangle?

tolerance ±0.001

Quick check

With the physicists' convention, what is ⟨2i u∣v⟩\langle 2i\,u\vert v\rangle?

Select one answer

Quick check

For unit vectors u,vu,v with ∣⟨u∣v⟩∣=1\lvert\langle u\vert v\rangle\rvert=1, what can you conclude?

Select one answer

References

  1. M. A. Nielsen, I. L. Chuang, Quantum Computation and Quantum Information, 10th anniversary ed., Cambridge University Press (2010), §2.1.4 (inner products, orthonormal bases, Gram–Schmidt; Box 2.1 on the Cauchy–Schwarz inequality).
  2. S. Axler, Linear Algebra Done Right, 4th ed., Springer (2024), Ch. 6 §6A–6B (inner products, norms, Cauchy–Schwarz, orthonormal bases, Gram–Schmidt).linear.axler.net
  3. R. A. Horn, C. R. Johnson, Matrix Analysis, 2nd ed., Cambridge University Press (2013), §0.6 and §5.1 (inner products and norms).

Hands-on labs

  • Gram–Schmidt in C^3

    1 step · auto-graded

    Orthonormalise v1=(1,i,0)Tv_1=(1,i,0)^T and v2=(1,0,1)Tv_2=(1,0,1)^T with Gram–Schmidt, using the conjugate-linear inner product ⟨u∣v⟩=∑kuk‾vk\langle u\vert v\rangle=\sum_k\overline{u_k}v_k.

    Open lab