Direct methods for symmetric eigenvalue Algorithms problems - - PowerPoint PPT Presentation

direct methods for symmetric eigenvalue
SMART_READER_LITE
LIVE PREVIEW

Direct methods for symmetric eigenvalue Algorithms problems - - PowerPoint PPT Presentation

CES 703/5 Imre P olik Outline Introduction Direct methods for symmetric eigenvalue Algorithms problems Eigenvalues of a tridiagonal matrix Conclusion Literature Imre P olik, PhD McMaster University School of Computational


slide-1
SLIDE 1

CES 703/5 Imre P´

  • lik

Outline Introduction Algorithms Eigenvalues of a tridiagonal matrix Conclusion Literature

Direct methods for symmetric eigenvalue problems

Imre P´

  • lik, PhD

McMaster University School of Computational Engineering and Science

February 4, 2008

slide-2
SLIDE 2

CES 703/5 Imre P´

  • lik

Outline Introduction Algorithms Eigenvalues of a tridiagonal matrix Conclusion Literature

Outline

1

Introduction Theoretical background Posing the question Perturbation theory

2

Algorithms Direct and iterative methods Transformation to tridiagonal form Counting the eigenvalues Finding the eigenvectors

3

Eigenvalues of a tridiagonal matrix QR method Divide and conquer Bisection with inverse iteration Jacobi method

4

Conclusion

slide-3
SLIDE 3

CES 703/5 Imre P´

  • lik

Outline Introduction

Theoretical background Posing the question Perturbation theory

Algorithms Eigenvalues of a tridiagonal matrix Conclusion Literature

Theoretical background (A is real, symmetric)

Eigenvalue: Ax = λx A − λI is singular n eigenvalues (with multiplicities) Characteristic polynomial: p(λ) = det(A − λI) If QT Q = I then A and QT AQ have the same eigenvalues If P is nonsingular then A and P T AP have the same inertia Eigendecomposition (Avi = λivi): A =

n

  • i=1

λivivT

i

The vis should be orthogonal

slide-4
SLIDE 4

CES 703/5 Imre P´

  • lik

Outline Introduction

Theoretical background Posing the question Perturbation theory

Algorithms Eigenvalues of a tridiagonal matrix Conclusion Literature

Posing the question

Find all the eigenvalues Find some eigenvalues Find largest/smallest eigenvalue(s) Find largest/smallest magnitude eigenvalue(s) Find eigenvalue(s) around a given number Find the corresponding eigenvectors Find the eigenvalues in [α, β] Count the eigenvalues in [α, β]

slide-5
SLIDE 5

CES 703/5 Imre P´

  • lik

Outline Introduction

Theoretical background Posing the question Perturbation theory

Algorithms Eigenvalues of a tridiagonal matrix Conclusion Literature

Perturbation theory

Eigenvalues are well-conditioned (Weyl) |λi(A) − λi(A + E)| ≤ E2 Eigenvectors can be ill-conditioned   2 1 ε ε 1     2 1 1 + ε   Problem: distance between eigenvalues Problem: small eigenvalues Shifting: λ(A − αI) = λ(A) − α

slide-6
SLIDE 6

CES 703/5 Imre P´

  • lik

Outline Introduction Algorithms

Direct and iterative methods Transformation to tridiagonal form Counting the eigenvalues Finding the eigenvectors

Eigenvalues of a tridiagonal matrix Conclusion Literature

Direct and iterative methods

Eigenvalues are roots of polynomials Every method has to iterate Direct

transforms the matrix to a simpler form (tridiagonal) finds all the eigenvalues and eigenvectors (almost) always works converges quickly

Iterative

  • nly multiplication by A or AT

does not access the elements of A

  • nly a few eigenvectors/values
slide-7
SLIDE 7

CES 703/5 Imre P´

  • lik

Outline Introduction Algorithms

Direct and iterative methods Transformation to tridiagonal form Counting the eigenvalues Finding the eigenvectors

Eigenvalues of a tridiagonal matrix Conclusion Literature

Tridiagonalization (Hessenberg reduction)

Householder reflections

1 I − 2uuT

  • Q

    ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗    

  • A

=     ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗    

With this Q, due to symmetry:

QAQ =     ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗    

Cost 4

3n3, or 8 3n3 if Q is needed for the eigenvectors

LAPACK: ssytrd, Matlab: hess

slide-8
SLIDE 8

CES 703/5 Imre P´

  • lik

Outline Introduction Algorithms

Direct and iterative methods Transformation to tridiagonal form Counting the eigenvalues Finding the eigenvectors

Eigenvalues of a tridiagonal matrix Conclusion Literature

Count the eigenvalues in [α, β)

Factorize A − αI = LαDαLT

α

Number of negative eigenvalues in Dα gives the number

  • f eigenvalues of A that are smaller than α

Factorize A − βI = LβDβLT

β

Number of negative eigenvalues in Dβ gives the number

  • f eigenvalues of A that are smaller than β

The difference gives the number of eigenvalues in [α, β) Cost: two LDL factorizations (can exploit structure)

slide-9
SLIDE 9

CES 703/5 Imre P´

  • lik

Outline Introduction Algorithms

