Householder transformation (source code)

= Householder transformation
{c}
{title2=$H=I-2uu^T$}
{wiki}

= Householder reflection
{c}
{synonym}

A <Householder transformation> is a <reflection> that leaves every direction in a chosen <hyperplane> fixed and reverses its normal direction. For a real <unit vector> $u$, its <matrix> is
$$
\boxed{H=I-2uu^T.}
$$
To understand the formula, decompose any <vector> into its <orthogonal projection> onto the normal and a perpendicular component:
$$
x=x_\parallel+x_\perp,\qquad
x_\parallel=(u^Tx)u,\qquad u^Tx_\perp=0.
$$
Then $Hx=x_\perp-x_\parallel$. Subtracting twice the normal component changes its sign while retaining everything parallel to the mirror. A nonzero normal $v$ gives the equivalent formula $H=I-2vv^T/(v^Tv)$, so normalization can be deferred.

For example, take $u=(2,1)^T/\sqrt5$. Its mirror is the <straight line> $2x_1+x_2=0$, and
$$
H=\begin{pmatrix}-3/5&-4/5\\-4/5&3/5\end{pmatrix},
\qquad
H\begin{pmatrix}3\\4\end{pmatrix}=\begin{pmatrix}-5\\0\end{pmatrix}.
$$
The midpoint of these two <vectors> is $(-1,2)^T$, which lies on the mirror; their connecting segment is parallel to its normal. Both <vectors> have <Euclidean norm> five.

\Image[/householder-reflection-geometry.png]
{title=A Householder reflection reverses the normal component and preserves the mirror component}
{description=The mirror is $2x_1+x_2=0$. The <vector> $(3,4)^T$ becomes $(-5,0)^T$; their midpoint $(-1,2)^T$ is the <orthogonal projection> onto the mirror.}

Several useful properties follow from this decomposition. The <Householder reflection> is a <symmetric matrix> and an <orthogonal matrix>:
$$
H^T=H,\qquad H^2=I,\qquad H^TH=I.
$$
Reflecting twice restores the original <vector>; <Euclidean norms> and <inner products> are preserved. The <eigenvalue> is $-1$ along $u$ and $+1$ on $u^\perp$, so $\det H=-1$. A reflection reverses <orientation> even though it preserves lengths.

The computational payoff is that the mirror can be chosen to send a whole <vector> onto one coordinate axis, eliminating several entries at once. <Householder QR decomposition> repeats this operation on the remaining parts of successive columns. For a real <symmetric matrix>, applying the same <Householder reflection> on both sides gives a <matrix similarity> $HAH$ that preserves symmetry and <eigenvalues>; this is the basis of <Householder tridiagonalization>.

Alston S. Householder's 1958 paper \i[Unitary Triangularization of a Nonsymmetric Matrix] develops this elimination method. Its motivation includes reducing the arithmetic needed for triangularization while retaining the conditioning advantages of <orthogonal transformations>. https://web.stanford.edu/class/cme324/classics/householder.pdf[Householder (1958), Journal of the ACM 5(4), pp. 339–342: original paper]{ref} Over the <complex numbers>, $I-2uu^*$ for a unit $u$ is <Hermitian> and <unitary>, with the star denoting the <conjugate transpose>; the coordinate-axis construction below is stated for real <vectors>.