Chapter 34 Exercises — Inner Product Spaces
Work these with pencil first, then confirm the computational ones with numpy. Tiers: ⭐ conceptual · ⭐⭐ computation (hand) · ⭐⭐⭐ proof (A) / coding (C) · ⭐⭐⭐⭐ application/synthesis. Throughout, $\langle\cdot,\cdot\rangle$ denotes an inner product and $\lVert\mathbf{v}\rVert=\sqrt{\langle\mathbf{v},\mathbf{v}\rangle}$ the induced norm. Unless stated, spaces are real.
⭐ Conceptual
34.1. State the three axioms of a real inner product in your own words, and for each one name the geometric or computational thing it guarantees (e.g., which axiom lets you define a length?).
34.2. True or false, with a one-sentence reason each: (a) Every inner product on $\mathbb{R}^n$ is the dot product. (b) The function $\langle\mathbf{u},\mathbf{v}\rangle = u_1v_1 - u_2v_2$ on $\mathbb{R}^2$ is an inner product. (c) Two functions are orthogonal exactly when their graphs cross at right angles. (d) In a complex inner product space, $\langle\mathbf{v},\mathbf{v}\rangle$ can be a non-real complex number.
34.3. Explain in two or three sentences why the same Gram–Schmidt code can orthogonalize both vectors in $\mathbb{R}^3$ and polynomials, with only the inner product changed. Which earlier chapter's algorithm is being reused?
34.4. A weighted inner product on $\mathbb{R}^3$ uses weights $\mathbf{w}=(w_1,w_2,w_3)$. What condition must the weights satisfy for this to be a genuine inner product, and which axiom would fail otherwise? What happens to the unit "circle" of the induced norm as you increase $w_1$?
34.5. Why must the scalars-complex case conjugate one argument of the inner product? Give the one-line reason in terms of what $\overline{z}\,z$ equals, and state what would go wrong with the naive $\sum u_iv_i$ on a vector like $(1,i)$.
34.6. Define a Hilbert space in one sentence. What single property distinguishes it from a general inner product space, and why is that property automatic in finite dimensions but essential in infinite ones?
34.7. A qubit state is a unit vector $|\psi\rangle=\alpha|0\rangle+\beta|1\rangle$. State the Born rule for the probability of measuring outcome $0$, and explain — using the orthonormal-expansion identity of §34.7 — why the requirement $|\alpha|^2+|\beta|^2=1$ is the same as "the probabilities sum to one."
⭐⭐ Computation (by hand, then check with numpy)
34.8. On $\mathbb{R}^3$ with weights $\mathbf{w}=(3,1,2)$, let $\mathbf{u}=(1,2,1)$ and $\mathbf{v}=(2,0,3)$. Compute $\langle\mathbf{u},\mathbf{v}\rangle_w$, the weighted norm $\lVert\mathbf{u}\rVert_w$, and decide whether $\mathbf{u}$ and $\mathbf{v}$ are orthogonal under this weighted inner product.
34.9. Using the function inner product $\langle f,g\rangle=\int_{-1}^1 fg\,dx$, compute $\langle 1,x\rangle$, $\langle 1,x^2\rangle$, $\langle x,x^2\rangle$, and $\lVert x\rVert$. Which of the pairs $\{1,x\}$, $\{1,x^2\}$, $\{x,x^2\}$ are orthogonal? (Use odd/even symmetry where you can to save work.)
34.10. In the space $\mathbb{P}_2$ with $\langle p,q\rangle=\int_{-1}^1 pq\,dx$, find the angle (in degrees) between $f(x)=x$ and $g(x)=x+x^2$. (Hint: you already know $\langle x,x\rangle$, $\langle x,x^2\rangle$, and $\langle x^2,x^2\rangle$.)
34.11. On the complex space $\mathbb{C}^2$ with $\langle\mathbf{u},\mathbf{v}\rangle=\overline{u_1}v_1+\overline{u_2}v_2$, let $\mathbf{u}=(1,i)$ and $\mathbf{v}=(i,1)$. Compute $\langle\mathbf{u},\mathbf{v}\rangle$ and $\langle\mathbf{v},\mathbf{u}\rangle$, verify they are complex conjugates, and compute $\lVert\mathbf{u}\rVert$. Are $\mathbf{u}$ and $\mathbf{v}$ orthogonal?
34.12. Run Gram–Schmidt by hand on the monomials $1, x, x^2, x^3$ under $\langle f,g\rangle=\int_{-1}^1 fg\,dx$ to find the fourth orthogonal polynomial $q_4$ (you may use that $q_1=1$, $q_2=x$, $q_3=x^2-\tfrac13$). You should get a constant multiple of the Legendre polynomial $P_3 = \tfrac12(5x^3-3x)$ — i.e. $q_4 = x^3 - \tfrac35 x$.
34.13. Let $|\psi\rangle = \tfrac{1}{\sqrt{3}}|0\rangle + \sqrt{\tfrac{2}{3}}\,|1\rangle$ (real amplitudes). Verify $|\psi\rangle$ is a unit vector, then compute the measurement probabilities $P(0)$ and $P(1)$. What is the overlap $\langle +|\psi\rangle$ with the state $|+\rangle=\tfrac{1}{\sqrt2}(|0\rangle+|1\rangle)$, and what is $|\langle +|\psi\rangle|^2$?
34.14. Decide whether the sequence $x_k = 1/\sqrt{k}$ belongs to $\ell^2$ (i.e. whether $\sum_k |x_k|^2 < \infty$). Then do the same for $x_k = 1/k$. Justify each by naming the series you get.
34.15. On $\mathbb{R}^2$ define $\langle\mathbf{u},\mathbf{v}\rangle = 2u_1v_1 + u_1v_2 + u_2v_1 + 2u_2v_2$ (a full positive-definite-matrix inner product, $\mathbf{u}^{\mathsf{T}}M\mathbf{v}$ with $M=\begin{bmatrix}2&1\\1&2\end{bmatrix}$). Compute $\langle\mathbf{e}_1,\mathbf{e}_2\rangle$ and $\lVert\mathbf{e}_1\rVert$. Are the standard basis vectors orthogonal under this inner product?
⭐⭐⭐ Proof (A) and Coding (C)
34.16. (Proof) Prove the parallelogram law in any real inner product space: $\lVert\mathbf{u}+\mathbf{v}\rVert^2 + \lVert\mathbf{u}-\mathbf{v}\rVert^2 = 2\lVert\mathbf{u}\rVert^2 + 2\lVert\mathbf{v}\rVert^2$. Use only the axioms (expand both squared norms by bilinearity). State in one sentence what this says geometrically about a parallelogram's diagonals and sides.
34.17. (Proof) Prove the Pythagorean theorem for an abstract inner product space: if $\langle\mathbf{u},\mathbf{v}\rangle=0$ then $\lVert\mathbf{u}+\mathbf{v}\rVert^2 = \lVert\mathbf{u}\rVert^2+\lVert\mathbf{v}\rVert^2$. Then show the converse holds in a real inner product space but can fail in a complex one (find the extra term in the complex expansion that orthogonality alone does not kill).
34.18. (Proof) Show that the weighted form $\langle\mathbf{u},\mathbf{v}\rangle_w = \sum_i w_i u_i v_i$ on $\mathbb{R}^n$ satisfies all three inner-product axioms if and only if every weight $w_i$ is strictly positive. (Prove both directions: positivity of the weights $\Rightarrow$ the axioms hold; and if some $w_j \le 0$, exhibit a nonzero vector violating positive-definiteness.)
34.19. (Proof) Prove the general Cauchy–Schwarz inequality $|\langle\mathbf{u},\mathbf{v}\rangle|\le\lVert\mathbf{u}\rVert\lVert\mathbf{v}\rVert$ in a real inner product space, following the discriminant argument of §34.6 (consider $\lVert\mathbf{u}-t\mathbf{v}\rVert^2\ge 0$ as a quadratic in $t$). Identify exactly the three axioms each step uses, and characterize the equality case.
34.20. (Proof) Using Cauchy–Schwarz from the previous exercise, prove the triangle inequality $\lVert\mathbf{u}+\mathbf{v}\rVert\le\lVert\mathbf{u}\rVert+\lVert\mathbf{v}\rVert$ holds in every inner product space. Conclude that an inner product always induces a valid norm (state which four norm properties you have now established).
34.21. (Coding) Implement inner_product(u, v, weight=None) in pure Python (no numpy in the body): return $\sum_i u_iv_i$ when weight is None, else $\sum_i w_i u_iv_i$, and raise ValueError if any weight is $\le 0$. Verify against numpy that it reproduces the chapter's numbers ($32.0$ standard, $27.0$ weighted with $\mathbf{w}=(2,1,0.5)$ on $(1,2,3),(4,5,6)$), and confirm your ValueError fires for a zero weight.
34.22. (Coding) Refactor your Chapter 20 gram_schmidt so it accepts an inner-product callable ip, defaulting to the dot product. Run it on the monomials $1,x,x^2,x^3$ sampled on $[-1,1]$ with the integral inner product, and verify numerically that (a) every pair $\langle q_i,q_j\rangle\approx 0$ for $i\neq j$, and (b) the results match numpy.polynomial.legendre.Legendre basis polynomials up to scaling. Print the four orthogonal polynomials' values at $x=1$ and compare to $1,\,1,\,\tfrac23,\,\tfrac25$.
34.23. (Coding) Write cinner(u, v) for the complex inner product $\sum_i \overline{u_i}v_i$ (you may use numpy.vdot). Confirm numerically that for $\mathbf{u}=(1,i),\mathbf{v}=(2,-i)$ you get $\langle\mathbf{u},\mathbf{v}\rangle=1$, that $\langle i\mathbf{u},\mathbf{v}\rangle=-i$ (conjugate pulled from the first slot) while $\langle\mathbf{u},i\mathbf{v}\rangle=i$ (scalar pulled clean from the second), and that $\langle\mathbf{v},\mathbf{u}\rangle=\overline{\langle\mathbf{u},\mathbf{v}\rangle}$.
⭐⭐⭐⭐ Application & Synthesis
34.24. (Application — quantum overlap) Two qubit states are perfectly distinguishable by a measurement exactly when they are orthogonal. (a) Show $|0\rangle$ and $|1\rangle$ are orthogonal and that $|+\rangle$ and $|-\rangle = \tfrac{1}{\sqrt2}(|0\rangle-|1\rangle)$ are orthogonal. (b) Are $|0\rangle$ and $|+\rangle$ orthogonal? Compute the overlap $\langle 0|+\rangle$ and the probability $|\langle 0|+\rangle|^2$, and interpret it as "how often a measurement confuses the two." (c) For the genuinely complex state $|{+}i\rangle=\tfrac{1}{\sqrt2}(|0\rangle+i|1\rangle)$, compute $|\langle 0|{+}i\rangle|^2$ and $|\langle +|{+}i\rangle|^2$, and confirm both are real.
34.25. (Application — weighted least squares as projection) Suppose three measurements $y_1,y_2,y_3$ of a single constant $c$ have reliabilities (weights) $w=(4,1,1)$ — the first is four times as trustworthy. The weighted least-squares estimate minimizes $\sum_i w_i (y_i - c)^2$, which is the squared weighted norm of the residual. (a) Show by calculus that the minimizer is the weighted average $\hat c = \frac{\sum_i w_i y_i}{\sum_i w_i}$. (b) Interpret this as orthogonal projection of $\mathbf{y}$ onto the line spanned by $(1,1,1)$ in the weighted inner product (the residual is weighted-orthogonal to that line). (c) Compute $\hat c$ for $\mathbf{y}=(10,4,7)$ and compare to the unweighted average; explain the difference.
34.26. (Synthesis — Fourier coefficient as a generalized Fourier coefficient) The (normalized) functions $e_k(x) = \tfrac{1}{\sqrt{\pi}}\cos(kx)$ are orthonormal on $[-\pi,\pi]$ under $\langle f,g\rangle=\int_{-\pi}^\pi fg\,dx$ for $k\ge 1$. (a) Verify $\langle e_k, e_k\rangle = 1$ and $\langle e_k, e_m\rangle = 0$ for $k\neq m$ using the orthogonality relations of Chapter 22. (b) For $f(x)=x^2$, compute the generalized Fourier coefficient $c_k = \langle e_k, f\rangle$ (the projection of $f$ onto $e_k$) for $k=1,2$. (c) Explain, citing §34.7, why this is exactly the same coordinate-extraction formula as reading off the $i$-th entry of a vector in $\mathbb{R}^n$ via $\langle\mathbf{e}_i,\mathbf{v}\rangle$ — the "Fourier" in Fourier coefficient is just the special case for a function basis.