Householder transformation

From HandWiki
Short description: Concept in linear algebra

In linear algebra, a Householder transformation (also known as a Householder reflection or elementary reflector) is a linear transformation that describes a reflection about a plane or hyperplane containing the origin. The Householder transformation was used in a 1958 paper by Alston Scott Householder.[1]

Definition

Operator and transformation

The Householder operator[2] may be defined over any finite-dimensional inner product space V with inner product ⟨⋅,⋅⟩ and unit vector u∈V as

Hu(x):=x−2⟨x,u⟩u.[3]

As defined here, the inner product ⟨⋅,⋅⟩ is linear in its first argument, and antilinear in its second argument, so that if a and b are scalars, then ⟨ax,by⟩=ab‾⟨x,y⟩. Here b‾ is the complex conjugate of b.

It is also common to choose a non-unit vector q∈V, and normalize it directly in the Householder operator's expression:[4]

Hq(x)=x−2⟨x,q⟩⟨q,q⟩q.

Such an operator is linear and self-adjoint.

If V=ℂn, note that the reflection hyperplane can be defined by its normal vector, a unit vector v→∈V (a vector with length 1) that is orthogonal to the hyperplane. The reflection of a point x about this hyperplane is the Householder transformation:

x→−2⟨x→,v→⟩v→=x→−2v→(v→*x→),

where x→ is the vector from the origin to the point x, and v→* is the conjugate transpose of v→.

The Householder transformation acting as a reflection of x about the hyperplane defined by v.

Householder matrix

The matrix constructed from this transformation can be expressed in terms of an outer product as:

P=I−2v→v→*

is known as the Householder matrix, where I is the identity matrix.

Properties

The Householder matrix has the following properties:

  • it is Hermitian: P=P*,
  • it is unitary: P−1=P* (via the Sherman-Morrison formula),
  • hence it is involutory: P=P−1.
  • A Householder matrix has eigenvalues ±1. To see this, notice that if x→ is orthogonal to the vector v→ which was used to create the reflector, then Pvx→=(I−2v→v→*)x→=x→−2⟨v→,x→⟩v→=x→, i.e., 1 is an eigenvalue of multiplicity n−1, since there are n−1 independent vectors orthogonal to v→. Also, notice Pvv→=(I−2v→v→*)v→=v→−2⟨v→,v→⟩v→=−v→ (since v→ is by definition a unit vector), and so −1 is an eigenvalue with multiplicity 1.
  • The determinant of a Householder reflector is −1, since the determinant of a matrix is the product of its eigenvalues, in this case one of which is −1 with the remainder being 1 (as in the previous point), or via the Matrix determinant lemma.

Example

Consider the normalization of a vector v→ containing 1 in each entry,

v→=12[11].

Then the Householder matrix corresponding to the vector v is

Pv=[1001]−2(12[11])(12[11])
=[1001]−[11][11]
=[1001]−[1111]
=[0−1−10].

Note that if we have another vector q→ representing a coordinate in the 2D plane

q→=[xy],

then in this case Pv flips and negates the x and y coordinates, in other words we have

Pv[xy]=[−y−x],

which corresponds to reflecting the vector across the line y=−x, which our original vector v→ is normal to.

Applications

Geometric optics

In geometric optics, specular reflection can be expressed in terms of the Householder matrix (see Specular reflection § Vector formulation).

Numerical linear algebra

Note that representing a Householder matrix requires only the entries of a single vector, not of an entire matrix (which in most algorithms is never explicitly formed), thereby minimizing the required storage and memory references needed to use them.

Further, multiplying a Householder matrix by a vector does not involve a full matrix-vector multiplication, but rather only one vector dot product, and then one axpy operation. This means its arithmetic complexity is of the same order of two low-level BLAS-1 operations. Therefore, Householder matrices are extremely arithmetically efficient.[5]

Finally, using ⋅^ to denote the computed value and ⋅ to denote the mathematically exact value, then for a given Householder matrix P,

Pb^=(P+ΔP)b

Where ||ΔP||F≤γn~:=cnu1−cnu (where u is unit roundoff, n the size of the matrix P, and c some small constant). In other words, multiplications by Householder matrices are also extremely backwards stable.[6]

Since Householder transformations minimize storage, memory references, arithmetic complexity, and optimize numerical stability, they are widely used in numerical linear algebra, for example, to annihilate the entries below the main diagonal of a matrix,[7] to perform QR decompositions and in the first step of the QR algorithm. They are also widely used for transforming to a Hessenberg form. For symmetric or Hermitian matrices, the symmetry can be preserved, resulting in tridiagonalization.[8][9]

QR decomposition

