Chapter 21 Exercises — Orthogonal Matrices and Rotations

Work the tiers in order; each builds on the last. ⭐ checks understanding, ⭐⭐ asks for hand computation, ⭐⭐⭐ asks for a proof (A) or code (C), and ⭐⭐⭐⭐ is an open-ended application. Problems marked [code] want a short numpy snippet; [proof] wants a rigorous argument in the §10 four-part style. Throughout, $Q$ denotes a real orthogonal matrix and $U$ a complex unitary one.


Tier 1 — ⭐ Conceptual

21.1. In one sentence each, give the geometric meaning of (a) $Q^{\mathsf{T}}Q = I$, (b) $\det(Q) = +1$, and (c) $\det(Q) = -1$.

21.2. True or false, with a one-line reason: every matrix with $\det = 1$ is orthogonal.

21.3. Why is "orthogonal matrix" a slightly misleading name? What word would have been more accurate, and what condition does the name leave out?

21.4. A transformation triples every length: $\lVert T\mathbf{x}\rVert = 3\lVert\mathbf{x}\rVert$. (a) Is its matrix orthogonal? (b) Does it preserve angles? Reconcile your two answers.

21.5. Fill in the blank with $+1$ or $-1$: a rotation has determinant _; a reflection has determinant _; the composition of two reflections has determinant ____.

21.6. What is the real, $2\times2$, orthogonal matrix that is both a rotation and a reflection? (Hint: there is exactly one matrix that could be either — think about the trivial case, then argue why no other matrix qualifies.)

21.7. State the complex analogue of an orthogonal matrix. Write its defining equation and name the symbol $U^{*}$ denotes.

21.8. Why must a quantum logic gate be unitary? Answer in terms of what a qubit's squared length represents physically.


Tier 2 — ⭐⭐ Hand computation

21.9. For the rotation by $\theta = 90°$, write $Q$ explicitly, then compute $Q\mathbf{v}$ for $\mathbf{v} = (2, 5)$. Verify that $\lVert Q\mathbf{v}\rVert = \lVert\mathbf{v}\rVert$.

21.10. Verify by hand that $Q = \dfrac{1}{\sqrt2}\begin{psmallmatrix}1 & -1\\ 1 & 1\end{psmallmatrix}$ is orthogonal by computing all three distinct entries of $Q^{\mathsf{T}}Q$. What angle does it rotate by, and what is its determinant?

21.11. Is $A = \begin{psmallmatrix}\tfrac{5}{13} & -\tfrac{12}{13}\\ \tfrac{12}{13} & \tfrac{5}{13}\end{psmallmatrix}$ orthogonal? If so, find $A^{-1}$ without doing any elimination, and state whether $A$ is a rotation or a reflection.

21.12. Build the Householder reflection $H = I - 2\mathbf{u}\mathbf{u}^{\mathsf{T}}$ for $\mathbf{u} = (0, 1)$. What familiar transformation is it? Confirm $\det(H) = -1$ and $H^2 = I$ by hand.

21.13. Write the $3\times3$ matrix $R_x(90°)$ for rotation about the $x$-axis, and compute its action on $\mathbf{e}_2 = (0,1,0)$ and $\mathbf{e}_3 = (0,0,1)$. Which standard basis vector is left fixed, and why?

21.14. Compute the product $R(120°)\,R(240°)$ of two 2D rotations by hand (use exact values of $\cos$ and $\sin$). What single rotation do you get, and what is its determinant?

21.15. The phase gate is $S = \begin{psmallmatrix}1 & 0\\ 0 & i\end{psmallmatrix}$. Compute $S^{*}S$ to confirm it is unitary, and compute $\det(S)$. Explain in one sentence why $S$ is unitary but not orthogonal.

21.16. Reflect the vector $\mathbf{v} = (3, 1)$ across the line $y = x$ by hand, using the reflection matrix $F = \begin{psmallmatrix}0 & 1\\ 1 & 0\end{psmallmatrix}$. Confirm the length is preserved.


Tier 3 — ⭐⭐⭐ Proof (A) / Coding (C)

21.17. [proof] Prove that if $Q$ is orthogonal then $\lVert Q\mathbf{x}\rVert = \lVert\mathbf{x}\rVert$ for all $\mathbf{x}$. Use the four-part proof shape (why we care / key idea / proof / what it means).

