Post · 9 min read· pp. 625–629

What Is a Householder Matrix?

A Householder matrix is an n×nn\times n orthogonal matrix of the form

P=I−2vTvvvT,0≠v∈Rn.\notag P = I - \displaystyle\frac{2}{v^Tv} vv^T, \qquad 0 \ne v \in\mathbb{R}^n.

It is easily verified that PP is

  • orthogonal (PTP=IP^TP = I),
  • symmetric (PT=PP^T = P),
  • involutory (P2=IP^2 = I that is, PP is a square root of the identity matrix),

where the last property follows from the first two.

A Householder matrix is a rank-11 perturbation of the identity matrix and so all but one of its eigenvalues are 11. The eigensystem can be fully described as follows.

  • PP has an eigenvalue −1-1 with eigenvector vv, since Pv=−vPv = -v.
  • PP has n−1n-1 eigenvalues 11 with eigenvectors any set of n−1n-1 linearly independent vectors orthogonal to vv, which can be taken to be mutually orthogonal: Px=xPx = x for every such xx.

PP has trace n−2n-2 and determinant −1-1, as can be derived directly or deduced from the facts that the trace is the sum of the eigenvalues and the determinant is the product of the eigenvalues.

For n=2n = 2, a Householder matrix can be written as

P=[cos⁡θsin⁡θsin⁡θ−cos⁡θ].\notag P = \begin{bmatrix} \cos\theta & \sin\theta\\ \sin\theta & -\cos\theta \end{bmatrix}.

Simple examples of Householder matrices are obtained by choosing v=e=[1,1,…,1]Tv = e = [1,1,\dots,1]^T, for which P=I−(2/n)eeTP = I - (2/n)ee^T. For n=2,3,4,5,6n=2,3,4,5,6 we obtain the matrices

\notag \begin{gathered} \left[\begin{array}{@{\mskip2mu}rr@{\mskip2mu}} 0 & -1 \\ -1 & 0 \end{array}\right], \quad \displaystyle\frac{1}{3} \left[\begin{array}{@{\mskip2mu}rrr@{\mskip2mu}} 1 & -2 & -2\\ -2 & 1 & -2\\ -2 & -2 & 1\\ \end{array}\right], \quad \displaystyle\frac{1}{2} \left[\begin{array}{@{\mskip2mu}rrrr@{\mskip2mu}} 1 & -1 & -1 & -1\\ -1 & 1 & -1 & -1\\ -1 & -1 & 1 & -1\\ -1 & -1 & -1 & 1\\ \end{array}\right], \\ \displaystyle\frac{1}{5} \left[\begin{array}{@{\mskip2mu}rrrrr@{\mskip2mu}} 3 & -2 & -2 & -2 & -2\\ -2 & 3 & -2 & -2 & -2\\ -2 & -2 & 3 & -2 & -2\\ -2 & -2 & -2 & 3 & -2\\ -2 & -2 & -2 & -2 & 3 \end{array}\right], \quad \displaystyle\frac{1}{3} \left[\begin{array}{@{\mskip2mu}rrrrrr@{\mskip2mu}} 2 & -1 & -1 & -1 & -1 & -1\\ -1 & 2 & -1 & -1 & -1 & -1\\ -1 & -1 & 2 & -1 & -1 & -1\\ -1 & -1 & -1 & 2 & -1 & -1\\ -1 & -1 & -1 & -1 & 2 & -1\\ -1 & -1 & -1 & -1 & -1 & 2 \end{array}\right]. \end{gathered}

Note that the 4×44\times 4 matrix is 1/21/2 times a Hadamard matrix.

Applying PP to a vector xx gives

Px=x−(2vTxvTv)v.\notag Px = x - \displaystyle\left( \frac{2 v^Tx}{v^Tv} \right) v.

This equation shows that PP reflects xx about the hyperplane span(v)⊥{\mathrm{span}}(v)^{\perp}, as illustrated in the following diagram, which explains why PP is sometimes called a Householder reflector. Another way of expressing this property is to write x=αv+zx = \alpha v + z, where zz is orthogonal to vv. Then Px=−αv+zPx = -\alpha v + z, so the component of xx in the direction vv has been reversed. If we take v=eiv = e_i, the iith unit vector, then P=I−2eieiT=diag(1,1,…,−1,1,…,1)P = I - 2e_ie_i^T = \mathrm{diag}(1,1,\dots,-1,1,\dots,1), which has −1-1 in the (i,i)(i,i) position. In this case premultiplying a vector by PP flips the sign of the iith component.