Householder transformations can be used to calculate a QR decomposition. Consider a square matrix upper triangularized up to column i−1, then our goal is to construct such Householder matrices that act upon the principal submatrices of that matrix, which has the form

A(i)=[a11a12⋯a1n0a22⋯a1n⋮⋱⋮0⋯0x1=aii⋯ain0⋯0⋮⋮0⋯0xn+1−i=ani⋯ann]

The matrix A(i) has the block form

A(i)=[Ti−1U*0Pv].

Note that A(n) is the matrix R in the QR decomposition. Here the submatrix Ti−1U is an i-1 x i-1 square upper triangular matrix, 0 represents the n-i+1 x n-i+1 zero matrix, * represents an n-i+1 x n-i+1 matrix, and Pv represents an n-i+1 x n-i+1 matrix which is to made upper triangular by working in its subspace without changing the block matrix form given above for A(i).

If x1=aii is zero and there is a non-zero element aji with j>i, then the i-th and j-th rows may be interchanged by pre-multiplying by the row interchange matrix, which is unitary. If aji=0 for all j>=i, then proceed to the next column.

If x1=aii is non-real complex given by x1=r1eiϕ1 for real r1,ϕ1, then this matrix may be pre-multiplied by the diagonal unitary matrix U with Uii=e−iϕ1 and with 1 for the other diagonal elements so as to make the new x1 non-zero real while preserving the block form. This ensures that ⟨𝐱,e→1⟩=⟨e→1,𝐱⟩=x1. Here e→1 is an n-dimensional vector with 1 in the i-th position and 0's elsewhere. (Note that we previously established that Householder transformations are unitary matrices, and since the multiplication of unitary matrices is itself a unitary matrix, this gives us the unitary matrix of the QR decomposition).

Let 𝐞1,𝐞2,...,𝐞n be the basis vectors for the n-dimensional matrices A(i) and let e→1,e→2,...,e→n−i+1 be the basis vectors 𝐞i,𝐞i+1,...,𝐞n, respectively.

If we can find a v→ so that Pvx→=αe→1 we can extend the upper triangulization by one column. The vector 𝐯 is to be in the subspace spanned by the vectors {𝐞i,𝐞i+1,...,𝐞n} that the vector 𝐱 is in. With x1 real, it will be seen that α is real too. Thinking geometrically, we are looking for a plane so that the reflection about this plane happens to land directly on the basis vector. In other words,

x→−2⟨x→,v→⟩v→=αe→1

 

 

 

 

(1)

for some constant α. However, for this to happen, we must have v→∝x→−αe→1. And since v→ is a unit vector, this means that we must have

v→=±x→−αe→1‖x→−αe→1‖2

 

 

 

 

(2)

We will find that there are two possible values for α. That value that makes ‖x→−αe→1‖2 the largest is the one that should be used for greatest accuracy.

Now if we apply equation (2) back into equation (1), we get x→−αe→1=2⟨x→,x→−αe→1‖x→−αe→1‖2⟩x→−αe→1‖x→−αe→1‖2 Or, in other words, by comparing the scalars in front of the vector x→−αe→1 we must have ‖x→−αe→1‖22=2⟨x→,x→−αe1⟩. If x1 is real then alpha is also real and is obtained from the equation ‖x→‖22−2αx1+α2=2(‖x→‖22−αx1) which means α=±‖x→‖2 If x1 is not real, then α is also not real and is obtained from the equation ‖x→‖22−αx1*−α*x1+|α|2=2(‖x→‖22−α*x1) Or, equivalently, |α|2=‖x→‖22+(αx1*−α*x1) The term in parentheses is pure imaginary, This equation requires that |α|=‖x→‖2 and that arg⁡(α)=arg⁡(x1) within a multiple of π.

This completes the construction; however, in practice we want to avoid catastrophic cancellation in equation (2). To do so for real x1, we choose[5] the sign of α as α=−sgn⁡(Re(x1))‖x→‖2 and for complex x1 we choose the sign for α as α=−eiarg⁡(x1)‖x‖2, where i is the square root of −1. This agrees with the equation just given for α when x1 is real. These choices of sign make ‖x→−αe→1‖2 the largest. When |x1|≪‖x‖2, it makes little difference which sign is chosen.

Householder transformations can similarly be applied to a non-square complex matrix. The decompositions are somewhat different.

Tridiagonalization (Hessenberg)

Real symmetric matrix

This procedure is presented in Numerical Analysis by Burden and Faires for real symmetric matrices. In the non-symmetric case, it is still useful as a similar procedure can result in a Hessenberg matrix.

It uses a slightly altered sgn function with sgn⁡(0)=1.[10] In the first step, to form the Householder matrix in each step we need to determine α and r, which are:

α=−sgn⁡(a21)∑j=2naj12;r=12(α2−a21α);

From α and r, construct vector v:

v→(1)=[v1v2⋮vn],

where v1=0, v2=a21−α2r, and

vk=ak12r for each k=3,4…n

Then compute:

P1=I−2v→(1)(v→(1))TA(2)=P1AP1

Since P1 is its own inverse (involutory), this is a similarity transformation. Having found P1 and computed A(2) the process is repeated for k=2,3,…,n−2 as follows:

α=−sgn⁡(ak+1,kk)∑j=k+1n(ajkk)2r=12(α2−ak+1,kkα)v1k=v2k=⋯=vkk=0vk+1k=ak+1,kk−α2rvjk=ajkk2r for j=k+2, k+3, …, nPk=I−2v→(k)(v→(k))TA(k+1)=PkA(k)Pk

Continuing in this manner, the tridiagonal and real symmetric matrix is formed. Since each Householder reflection is a similarity transformation, so is the overall transformation.

Hermitian matrix

Householder transformations can also transform a Hermitian matrix A into a Hermitian tri-diagonal matrix. We follow the approach in the University of Connecticut paper[11] except replace matrix transposes by matrix Hermitian conjugates for tri-diagonalization of complex Hermitian matrices rather than real symmetric matrices.

To start, let

A=(a11a→1*a→1A1)

be an n×n Hermitian matrix. Here a11 is a Hermitean 1×1 sub-matrix so is a real number, a→1 is an (n−1)×1 column vector, a→1* is its Hermitian conjugate, which is a 1×(n−1) row vector, and A1 is an (n−1)×(n−1) Hermitian sub-matrix. Let the Householder transformation matrix P1have the form

P1=(10→*0→H1)

where 0→ is an 1×(n−1) column vector of zeros, 0→* is its Hermitian conjugate and so is an (n−1)×1 row vector of zeros, and where H1=I−2v→v→* and I is the (n−1)×(n−1) identity matrix. As before, v→* is the matrix transpose of the complex conjugate or Hermitian conjugate of the column vector v→. Also, as before, the Householder transformation H1 is a unitary hermitian involutory matrix. Then

P1AP1*=(a11(H1a1)*H1a1H1A1H1*)

Since H1 and therefore P1 is hermitian and involutory H1=H1*=H1−1P1=P1*=P1−1 and so this is a unitary similarity matrix transformation.

If we have H1a→1=α1e→1

then P1AP1*=(a11α1*0→*α1a22(1)a→2*0→a→2A2) where the (n−2)×(n−2) matrix A2 is Hermitian since a unitary similarity transformation of a Hermitian matrix is again Hermitian. Now 0→ is an (n−2)×1 column vector of zeros and 0→* is its Hermitian conjugate and is a 1×(n−1) row vector of zeros. And a→2 is a (n−2)×1 column vector and a→2* is its Hermitian conjugate and is a 1×(n−2) row vector. We already know how to find the Householder transformation matrices Hi.

Repeat this process for a total of n−2 times for n>2 to obtain the tri-diagonalization by a succession of unitary Hermitian involutory similarity transformations. For instance, the following example for a 4×4 real symmetric matrix requires two Householder transformation steps to be transformed into a tri-diagonal real symmetric matrix, a 3×3 real symmetric or Hermitian matrix requires only one step, and a 1×1 real matrix or a 2×2 real symmetric or Hermitian matrix is already so tri-diagonalized.

Since the product of unitary matrices is again a unitary matrix and since the similarity transformation of a similarity transformation is again a similarity transformation, the overall transformation is a unitary similarity transformation.

Examples

In this example, also from Burden and Faires,[10] the given matrix is transformed to the similar tridiagonal matrix A3 by using the Householder method.

𝐀=[41−221201−203−221−2−1],

Following those steps in the Householder method, we have:

The first Householder matrix:

Q1=[10000−1323−2302323130−231323],A2=Q1AQ1=[4−300−31031430153−43043−43−1],

Used A2 to form

Q2=[1000010000−35−4500−4535],A3=Q2A2Q2=[4−300−3103−5300−53−3325687500687514975],

As we can see, the final result is a tridiagonal symmetric matrix which is similar to the original one. The process is finished after two steps.

Quantum computation

Picture showing the geometric interpretation of the first iteration of Grover's algorithm. The state vector |s⟩ is rotated towards the target vector |ω⟩ as shown.

As unitary matrices are useful in quantum computation, and Householder transformations are unitary, they are very useful in quantum computing. One of the central algorithms where they're useful is Grover's algorithm, where we are trying to solve for a representation of an oracle function represented by what turns out to be a Householder transformation:

{Uω|x⟩=−|x⟩for x=ω, that is, f(x)=1,Uω|x⟩=|x⟩for x≠ω, that is, f(x)=0.

(here the |x⟩ is part of the bra-ket notation and is analogous to x→ which we were using previously)

This is done via an algorithm that iterates via the oracle function Uω and another operator Us known as the Grover diffusion operator defined by

|s⟩=1N∑x=0N−1|x⟩. and Us=2|s⟩⟨s|−I.

Computational and theoretical relationship to other unitary transformations

The Householder transformation is a reflection about a hyperplane with unit normal vector v, as stated earlier. An N-by-N unitary transformation U satisfies UU*=I. Taking the determinant (N-th power of the geometric mean) and trace (proportional to arithmetic mean) of a unitary matrix reveals that its eigenvalues λi have unit modulus. This can be seen directly and swiftly:

Trace⁡(UU*)N=∑j=1N|λj|2N=1,det⁡(UU*)=∏j=1N|λj|2=1.

Since arithmetic and geometric means are equal if the variables are constant (see inequality of arithmetic and geometric means), we establish the claim of unit modulus.

For the case of real valued unitary matrices we obtain orthogonal matrices, UUT=I. It follows rather readily (see Orthogonal matrix) that any orthogonal matrix can be decomposed into a product of 2-by-2 rotations, called Givens rotations, and Householder reflections. This is appealing intuitively since multiplication of a vector by an orthogonal matrix preserves the length of that vector, and rotations and reflections exhaust the set of (real valued) geometric operations that render invariant a vector's length.

The Householder transformation was shown to have a one-to-one relationship with the canonical coset decomposition of unitary matrices defined in group theory, which can be used to parametrize unitary operators in a very efficient manner.[12]

Finally we note that a single Householder transform, unlike a solitary Givens transform, can act on all columns of a matrix, and as such exhibits the lowest computational cost for QR decomposition and tridiagonalization. The penalty for this "computational optimality" is, of course, that Householder operations cannot be as deeply or efficiently parallelized. As such Householder is preferred for dense matrices on sequential machines, whilst Givens is preferred on sparse matrices, and/or parallel machines.

See also

Notes

  1. ↑ "Unitary Triangularization of a Nonsymmetric Matrix". Journal of the ACM 5 (4): 339–342. 1958. doi:10.1145/320941.320947. https://hal.archives-ouvertes.fr/hal-01316095/file/p339householderb.pdf. 
  2. ↑ Roman 2008, p. 243-244
  3. ↑ Methods of Applied Mathematics for Engineers and Scientist. Cambridge University Press. 28 June 2013. pp. Section E.4.11. ISBN 9781107244467. https://books.google.com/books?id=nQIlAAAAQBAJ. 
  4. ↑ Roman 2008, p. 244
  5. ↑ 5.0 5.1 Saad, Yousef (2003). Iterative methods for sparse linear systems. Society for Industrial and Applied Mathematics. pp. 11–14. 
  6. ↑ Higham, Nicholas J. (2002). Accuracy and stability of numerical algorithms (2nd ed.). Philadelphia: Society for Industrial and Applied Mathematics. pp. 358. ISBN 0-89871-521-0. 
  7. ↑ Taboga, Marco. "Householder matrix, Lectures on matrix algebra.". https://www.statlect.com/matrix-algebra/Householder-matrix. 
  8. ↑ Schabauer, Hannes; Pacher, Christoph; Sunderland, Andrew G.; Gansterer, Wilfried N. (2010-05-01). "Toward a parallel solver for generalized complex symmetric eigenvalue problems" (in en). Procedia Computer Science 1 (1): 437–445. doi:10.1016/j.procs.2010.04.047. 
  9. ↑ Golub, Gene Howard; Van Loan, Charles F. (1996). Matrix computations (3rd ed.). Baltimore London: Johns Hopkins university press. pp. 211. ISBN 0-8018-5414-8. 
  10. ↑ 10.0 10.1 Burden, Richard; Faires, Douglas; Burden, Annette (2016). Numerical analysis (10th ed.). Thomson Brooks/Cole. ISBN 9781305253667. 
  11. ↑ Rozman. "Tridiagonalization". https://www.phys.uconn.edu/~rozman/Courses/m3511_18s/downloads/householder1.pdf. 
  12. ↑ Renan Cabrera; Traci Strohecker; Herschel Rabitz (2010). "The canonical coset decomposition of unitary matrices through Householder transformations". Journal of Mathematical Physics 51 (8): 082101. doi:10.1063/1.3466798. Bibcode: 2010JMP....51h2101C. 

References