Direct and iterative methods Transformation to tridiagonal form Counting the eigenvalues Finding the eigenvectors

Eigenvalues of a tridiagonal matrix Conclusion Literature

Finding the eigenvectors

Solve (A − λI)v = 0

λ is only approximate extremely ill-conditioned system

  • nly if λ is an exact eigenvalue

Inverse iteration

repeat wi+1 = (A − αI)−1vi vi+1 = wi+1 wi+12 fast convergence can be modified to find the eigenvalues, too

slide-10
SLIDE 10

CES 703/5 Imre P´

  • lik

Outline Introduction Algorithms Eigenvalues of a tridiagonal matrix

QR method Divide and conquer Bisection with inverse iteration Jacobi method

Conclusion Literature

Eigenvalues of a tridiagonal matrix

1

Introduction

2

Algorithms

3

Eigenvalues of a tridiagonal matrix QR method Divide and conquer Bisection with inverse iteration Jacobi method

4

Conclusion

slide-11
SLIDE 11

CES 703/5 Imre P´

  • lik

Outline Introduction Algorithms Eigenvalues of a tridiagonal matrix

QR method Divide and conquer Bisection with inverse iteration Jacobi method

Conclusion Literature

QR method

Factor Ai = QiRi, set Ai+1 = RiQi, repeat Shifting: Ai − αiI = QiRi, Ai+1 = RiQi + αiI If αi is close to an eigenvalue then convergence is fast (quadratic) Fastest method for eigenvalues Fastest method for eigenvectors if n ≤ 25 Total cost: 4

3n3 + O(n2), cubic! convergence

LAPACK: xSTEQR, xSTERF, Matlab: eig

slide-12
SLIDE 12

CES 703/5 Imre P´

  • lik

Outline Introduction Algorithms Eigenvalues of a tridiagonal matrix

QR method Divide and conquer Bisection with inverse iteration Jacobi method

Conclusion Literature

QR method – Choosing the shift

A =        a1 c1 c1 a2 c2 ... ... ... cn−2 an−1 cn−1 cn−1 an        Single shift: α = an Wilkinson shift: α is the eigenvalue of an−1 cn−1 cn−1 an

  • closest to an
slide-13
SLIDE 13

CES 703/5 Imre P´

  • lik

Outline Introduction Algorithms Eigenvalues of a tridiagonal matrix

QR method Divide and conquer Bisection with inverse iteration Jacobi method

Conclusion Literature

Divide and conquer

Partition the tridiagonal matrix into two halves Solve the smaller problems recursively Assemble the results Cost: O(n2.3) on average Fastest method for eigenvectors if n ≥ 25 Not easy to implement in a stable way Efficiently parallelizable LAPACK: xSTEVD

slide-14
SLIDE 14

CES 703/5 Imre P´

  • lik

Outline Introduction Algorithms Eigenvalues of a tridiagonal matrix

QR method Divide and conquer Bisection with inverse iteration Jacobi method

Conclusion Literature

Bisection with inverse iteration

Count the eigenvalues in [α, β) Bisect the interval, count the eigenvalues in the subintervals, then repeat LDLT is too expensive in general ⇒ Transform A to tridiagonal form first Cost: O(nk) for k eigenvalues Excellent parallelization Only linear convergence (due to bisection) Compute eigenvectors with inverse iteration LAPACK: xSTEBZ, xSTEIN

slide-15
SLIDE 15

CES 703/5 Imre P´

  • lik

Outline Introduction Algorithms Eigenvalues of a tridiagonal matrix

QR method Divide and conquer Bisection with inverse iteration Jacobi method

Conclusion Literature

Jacobi method

Transform A to (almost) diagonal form Zero out ajk, j = k with Givens rotation

  • cos θ

− sin θ sin θ cos θ T Ajj Ajk Akj Akk cos θ − sin θ sin θ cos θ

  • =
  • λ1

λ2

  • Costs O(n) flops per rotation

How to choose Ajk?

  • ff(A) :=
  • j<k

A2

jk

  • ff(A′)2 = off(A)2 − A2

jk

Always the largest Ajk: too expensive Row-wise: cheap but still efficient (5-10 sweeps) In general Jacobi is too slow, but very accurate

slide-16
SLIDE 16

CES 703/5 Imre P´

  • lik

Outline Introduction Algorithms Eigenvalues of a tridiagonal matrix Conclusion Literature

Conclusion

Transform A to tridiagonal form Only eigenvalues: use QR Eigenvalues and eigenvectors: use D&C Small eigenvalues with high accuracy: use Jacobi Eigenvalues in [α, β): use bisection Most algorithms are available in LAPACK

slide-17
SLIDE 17

CES 703/5 Imre P´

  • lik

Outline Introduction Algorithms Eigenvalues of a tridiagonal matrix Conclusion Literature

  • Z. Bai, J. Demmel, J. Dongarra, A. Ruhe, and H. van der

Vorst, editors. Templates for the Solution of Algebraic Eigenvalue Problems: A Practical Guide. SIAM, Philadelphia, 2000. James W. Demmel. Applied Numerical Linear Algebra. SIAM, Philadelphia, 1997.