21.18. [proof] Prove that the product of two orthogonal matrices is orthogonal, and that the inverse of an orthogonal matrix is orthogonal. State which group axioms these two facts establish.

21.19. [proof] Prove that $\det(Q) = \pm1$ for any orthogonal $Q$. Identify exactly which two theorems about determinants from Chapter 11 you use.

21.20. [proof] Prove that an orthogonal matrix preserves dot products: $(Q\mathbf{x})\cdot(Q\mathbf{y}) = \mathbf{x}\cdot\mathbf{y}$. Then deduce, in two sentences, that it preserves angles.

21.21. [proof] Show that every $2\times2$ orthogonal matrix has the form $\begin{psmallmatrix}\cos\theta & -\sin\theta\\ \sin\theta & \cos\theta\end{psmallmatrix}$ (rotation) or $\begin{psmallmatrix}\cos\theta & \sin\theta\\ \sin\theta & -\cos\theta\end{psmallmatrix}$ (reflection). (Hint: the first column is a unit vector; the second is a unit vector perpendicular to it.)

21.22. [proof] Prove that any Householder matrix $H = I - 2\mathbf{u}\mathbf{u}^{\mathsf{T}}$ with $\lVert\mathbf{u}\rVert = 1$ satisfies $H^{\mathsf{T}} = H$ and $H^2 = I$, and conclude that $H$ is orthogonal.

21.23. [code] Write is_orthogonal(Q, tol=1e-9) using numpy, returning True when $Q^{\mathsf{T}}Q$ is within tol of $I$. Test it on a rotation, a reflection, a permutation matrix, and a shear, and print the four results.

21.24. [code] Write a function random_rotation_2d(rng) that returns a random 2D rotation matrix (draw a random angle). Verify numerically, over 1,000 random vectors, that it preserves length to within $10^{-12}$.

21.25. [code] Numerically demonstrate that the Hadamard gate $H = \tfrac{1}{\sqrt2}\begin{psmallmatrix}1 & 1\\ 1 & -1\end{psmallmatrix}$ is unitary, that $H^2 = I$, and that applying $H$ to the state $(1, 0)$ then measuring gives probabilities $\tfrac12, \tfrac12$ (i.e. the squared magnitudes of the entries of $H(1,0)^{\mathsf{T}}$).


Tier 4 — ⭐⭐⭐⭐ Application

21.26. [code] Re-orthonormalization. Start with a true 3D rotation matrix, then corrupt it by adding small random noise (magnitude $\sim 10^{-3}$) to every entry, simulating numerical drift. Show that the corrupted matrix fails is_orthogonal, then restore orthogonality using a QR factorization (np.linalg.qr) and confirm the restored $Q$ passes. Explain in two sentences why robotics and aerospace software must do this periodically.

21.27. [code] Signal energy (Parseval). Build the $8\times8$ normalized DFT matrix $F$ and verify it is unitary. Take any 8-sample signal of your choosing, transform it, and confirm the signal energy $\lVert\mathbf{x}\rVert$ equals the spectrum energy $\lVert F\mathbf{x}\rVert$. State which named theorem you have just demonstrated.

21.28. [proof + code] Rotation eigenvalues. (a) [proof] Show that the 2D rotation by $\theta \ne 0, \pi$ has no real eigenvalue, by arguing geometrically that no nonzero real vector is mapped to a scalar multiple of itself. (b) [code] Compute the eigenvalues of the rotation by $40°$ in numpy, and confirm they are $e^{\pm i\,40°}$ with modulus 1. (This previews Chapter 26.)

21.29. [open-ended] Orientation in games. A game engine stores a spaceship's orientation as a $3\times3$ rotation matrix. The player issues "yaw left 15°, then pitch up 10°." Explain, with the relevant matrix product, how the new orientation is computed, why the result is still a valid rotation, and why the order of the two operations matters (recall non-commutativity from Chapter 8). No code required, but you may include a snippet.

21.30. [open-ended] Whitening. In data preprocessing, "whitening" applies an orthogonal matrix to a centered dataset so the features become uncorrelated. Argue why using an orthogonal transformation (rather than an arbitrary invertible one) guarantees that the distances between data points are unchanged, and explain why that property is desirable when the whitened data feeds a distance-based algorithm such as $k$-nearest-neighbors. (Forward link: the orthogonal matrix here comes from the spectral theorem of Chapter 27.)