Example 3.3.1.
Rather than developing a general explanation for finding \(Q\) and \(H\text{,}\) we will demonstrate with an example. Suppose that \(A=\begin{bmatrix}
1 \amp -2 \amp 3 \\
-2 \amp 4 \amp 2 \\
3 \amp 2 \amp -1 \\
\end{bmatrix}
\text{.}\) We choose any nonzero vector \(\vvec\) and define
\begin{equation*}
\qvec_1 = \frac{1}{\len{\vvec}}\vvec\text{.}
\end{equation*}
We will choose \(\vvec=\threevec100\) so that \(\qvec_1=\threevec100\text{.}\)
Our first expression is
\begin{equation*}
A\qvec_1 = h_{11}\qvec_1 + h_{21}\qvec_2\text{.}
\end{equation*}
Remember that the vectors \(\qvec_i\) will be the columns of an orthogonal matrix, which means that they form an orthonormal set. Therefore,
\begin{equation*}
(A\qvec_1)\cdot\qvec_1 = h_{11}\qvec_1\cdot\qvec_1 +
h_{21}\qvec_2\cdot\qvec_1 = h_{11}\text{.}
\end{equation*}
That is, we find
\begin{equation*}
h_{11}=\qvec_1\cdot(A\qvec_1) = r(A,\qvec_1)\text{,}
\end{equation*}
so we see that \(h_{11}\) is a Rayleigh quotient, which is encouraging.
In our example, we have \(A\qvec_1 = \cthreevec1{-2}3\) so that \(h_{11} = \qvec_1\cdot(A\qvec_1) = 1\text{.}\)
Rearranging the expression for \(A\qvec_1\text{,}\) we have
\begin{equation*}
h_{21}\qvec_2 = A\qvec_1 - h_{11}\qvec_1= \cthreevec0{-2}{3}\text{.}
\end{equation*}
Because \(\qvec_2\) has unit length, we have
\begin{equation*}
h_{21} = \len{A\qvec_1 - h_{11}\qvec_1}
\end{equation*}
so that \(h_{21} = \sqrt{13}\) and then
\begin{equation*}
\qvec_2 = \frac{1}{h_{21}}(A\qvec_1 - h_{11}\qvec_1)
\end{equation*}
or \(\qvec_2 = \frac{1}{\sqrt{13}}\cthreevec0{-2}3\text{.}\)
We now repeat the same process using the second expression
\begin{equation*}
A\qvec_2 = h_{12}\qvec_1+h_{22}\qvec_2+h_{32}\qvec_3\text{.}
\end{equation*}
In particular,
\begin{equation*}
h_{12}=(A\qvec_2)\cdot\qvec_1,\hspace{12pt}
h_{22}=(A\qvec_2)\cdot\qvec_2=r(A,\qvec_2)
\end{equation*}
so that, once again, \(h_{22}\) is a Rayleigh quotient.
In our example, \(A\qvec_2 =
\frac{1}{\sqrt{13}}\cthreevec{13}{-2}{-7}\) and hence \(h_{12}=\sqrt{13}\) and \(h_{22}=-\frac{17}{13}\text{.}\)
Rearranging the expression for \(A\qvec_2\) shows that
\begin{equation*}
h_{32}\qvec_3 = A\qvec_2-h_{12}\qvec_1-h_{22}\qvec_2=
\cthreevec{0}{-\frac{60}{13\sqrt{13}}}{-\frac{40}{13\sqrt{13}}}\text{.}
\end{equation*}
Therefore, \(h_{32}=\frac{20}{13}\) and \(\qvec_3=\cthreevec{0}{-\frac{3}{\sqrt{13}}}{-\frac{2}{\sqrt{13}}}\text{.}\)
Notice that \(\qvec_1\text{,}\) \(\qvec_2\text{,}\) and \(\qvec_3\) form a basis for \(\real^3\) so we have all three columns for the matrix \(Q\text{.}\) Our final expression is
\begin{equation*}
A\qvec_3=h_{13}\qvec_1 + h_{23}\qvec_2 + h_{33}\qvec_3\text{,}
\end{equation*}
which gives
\begin{align*}
h_{13}\amp=(A\qvec_3)\cdot\qvec_1 =0\\
h_{23}\amp=(A\qvec_3)\cdot\qvec_2 =\frac{20}{13}\\
h_{33}\amp=(A\qvec_3)\cdot\qvec_3 =\frac{56}{13}\text{.}
\end{align*}
This leaves us with
\begin{equation*}
Q = \begin{bmatrix}
1 \amp 0 \amp 0 \\
0 \amp -\frac{2}{\sqrt{13}} \amp -\frac{3}{\sqrt{13}} \\
0 \amp \frac{3}{\sqrt{13}} \amp -\frac{2}{\sqrt{13}} \\
\end{bmatrix},
\hspace{12pt}
H = \begin{bmatrix}
1 \amp \sqrt{13} \amp 0 \\
\sqrt{13} \amp -\frac{17}{13} \amp \frac{20}{13} \\
0 \amp \frac{20}{13} \amp \frac{56}{13} \\
\end{bmatrix}
\end{equation*}
from which we can check that \(A=QHQ^T\text{.}\)
Notice that our original matrix \(A=\begin{bmatrix}
1 \amp -2 \amp 3 \\
-2 \amp 4 \amp 2 \\
3 \amp 2 \amp -1 \\
\end{bmatrix}\) is symmetric. Since \(H=Q^TAQ\text{,}\) we have
\begin{equation*}
H^T = (Q^TAQ)^T = Q^TA^TQ = Q^TAQ = H
\end{equation*}
showing that \(H\) is symmetric too. Since \(H\) is also Hessenberg, this explains why \(H\) is tridiagonal, which is seen by the presence of the \(0\) in the first row, third column of \(H\text{.}\)