Solving large scale eigenvalue problems

Similar documents
Solving large scale eigenvalue problems

The QR Algorithm. Chapter The basic QR algorithm

Orthogonal iteration to QR

EECS 275 Matrix Computation

QR-decomposition. The QR-decomposition of an n k matrix A, k n, is an n n unitary matrix Q and an n k upper triangular matrix R for which A = QR

AMS526: Numerical Analysis I (Numerical Linear Algebra)

Eigenvalue Problems and Singular Value Decomposition

Eigenvalues and eigenvectors

EIGENVALUE PROBLEMS. EIGENVALUE PROBLEMS p. 1/4

Computing Eigenvalues and/or Eigenvectors;Part 2, The Power method and QR-algorithm

Matrices, Moments and Quadrature, cont d

Numerical Methods for Solving Large Scale Eigenvalue Problems

13-2 Text: 28-30; AB: 1.3.3, 3.2.3, 3.4.2, 3.5, 3.6.2; GvL Eigen2

EIGENVALUE PROBLEMS (EVP)

FEM and sparse linear system solving

Computing Eigenvalues and/or Eigenvectors;Part 2, The Power method and QR-algorithm

THE QR METHOD A = Q 1 R 1

Math 405: Numerical Methods for Differential Equations 2016 W1 Topics 10: Matrix Eigenvalues and the Symmetric QR Algorithm

Eigenvalue and Eigenvector Problems

Computation of eigenvalues and singular values Recall that your solutions to these questions will not be collected or evaluated.

Last Time. Social Network Graphs Betweenness. Graph Laplacian. Girvan-Newman Algorithm. Spectral Bisection

Orthogonal iteration to QR

The QR Algorithm. Marco Latini. February 26, 2004

AMS526: Numerical Analysis I (Numerical Linear Algebra)

EECS 275 Matrix Computation

Math 504 (Fall 2011) 1. (*) Consider the matrices

5.3 The Power Method Approximation of the Eigenvalue of Largest Module

AMS526: Numerical Analysis I (Numerical Linear Algebra) Lecture 23: GMRES and Other Krylov Subspace Methods; Preconditioning

ECS130 Scientific Computing Handout E February 13, 2017

Lecture # 11 The Power Method for Eigenvalues Part II. The power method find the largest (in magnitude) eigenvalue of. A R n n.

Index. for generalized eigenvalue problem, butterfly form, 211

Notes on the Symmetric QR Algorithm

Eigenvalue problems. Eigenvalue problems

Computing Eigenvalues and/or Eigenvectors;Part 1, Generalities and symmetric matrices

Eigenvalue Problems. Eigenvalue problems occur in many areas of science and engineering, such as structural analysis

The German word eigen is cognate with the Old English word āgen, which became owen in Middle English and own in modern English.

AMS526: Numerical Analysis I (Numerical Linear Algebra)

Lecture 12 Eigenvalue Problem. Review of Eigenvalues Some properties Power method Shift method Inverse power method Deflation QR Method

Module 6.6: nag nsym gen eig Nonsymmetric Generalized Eigenvalue Problems. Contents

Gaussian Elimination for Linear Systems

Direct methods for symmetric eigenvalue problems

Applied Numerical Linear Algebra. Lecture 8

Scientific Computing: An Introductory Survey

Lecture 4 Eigenvalue problems

Foundations of Matrix Analysis

Notes on Eigenvalues, Singular Values and QR

We will discuss matrix diagonalization algorithms in Numerical Recipes in the context of the eigenvalue problem in quantum mechanics, m A n = λ m

Math 102, Winter Final Exam Review. Chapter 1. Matrices and Gaussian Elimination

AMS526: Numerical Analysis I (Numerical Linear Algebra)

Computational Methods. Eigenvalues and Singular Values

Accelerating computation of eigenvectors in the dense nonsymmetric eigenvalue problem

EIGENVALUE PROBLEMS. Background on eigenvalues/ eigenvectors / decompositions. Perturbation analysis, condition numbers..

AMS526: Numerical Analysis I (Numerical Linear Algebra)

Numerical methods for eigenvalue problems

Basic Concepts in Matrix Algebra

Section 4.5 Eigenvalues of Symmetric Tridiagonal Matrices

11.0 Introduction. An N N matrix A is said to have an eigenvector x and corresponding eigenvalue λ if. A x = λx (11.0.1)

Eigenvalues and Eigenvectors

Numerical Methods - Numerical Linear Algebra