householder_fig.jpg

Transforming a Vector

Householder matrices are powerful tools for introducing zeros into vectors. Suppose we are given vectors xx and yy and wish to find a Householder matrix PP such that Px=yPx=y. Since PP is orthogonal, we require that ∥x∥2=∥y∥2\|x\|_2 = \|y\|_2, and we exclude the trivial case x=yx = y. Now

Px=y⟺x−2(vTxvTv)v=y,Px = y \quad \Longleftrightarrow \quad x - 2 \left( \displaystyle\frac{v^Tx}{v^Tv} \right) v = y,

and this last equation has the form αv=x−y\alpha v = x-y for some α\alpha. But PP is independent of the scaling of vv, so we can set α=1\alpha=1. Now with v=x−yv=x-y we have

vTv=xTx+yTy−2xTy\notag v^Tv = x^Tx + y^Ty -2x^Ty

and, since xTx=yTyx^Tx = y^Ty,

vTx=xTx−yTx=12vTv.\notag v^Tx = x^Tx - y^Tx = \frac{1}{2} v^Tv.

Therefore

Px=x−v=y,\notag Px = x - v = y,

as required. Most often we choose yy to be zero in all but its first component.

Square Roots

What can we say about square roots of a Householder matrix, that is, matrices XX such that X2=PX^2 = P?

We note first that the eigenvalues of XX are the square roots of those of PP and so n−1n-1 of them will be ±1\pm 1 and one will be ±i\pm \mathrm{i}. This means that XX cannot be real, as the nonreal eigenvalues of a real matrix must appear in complex conjugate pairs.

Write P=I−2vvTP = I - 2vv^T, where vv is normalized so that vTv=1v^Tv = 1. It is natural to look for a square root of the form X=I−θvvTX = I - \theta vv^T. Setting X2=PX^2 = P leads to the quadratic equation θ2−2θ+2=0\theta^2-2\theta + 2 = 0, and hence θ=1±i\theta = 1 \pm \mathrm{i}. As expected, these two square roots are complex even though PP is real. As an example, θ=1−i\theta = 1 - \mathrm{i} gives the following square root of the matrix above corresponding to v=e/n1/2v = e/n^{1/2} with n=3n = 3:

\notag X = \displaystyle\frac{1}{3} \left[\begin{array}{@{\mskip2mu}rrr} 2+\mathrm{i} & -1+\mathrm{i} & -1+\mathrm{i}\\ -1+\mathrm{i} & 2+\mathrm{i} & -1+\mathrm{i}\\ -1+\mathrm{i} & -1+\mathrm{i} & 2+\mathrm{i} \end{array}\right].

A good way to understand all the square roots is to diagonalize PP, which can be done by a similarity transformation with a Householder matrix! Normalizing vTv=1v^Tv = 1 again, let w=v−e1w = v - e_1 and H=I−2wwT/(wTw)H = I - 2ww^T/(w^Tw). Then from the construction above we know that Hv=e1Hv = e_1. Hence

HT ⁣PH=HPH=I−2HvvT ⁣H=I−2e1e1T=diag(−1,1,1,…,1)=:D.\notag H^T\!PH = HPH = I - 2 Hv v^T\!H = I - 2 e_1e_1^T = \mathrm{diag}(-1,1,1,\dots,1)=: D.

Then P=HDHTP = HDH^T and so X=HDHTX = H \sqrt{D} H^T gives 2n2^n square roots on taking all possible combinations of signs on the diagonal for D\sqrt{D}. Because PP has repeated eigenvalues these are not the only square roots. The infinitely many others are obtained by taking non-diagonal square roots of DD, which are of the form diag(±i,Y)\mathrm{diag}(\pm i, Y), where YY is any non-diagonal square root of the (n−1)×(n−1)(n-1)\times (n-1) identity matrix, which in particular could be a Householder matrix!

Block Householder Matrix

It is possible to define an n×nn\times n block Householder matrix in terms of a given Z∈Rn×pZ\in\mathbb{R}^{n\times p}, where n≥pn\ge p, as

P=I−2Z(ZTZ)+ZT.\notag P = I - 2 Z(Z^TZ)^+Z^T.

Here, “++” denotes the Moore–Penrose pseudoinverse. For p=1p=1, PP clearly reduces to a standard Householder matrix. It can be shown that (ZTZ)+ZT=Z+(Z^TZ)^+Z^T = Z^+ (this is most easily proved using the SVD), and so

