Numerical methods. Note 5
Home ] Tridiagonalization. Lanczos. Householder. Numerical Methods. Note  « 5 »

Tridiagonalization. Each iteration of the QR/QL is an O(n3) operation. On a tridiagonal matrix it is only O(n). Therefore the effective strategy is first to make the matrix tridiagonal and then apply the QR/QL algorithm. Tridiagonalization of a matrix is a non-iterative operation with a fixed number of steps. The QR transformation preserves the symmetry and the tridiagonal form of the matrix (and also the Hessenberg form).

Lanczos. Lanczos algorithm is an orthogonal transformation of a (real symmetric) matrix A into a tridiagonal form T: QTAQ=T. The tridiagonal matrix T may be of a lower dimension. If 1,...,αn} are the diagonal elements of T and 2,...,βn} are the off-diagonal elements, then the equation AQ=QT can be written as Aqiiqi-1iqii+1qi+1, where αi=qiTAqi. From this we can define the iterative procedure qi+1=u/||u||, βi+1=||u||, where u=(A-αi)qiiqi-1. One would start with a randomly chosen vector q1 and make as many iterations as needed for the convergence of the desired number of eigenvalues.

Householder reflection. If x and y are vectors with the same norm, there exists an orthogonal symmetric (Householder) matrix H, such that y=Hx, where H=1-2uuT, u = x-y/||x-y||, (HH=1 and H=HT). In particular if x={x1,...,xn} the vector y can be chosen as y={x1,...,xk,-S,0,...,0}, where S=sign(xk+1)||{xk+1,..,xn}||.

Householder QR decomposition. Using consecutive Householder reflections Hi, i=1..n-1, each of which eliminates subdiagonal elements of the i-th column of matrix A, one can reduce the matrix into a triangular form HA=R, or A=HR, where H=Hn-2...H1.

Householder tridiagonalization of a real symmetric matrix A is performed by consecutive Householder transformations A→ HiAHi, i=1..n-1, each eliminating elements below the subdiagonal of the column i. A useful trick: HAH=A-2uqT-2quT, where q=Au-(uTAu)u, H=1-2uuT.

Problems

  1. Implement the Lanczos tridiagonalization. For simplicity let your subroutine return the tridiagonal matrix T as an ordinary matrix.
  2. (Non-obl.) Implement Householder QR decomposition. Consider the Hilbert matrix Aij=1/i+j-1 and find its QR decomposition using Gram-Schmidt and Housholder methods. Compare accuracy and speed.
  3. (Non-obl.) Implement Housholder tridiagonalization.
  4. (Non-obl.) Prove that if A is a symmetric tridiagonal matrix and A=QR is its QR-decomposition, then RQ is also a symmetric tridiagonal matrix.

"Copyleft" © 2004 D.V.Fedorov (fedorov at phys dot au dot dk)