Numerical Methods I: Eigenvalues and eigenvectors

Accelerating computation of eigenvectors in the nonsymmetric eigenvalue problem

Linear Algebra. Brigitte Bidégaray-Fesquet. MSIAM, September Univ. Grenoble Alpes, Laboratoire Jean Kuntzmann, Grenoble.

Lecture 3: QR-Factorization

Numerical Solution of Linear Eigenvalue Problems

AMS526: Numerical Analysis I (Numerical Linear Algebra)

Preliminary/Qualifying Exam in Numerical Analysis (Math 502a) Spring 2012

ENGG5781 Matrix Analysis and Computations Lecture 8: QR Decomposition

Department of Mathematics California State University, Los Angeles Master s Degree Comprehensive Examination in. NUMERICAL ANALYSIS Spring 2015

Begin accumulation of transformation matrices. This block skipped when i=1. Use u and u/h stored in a to form P Q.

Computing the Complete CS Decomposition

AMS526: Numerical Analysis I (Numerical Linear Algebra)

Solution of eigenvalue problems. Subspace iteration, The symmetric Lanczos algorithm. Harmonic Ritz values, Jacobi-Davidson s method

MAA507, Power method, QR-method and sparse matrix representation.

Numerical Analysis Lecture Notes

Solving Symmetric Semi-definite (ill-conditioned) Generalized Eigenvalue Problems

In this section again we shall assume that the matrix A is m m, real and symmetric.

Linear algebra & Numerical Analysis

THE RELATION BETWEEN THE QR AND LR ALGORITHMS

Lecture 2 INF-MAT : , LU, symmetric LU, Positve (semi)definite, Cholesky, Semi-Cholesky

Krylov Subspace Methods for Large/Sparse Eigenvalue Problems

Dense LU factorization and its error analysis

Lecture 2: Numerical linear algebra

MATH 423 Linear Algebra II Lecture 33: Diagonalization of normal operators.

Math 577 Assignment 7

Chapter f Linear Algebra

MATH 425-Spring 2010 HOMEWORK ASSIGNMENTS

Scientific Computing WS 2018/2019. Lecture 9. Jürgen Fuhrmann Lecture 9 Slide 1

Recall : Eigenvalues and Eigenvectors

AMS526: Numerical Analysis I (Numerical Linear Algebra)

Data Analysis and Manifold Learning Lecture 2: Properties of Symmetric Matrices and Examples

Double-shift QR steps

Matrix Algorithms. Volume II: Eigensystems. G. W. Stewart H1HJ1L. University of Maryland College Park, Maryland

Mathematical Optimisation, Chpt 2: Linear Equations and inequalities

Eigensystems for Large Matrices

Bindel, Spring 2016 Numerical Analysis (CS 4220) Notes for

Krylov subspace projection methods

Orthogonal iteration revisited

Numerical Linear Algebra

Program Lecture 2. Numerical Linear Algebra. Gaussian elimination (2) Gaussian elimination. Decompositions, numerical aspects

4.8 Arnoldi Iteration, Krylov Subspaces and GMRES

Transcription:

arge scale eigenvalue problems, Lecture 5, March 23, 2016 1/30 Lecture 5, March 23, 2016: The QR algorithm II http://people.inf.ethz.ch/arbenz/ewp/ Peter Arbenz Computer Science Department, ETH Zürich E-mail: arbenz@inf.ethz.ch

Large scale eigenvalue problems, Lecture 5, March 23, 2016 2/30 Survey Survey of today s lecture The QR algorithm is the most important algorithm to compute the Schur form of a dense matrix. Basic QR algorithm Hessenberg QR algorithm QR algorithm with shifts Double step QR algorithm for real matrices The symmetric QR algorithm The QZ algorithm for solving Ax = λbx.

Large scale eigenvalue problems, Lecture 5, March 23, 2016 3/30 Spectral decomposition Spectral decomposition Theorem Let A C n n be hermitian, A = A. Then there is a unitary matrix U C n n such that U AU = Λ = diag(λ 1,..., λ n ) (1) is diagonal. The diagonal elements λ i of Λ are the eigenvalues of A. Let U = [u 1, u 2,..., u n ]. Then Au i = λ i u i, 1 i n. u i is the eigenvector associated with the eigenvalue λ i.

