← Exercise library← All exercises for this theme
Theme 2 — Hilbert Spaces and Dirac Notation

Orthogonal projector onto a plane

Keywords: orthogonal projector · subspace · Gram--Schmidt · complementary projector · distance to a subspace · best approximation

Exercise 1 : Orthogonal projector onto a plane

In R3\R^3, viewed as a real subspace of C3\C^3 equipped with the usual inner product, consider the plane FF spanned by the vectors ∣a⟩=(1,−1,0)\ket a=(1,-1,0) and ∣b⟩=(1,0,−1)\ket b=(1,0,-1), together with the unit vector ∣n⟩=13(1,1,1)\ket n=\frac{1}{\sqrt3}(1,1,1).

Question 1
Construct an orthonormal basis (∣e1⟩,∣e2⟩)(\ket{e_1},\ket{e_2}) of FF, then find the matrix of the orthogonal projector P^=∣e1⟩⟨e1∣+∣e2⟩⟨e2∣\hat P=\ket{e_1}\bra{e_1}+\ket{e_2}\bra{e_2} onto FF.

Solution
The vectors ∣a⟩\ket a and ∣b⟩\ket b are not orthogonal, since ⟨a|b⟩=1\braket ab=1. We apply the Gram—Schmidt procedure. First, ∣e1⟩=12(1,−1,0)\ket{e_1}=\frac{1}{\sqrt2}(1,-1,0). Next, ⟨e1|b⟩=12\braket{e_1}{b}=\frac{1}{\sqrt2}, and

∣b⟩−⟨e1|b⟩∣e1⟩=(1,0,−1)−12(1,−1,0)=(12,12,−1),\ket b-\braket{e_1}{b}\ket{e_1}=(1,0,-1)-\tfrac12(1,-1,0)=\bigl(\tfrac12,\tfrac12,-1\bigr),

whose norm is 3/2\sqrt{3/2}, hence ∣e2⟩=16(1,1,−2)\ket{e_2}=\frac{1}{\sqrt6}(1,1,-2). The matrices of the two rank-one projectors are

∣e1⟩⟨e1∣=12(1−10−110000),∣e2⟩⟨e2∣=16(11−211−2−2−24),\begin{aligned} \ket{e_1}\bra{e_1}=\frac12\begin{pmatrix}1&-1&0\\-1&1&0\\0&0&0\end{pmatrix}, \qquad \ket{e_2}\bra{e_2}=\frac16\begin{pmatrix}1&1&-2\\1&1&-2\\-2&-2&4\end{pmatrix}, \end{aligned}

and their sum is

P=13(2−1−1−12−1−1−12).\begin{aligned} P=\frac13\begin{pmatrix}2&-1&-1\\-1&2&-1\\-1&-1&2\end{pmatrix}. \end{aligned}

Question 2
Verify that P2=PP^2=P, P†=PP^\dagger=P and tr⁡P=2\tr P=2. Calculate P∣n⟩P\ket n, and show that P=1−∣n⟩⟨n∣P=\mathbf{1}-\ket n\bra n. Interpret the result.

Solution
The matrix PP is real and symmetric, so P†=PP^\dagger=P. Its trace is 13(2+2+2)=2\frac13(2+2+2)=2, the dimension of FF. For the square, for example, we calculate the first entry: 19(2⋅2+(−1)(−1)+(−1)(−1))=69=23\frac19\bigl(2\cdot2+(-1)(-1)+(-1)(-1)\bigr)=\frac69=\frac23, and the second: 19(2⋅(−1)+(−1)⋅2+(−1)(−1))=−39=−13\frac19\bigl(2\cdot(-1)+(-1)\cdot2+(-1)(-1)\bigr)=-\frac39=-\frac13; the other entries follow by symmetry, and P2=PP^2=P. This may also be obtained without calculation, from ⟨ei|ej⟩=δij\braket{e_i}{e_j}=\delta_{ij}.

The vectors ∣a⟩\ket a and ∣b⟩\ket b are orthogonal to ∣n⟩\ket n, since the sum of their components is zero: FF is the plane orthogonal to ∣n⟩\ket n. We verify that P∣n⟩=133(2−1−1,...)=0P\ket n=\frac{1}{3\sqrt3}(2-1-1,...)=0. Now ∣n⟩⟨n∣=13J\ket n\bra n=\frac13J, where JJ is the matrix all of whose entries are equal to 11, and 1−13J\mathbf{1}-\frac13J is exactly the matrix PP. The projector onto FF is the complementary projector to the projector onto the orthogonal line: (∣e1⟩,∣e2⟩,∣n⟩)(\ket{e_1},\ket{e_2},\ket n) is an orthonormal basis of R3\R^3, and the closure relation reads ∣e1⟩⟨e1∣+∣e2⟩⟨e2∣+∣n⟩⟨n∣=1\ket{e_1}\bra{e_1}+\ket{e_2}\bra{e_2}+\ket n\bra n=\mathbf{1}.

Question 3
Calculate the orthogonal projection of the vector ∣x⟩=(1,2,3)\ket x=(1,2,3) onto FF, then the distance from ∣x⟩\ket x to the plane FF.

Solution
The simplest method is to use P=1−∣n⟩⟨n∣P=\mathbf{1}-\ket n\bra n. We have ⟨n|x⟩=13(1+2+3)=63\braket nx=\frac{1}{\sqrt3}(1+2+3)=\frac{6}{\sqrt3}, hence

P∣x⟩=∣x⟩−⟨n|x⟩∣n⟩=(1,2,3)−63(1,1,1)=(−1,0,1).P\ket x=\ket x-\braket nx\ket n=(1,2,3)-\frac{6}{3}(1,1,1)=(-1,0,1).

We verify that this vector does belong to FF (the sum of its components is zero). The orthogonal component is ∣x⟩−P∣x⟩=(2,2,2)\ket x-P\ket x=(2,2,2), and the distance from ∣x⟩\ket x to the plane is ∥(2,2,2)∥=23\norm{(2,2,2)}=2\sqrt3.

Question 4
Show that P∣x⟩P\ket x is the vector in FF closest to ∣x⟩\ket x: for every ∣y⟩∈F\ket y\in F, ∥x−y∥≥∥x−Px∥\norm{x-y}\geq\norm{x-Px}.

Solution
Write ∣x⟩−∣y⟩=(∣x⟩−P∣x⟩)+(P∣x⟩−∣y⟩)\ket x-\ket y=\bigl(\ket x-P\ket x\bigr)+\bigl(P\ket x-\ket y\bigr). The first vector belongs to F⊥F^\perp, since (1−P)(\mathbf{1}-P) is the projector onto F⊥F^\perp, and the second belongs to FF, since P∣x⟩P\ket x and ∣y⟩\ket y are in FF. These two vectors are orthogonal, and the Pythagorean theorem gives

∥x−y∥2=∥x−Px∥2+∥Px−y∥2≥∥x−Px∥2,\norm{x-y}^2=\norm{x-Px}^2+\norm{Px-y}^2\geq\norm{x-Px}^2,

with equality if and only if ∣y⟩=P∣x⟩\ket y=P\ket x. Orthogonal projection yields the best approximation of a vector by a vector in the subspace: this is what justifies, in infinite dimension, approximating a function by the first terms of its expansion in a Hilbert basis.