Example (QR factorisation using Givens rotations)

Givens rotation

Matrix

$A = \pmat{2 & 10 & -2 \\ 1 & -4 & -7 \\ 2 & 1 & 1 \\}$

$Ω^{[1,2]} = \pmat{\frac{2}{\sqrt{5}} & \frac{1}{\sqrt{5}} \\ -\frac{1}{\sqrt{5}} & \frac{2}{\sqrt{5}} \\ &&1}$

$\pmat{\sqrt{5} & \frac{16}{\sqrt{5}} & -\frac{11}{\sqrt{5}} \\ \color{yellow} 0 & -\frac{18}{\sqrt{5}} & -\frac{12}{\sqrt{5}} \\ 2 & 1 & 1}$

$Ω^{[1,3]} = \pmat{\frac{\sqrt{5}}{3} & & \frac{2}{3} \\ &1 \\ -\frac{2}{3} && \frac{\sqrt{5}}{3}}$

$\pmat{3 & 6 & -3 \\ 0 & -\frac{18}{\sqrt{5}} & -\frac{12}{\sqrt{5}} \\ \color{yellow} 0 & -\frac{9}{\sqrt{5}} & \frac{9}{\sqrt{5}}}$

$Ω^{[2,3]} = \pmat{1 \\ & -\frac{2}{\sqrt{5}} & -\frac{1}{\sqrt{5}} \\ &\frac{1}{\sqrt{5}} & -\frac{2}{\sqrt{5}}}$

$\pmat{3 & 6 & -3 \\ 0 & 9 & 3 \\ 0 & \color{yellow}0 & -6}$

We can compute $$ \begin{align*} Q^T = Ω^{[2,3]} Ω^{[1,3]} Ω^{[1,2]} = \frac{1}{3}\pmat{2 & 1 & 2 \\ 2 & -2 & -1 \\ 1 & 2 & -2}. \end{align*} $$

Hence $$ \begin{align*} A = \frac{1}{3}\pmat{2 & 2 & 1 \\ 1 & -2 & 2 \\ 2 & -1 & -2} \cdot \pmat{3 & 6 & -3 \\ 0 & 9 & 3 \\ 0 & 0 & -6}. \end{align*} $$