Large scale eigenvalue problems, Lecture 5, March 23, 2016 4/30 The symmetric QR algorithm The symmetric QR algorithm The QR algorithm can be applied straight to Hermitian or symmetric matrices. The QR algorithm generates a sequence {A k } of symmetric matrices. Taking into account the symmetry, the performance of the algorithm can be improved considerably. Hermitian matrices have a real spectrum. Therefore, we can restrict ourselves to single shifts.

Large scale eigenvalue problems, Lecture 5, March 23, 2016 5/30 The symmetric QR algorithm Reduction to tridiagonal form Apply a sequence of Householder transformations to arrive at tridiagonal (= symmetric Hessenberg) form. First step: Let [ ] 1 0 T P 1 = 0 I n 1 2u 1 u, u 1 C n, u 1 = 1. 1 Then, A 1 := P 1 AP 1 = (I 2u 1 u 1)A(I 2u 1 u 1) = A u 1 (2u 1A 2(u 1Au 1 )u 1) (2Au }{{} 1 2u 1 (u 1Au 1 )) u 1 }{{} v1 v 1 = A u 1 v 1 v 1 u 1.

Large scale eigenvalue problems, Lecture 5, March 23, 2016 6/30 The symmetric QR algorithm Reduction to tridiagonal form (cont.) In the k-th step of the reduction we similarly have A k = Pk A k 1P k = A k 1 u k 1 vk 1 v k 1u k 1, where the last n k elements of u k 1 and v k 1 are nonzero. Essential computation in the kth step: v k 1 = 2A k 1 u k 1 2u k 1 (u k 1 A k 1u k 1 ) which costs 2(n k) 2 + O(n k) flops. Altogether, the reduction to tridiagonal form costs n 1 ( 4(n k) 2 + O(n k) ) = 4 3 n3 + O(n 2 ) flops. k=1

arge scale eigenvalue problems, Lecture 5, March 23, 2016 7/30 The symmetric QR algorithm The explicit tridiagonal QR algorithm In the explicit form, a QR step is essentially 1: Choose a shift µ 2: Compute the QR factorization A µi = QR 3: Update A by A = RQ + µi. Of course, this is done by means of plane rotations and by respecting the symmetric tridiagonal structure of A. Shifting strategies: Rayleigh quotient shifts, Wilkinson shifts

Large scale eigenvalue problems, Lecture 5, March 23, 2016 8/30 The symmetric QR algorithm The implicit tridiagonal QR algorithm In the more elegant implicit form of the algorithm we first compute the first Givens rotation G 0 = G(1, 2, ϑ) of the QR factorization that zeros the (2, 1) element of A µi, [ ] [ ] [ ] c s a11 µ =, s c a 21 0 c = cos(ϑ 0 ), s = sin(ϑ 0 ). (2) Performing a similarity transformation with G 0 we have (n = 5) + G0 AG 0 = A = +

Large scale eigenvalue problems, Lecture 5, March 23, 2016 9/30 The symmetric QR algorithm The implicit tridiagonal QR algorithm (cont.) Similarly as with the double step Hessenberg QR algorithm we chase the bulge down the diagonal. A G 0 = G(1, 2, ϑ 0 ) G 2 = G(3, 4, ϑ 2 ) + + 0 + 0 + G 1 = G(2, 3, ϑ 1 ) G 3 = G(4, 5, ϑ 3 ) 0 + 0 + 0 0

Large scale eigenvalue problems, Lecture 5, March 23, 2016 10/30 The symmetric QR algorithm The implicit tridiagonal QR algorithm (cont.) The full step is given by A = Q AQ, Q = G 0 G 1 G n 2. Because G k e 1 = e 1 for k > 0 we have Q e 1 = G 0 G 1 G n 2 e 1 = G 0 e 1. Both explicit and implicit QR step form the same first plane rotation G 0. By referring to the Implicit Q Theorem we see that explicit and implicit QR step compute essentially the same A.

arge scale eigenvalue problems, Lecture 5, March 23, 2016 11/30 The symmetric QR algorithm Symm. tridiag. QR algo with Wilkinson shifts 1: Let T R n n be a symmetric tridiagonal matrix with diagonal entries a 1,..., a n and off-diagonal entries b 2,..., b n. This algorithm computes the eigenvalues λ 1,..., λ n of T and corresponding eigenvectors q 1,..., q n. The eigenvalues are stored in a 1,..., a n. The eigenvectors are stored in the matrix Q, such that TQ = Q diag(a 1,..., a n ). 2: m = n {Actual problem dimension. m is reduced in the convergence check.} 3: while m > 1 do 4: d := (a m 1 a m )/2; {Compute Wilkinson s shift} 5: if d = 0 then 6: s := a m b m ;

Large scale eigenvalue problems, Lecture 5, March 23, 2016 12/30 The symmetric QR algorithm Symm. tridiag. QR algo with Wilkinson shifts (cont.) 7: else 8: s := a m bm/(d 2 + sign(d) d 2 + bm); 2 9: end if 10: x := a(1) s; {Implicit QR step begins here} 11: y := b(2); 12: for k = 1 to m 1 do 13: if m > 2 then 14: [c, s] := givens(x, y); 15: else [ ] [ ] [ ] c s a1 b 16: Determine [c, s] such that 2 c s s c b 2 a 2 s c is diagonal 17: end if 18: w := cx sy;

arge scale eigenvalue problems, Lecture 5, March 23, 2016 13/30 The symmetric QR algorithm Symm. tridiag. QR algo with Wilkinson shifts (cont.) 19: d := a k a k+1 ; z := (2cb k+1 + ds)s; 20: a k := a k z; a k+1 := a k+1 + z; 21: b k+1 := dcs + (c 2 s 2 )b k+1 ; 22: x := b k+1 ; 23: if k > 1 then 24: b k := w; 25: end if 26: if k < m 1 then 27: y := sb k+2 ; b k+2 := cb k+2 ; 28: end if [ ] c s 29: Q 1:n;k:k+1 := Q 1:n;k:k+1 ; s c 30: end for{implicit QR step ends here} 31: if b m < ε( a m 1 + a m ) then {Check for convergence}

Large scale eigenvalue problems, Lecture 5, March 23, 2016 14/30 The symmetric QR algorithm Symm. tridiag. QR algo with Wilkinson shifts (cont.) 32: m := m 1; 33: end if 34: end while

The symmetric QR algorithm Remark on deflation a 1 b 2 b 2 a 2 b 3 T = b 3 a 3 0 0 a 4 b 5 b 5 a 5 b 6 b 6 a 6 Shift for next step is determined from second block. First plane rotation is determined from shift and first block! The implicit shift algorithm then chases the bulge down the diagonal. Procedure finishes already in row 4 because b 4 = 0. This shift does not improve convergence. Explicit QR algorithm converges rapidly, but first block is not treated properly arge scale eigenvalue problems, Lecture 5, March 23, 2016 15/30

Large scale eigenvalue problems, Lecture 5, March 23, 2016 16/30 The symmetric QR algorithm Complexity of QR algorithm nonsymmetric case symmetric case without with without with Schurvectors eigenvectors transformation to 10 3 n3 14 3 n3 4 3 n3 8 3 n3 Hessenberg/tridiagonal form real double step Hessenberg/ 20 3 n3 50 3 n3 24 n 2 6 n 3 tridiagonal QR algorithm (2 steps per eigenvalues) total 10 n 3 25 n 3 4 3 n3 9 n 3

arge scale eigenvalue problems, Lecture 5, March 23, 2016 17/30 The QZ algorithm for Ax = λbx The QZ algorithm for Ax = λbx Theorem (Generalized Schur decomposition) Let A, B C n n. Then there are unitary matrices Q and Z such that Q AZ = T and Q BZ = S are both upper triangular matrices. If for some k, t kk = s kk = 0 then σ(a; B) = C. Otherwise, { } tii σ(a; B) = s ii 0. s ii Remark: (1) It is possible that σ(a; B). This is equivalent with 0 σ(b; A). (2) There is a real version of this theorem. There T is quasi-upper triangular and S is upper triangular.

Large scale eigenvalue problems, Lecture 5, March 23, 2016 18/30 The QZ algorithm for Ax = λbx Proof. Let B k a sequence of nonsingular matrices converging to B. Let Qk (AB 1 k )Q k = R k, k 0, the Schur decomposition of AB 1 k. Let Z k be unitary and Zk (B 1 k Q k) = S 1 k upper triangular. Then Q k AZ kz k B 1 k Q k = R k = Q k AZ k = R k S k is upper triangular. Bolzano Weierstrass: the sequence {(Q k, Z k )} has convergent subsequence, lim(q ki, Z ki ) = (Q, Z). Q, Z are unitary and Q AZ, Q BZ are upper triangular. Statement on eigenvalues follows from det(a λb) = det(qz ) n (t ii λs ii ). i=1

Large scale eigenvalue problems, Lecture 5, March 23, 2016 19/30 The QZ algorithm for Ax = λbx The QZ algorithm: step 1 Step 1: Reduction to Hessenberg-triangular form. Transform B into upper triangular form (QR factorization of B) A U A =, B U B = 0 0

arge scale eigenvalue problems, Lecture 5, March 23, 2016 20/30 The QZ algorithm for Ax = λbx The QZ algorithm: step 1 (cont.) Transform A into Hessenberg form by a sequence of Givens rotations w/o destroying the zero pattern of B A Q 45A =, B Q 45B = 0 0 0 0 0 + A AZ 45 =, B BZ 45 = 0 0

arge scale eigenvalue problems, Lecture 5, March 23, 2016 21/30 The QZ algorithm for Ax = λbx The QZ algorithm: step 1 (cont.) A Q 34A =, B Q 34B = 0 0 0 0 + A AZ 34 =, B BZ 34 = 0 0

arge scale eigenvalue problems, Lecture 5, March 23, 2016 22/30 The QZ algorithm for Ax = λbx The QZ algorithm: step 1 (cont.) A Q 23A =, B Q 23B = 0 + A AZ 23 =, B BZ 23 = Now the first column of A has the desired structure. Proceed similarly with columns 2 to n 2. 0 0

Large scale eigenvalue problems, Lecture 5, March 23, 2016 23/30 The QZ algorithm for Ax = λbx The QZ algorithm: step 2 Step 2: Deflation. Let us assume 1. that A is an irreducible Hessenberg matrix and 2. that B is a nonsingular upper triangular matrix. If 1. is not satisfied, e.g. a k+1,k = 0, then ( ) A11 λb A λb = 11 A 12 λb 12 0 A 22 λb 22 and we can treat the smaller problems A 11 λb 11 and A 22 λb 22 individually.

arge scale eigenvalue problems, Lecture 5, March 23, 2016 24/30 The QZ algorithm for Ax = λbx The QZ algorithm: step 2 (cont.) If 2. is not satisfied, then b k,k = 0 for some k. A = 0 0, B = We chase the zero down the diagonal of B: A Q 34A = 0 +, B Q 34B =

arge scale eigenvalue problems, Lecture 5, March 23, 2016 25/30 The QZ algorithm for Ax = λbx The QZ algorithm: step 2 (cont.) A AZ 23 = 0 0, B BZ 23 = A Q 45A = 0 0, B Q 45B = 0 0 + 0 0 0 0 0

Large scale eigenvalue problems, Lecture 5, March 23, 2016 26/30 The QZ algorithm for Ax = λbx The QZ algorithm: step 2 (cont.) A AZ 34 = 0 0, B BZ 34 = 0 0 + 0 0 0 0 0 A AZ 45 = 0 0, B B = BZ 45 0 0 + 0 0 0 + 0 0 0 0 0

arge scale eigenvalue problems, Lecture 5, March 23, 2016 27/30 The QZ algorithm for Ax = λbx The QZ algorithm: step 2 Step 3: QZ step. We now consider the pair (A, B) satisfing assumptions 1 and 2. We execute an iteration that corresponds to a QR algorithm applied to AB 1. We look at a single step of the QR algorithm. We want to modify A and B, Ā λ B = Q (A λb) Z, Q, Z unitary. with Ā Hessenberg and B upper triangular. Ā B 1 is the matrix that is obtained by one step of the QR algorithm applied to AB 1.

Large scale eigenvalue problems, Lecture 5, March 23, 2016 28/30 The QZ algorithm for Ax = λbx The QZ algorithm: step 2 (cont.) Set M := AB 1. M is Hessenberg. Let v = (M ai )(M bi )e 1 where a and b are the eigenvalues of the trailing 2 2 block of M. (v can be computed in O(1) flops.) Let P 0 be the Householder reflector with P 0 v = ± v e 1. Then, A = P 0 A = + 0 0, B = P 0B + + +

arge scale eigenvalue problems, Lecture 5, March 23, 2016 29/30 The QZ algorithm for Ax = λbx The QZ algorithm: step 2 (cont.) Now we restore the Hessenberg-triangular form: A AZ 1 Z 2 = + + +, B BZ 1Z 2 = 0 0 A P 2 P 1 A = 0 0, B P 2P 1 B = 0 + 0 + + and so on, until the bulge drops out at the end of the matrix.

Large scale eigenvalue problems, Lecture 5, March 23, 2016 30/30 References References [1] G. H. Golub and C. F. van Loan. Matrix Computations. The Johns Hopkins University Press, Baltimore, MD, 4th ed., 2012.