P=I−2ZZ+=I−2PZ,P = I - 2 ZZ^+ = I - 2 P_Z,

where PZ=ZZ+P_Z = ZZ^+ is the orthogonal projector onto the range of ZZ (that is, range(PZ)=range(Z)\mathrm{range}(PZ) = \mathrm{range}(Z), PZ2=PZP_Z^2 = P_Z, and PZ=PZTP_Z = P_Z^T). Hence, like a standard Householder matrix, PP is symmetric, orthogonal, and involutory. Furthermore, premultiplication of a matrix by PP has the effect of reversing the component in the range of ZZ.

As an example, here is the block Householder matrix corresponding to Z=[12345678]TZ = \bigl[\begin{smallmatrix} 1 & 2 & 3 & 4\\ 5 & 6 & 7 & 8 \end{smallmatrix}\bigr]^T:

\notag \displaystyle\frac{1}{5} \left[\begin{array}{@{\mskip2mu}rrrr@{\mskip2mu}} -2 & -4 & -1 & 2\\ -4 & 2 & -2 & -1\\ -1 & -2 & 2 & -4\\ 2 & -1 & -4 & -2 \end{array}\right].

One can show (using the SVD again) that the eigenvalues of PP are −1-1 repeated rr times and 11 repeated n−rn-r times, where r=rank(Z)r = \mathrm{rank}(Z). Hence trace(P)=n−2r\mathrm{trace}(P) = n - 2r and det⁡(P)=(−1)r\det(P) = (-1)^r.

Schreiber and Parlett (1988) note the representation for n=2kn = 2k,

P=±diag(Q1,Q2)[cos⁡(2Θ)sin⁡(2Θ)sin⁡(2Θ)−cos⁡(2Θ)]diag(Q1,Q2)T,\notag P = \pm \mathrm{diag}(Q_1,Q_2) \begin{bmatrix} \cos(2\Theta) & \sin(2\Theta) \\ \sin(2\Theta) & -\cos(2\Theta) \end{bmatrix} \mathrm{diag}(Q_1,Q_2)^T,

where Q1Q_1 and Q2Q_2 are orthogonal and Θ\Theta is symmetric positive definite. This formula neatly generalizes the formula for a standard Householder matrix for n=2n = 2 given above, and a similar formula holds for odd nn.

Schreiber and Parlett also show how given E∈Rn×pE\in\mathbb{R}^{n\times p} (n>pn > p) one can construct a block Householder matrix HH such that

HE=[F0],F∈Rp×p.\notag HE = \begin{bmatrix} F \\ 0 \end{bmatrix}, \qquad F \in \mathbb{R}^{p\times p}.

The polar decomposition plays a key role in the theory and algorithms for such HH.

Rectangular Householder Matrix

We can define a rectangular Householder matrix as follows. Let m>nm > n, u∈Rnu \in \mathbb{R}^n, v∈Rm−nv \in \mathbb{R}^{m-n}, and

P=[In0]+α[uv]uT=[In+αuuTαvuT]∈Rn.\notag P = \begin{bmatrix} I_n\\0 \end{bmatrix} + \alpha \begin{bmatrix} u\\v \end{bmatrix}u^T = \begin{bmatrix} I_n + \alpha u u^T\\ \alpha vu^T \end{bmatrix} \in \mathbb{R}^n.

Then PTP=IP^TP = I, that is, PP has orthonormal columns, if

α=−2uTu+vTv.\alpha = \displaystyle\frac{-2}{u^Tu + v^Tv}.

Of course, PP is just the first nn columns of the Householder matrix built from the vector [uT vT]T[u^T~v^T]^T.

Historical Note

The earliest appearance of Householder matrices is in the book by Turnbull and Aitken (1932). These authors show that if ∥x∥2=∥y∥2\|x\|_2 = \|y\|_2 (x≠−yx\ne -y) then a unitary matrix of the form R=αzz∗−IR = \alpha zz^* - I (in their notation) can be constructed so that Rx=yRx = y. They use this result to prove the existence of the Schur decomposition. The first systematic use of Householder matrices for computational purposes was by Householder (1958) who used them to construct the QR factorization.

References

This is a minimal set of references, which contain further useful references within.

This article is part of the “What Is” series, available from https://nhigham.com/category/what-is and in PDF form from the GitHub repository https://github.com/higham/what-is.