The matrix \(\mathbf A=\mathbf U\,\mathrm{diag}(\lambda_1,\lambda_2)\,\mathbf U^{\mathsf T}\) is built from the eigenvalues and the direction of the first eigenvector that you choose. The left panel shows the level sets \(\mathbf x^{\mathsf T}\mathbf A\mathbf x=\pm1\) (ellipses when both eigenvalues are positive, hyperbolas when the signs differ) and the iterates of the power method \(\mathbf v_t\propto\mathbf A\mathbf v_{t-1}\) on the unit circle. Each step multiplies the component along \(\mathbf u_2\), relative to the one along \(\mathbf u_1\), by \(\lambda_2/\lambda_1\): the right panels show the angle to \(\mathbf u_1\) falling geometrically and the Rayleigh quotient \(\mathbf v_t^{\mathsf T}\mathbf A\mathbf v_t\) approaching \(\lambda_1\).
Stage 2 runs the same iteration on the deflated matrix \(\mathbf A-\hat\lambda_1\mathbf v\mathbf v^{\mathsf T}\) (7.174), with \(\hat\lambda_1\) and \(\mathbf v\) the result of 40 steps of stage 1; it converges to the second eigenpair. The dotted line in the middle panel is the bound \(\tan\theta_0\,|\lambda_2/\lambda_1|^t\) on the sine of the angle.
code/ch07_linear_algebra.py (sym2, power_method, deflate).