Residual Arnoldi Method
for solving large eigenvalue problems
Che-Rung Lee
roger@umd.edu
University of Maryland, College Park
Outline
• Introduction • Theory • Experiments • ConclusionIntroduction
• Eigenproblem
• Subspace methods
• Krylov subspace and the Arnoldi process • Problems of the Arnoldi process
• Residual Arnoldi method
University of Maryland, College Park
Eigenproblem
• Let A be a matrix of order n. If a scalar λ and a
nonzero vector x satisfy
Ax = λx,
• λ is an eigenvalue of A, and
• x is the corresponding (right) eigenvector. • (λ, x) is called an eigenpair.
• Eigenproblem: find all or some eigenpairs of A.
Eigenproblem
• Let A be a matrix of order n. If a scalar λ and a
nonzero vector x satisfy
Ax = λx,
• λ is an eigenvalue of A, and
• x is the corresponding (right) eigenvector. • (λ, x) is called an eigenpair.
• Eigenproblem: find all or some eigenpairs of A. • In this presentation, we assume that kxk = 1, and
University of Maryland, College Park
Subspace methods
• When A is large (and maybe sparse), subspace
methods are usually used.
• Steps
1. Generate a subspace.
2. Extract approximations from that subspace. 3. Convergence test.
Krylov subspace
• Given an unit vector u1. The Krylov subspace
Kk(A, u1) is a subspace spanned by
u1, Au1, . . . , Ak−1u1.
• A Krylov subspace usually contains good
approximations to the eigenvectors corresponding to the eigenvalues on the edge of spectrum.
University of Maryland, College Park
The Arnoldi process
• Algorithm that generates orthonormal bases of a
series of Krylov subspaces.
The Arnoldi process
• Algorithm that generates orthonormal bases of a
series of Krylov subspaces.
• Steps
1. U1 = u1
2. For i=1, 2, . . .
3. Compute v = Aui
4. Orthogonalization: ui+1 = (I − UiUi∗)v 5. Normalization : ui+1 = ui+1/kui+1k
University of Maryland, College Park
The Arnoldi process
• Algorithm that generates orthonormal bases of a
series of Krylov subspaces.
• Steps
1. U1 = u1
2. For i=1, 2, . . .
3. Compute v = Aui
4. Orthogonalization: ui+1 = (I − UiUi∗)v 5. Normalization : ui+1 = ui+1/kui+1k
6. Expand U by u : Ui+1 = (Ui ui+1)
• Arnoldi relation: AUk = UkHk + βkuk+1e∗
k.
Problem of the Arnoldi process
• When there are errors in the computation of Au,
convergence will stagnate.
University of Maryland, College Park
Problem of the Arnoldi process
• When there are errors in the computation of Au,
convergence will stagnate.
• Example: Let A be a 100 × 100 nonsymmetric
matrix with eigenvalues 1, 0.95, . . . , 0.9599.
40 40
Problem of the Arnoldi process
• When there are errors in the computation of Au,
convergence will stagnate.
• Example: Let A be a 100 × 100 nonsymmetric
matrix with eigenvalues 1, 0.95, . . . , 0.9599.
0 10 20 30 40 10−15 10−10 10−5 100 40
University of Maryland, College Park
Problem of the Arnoldi process
• When there are errors in the computation of Au,
convergence will stagnate.
• Example: Let A be a 100 × 100 nonsymmetric
matrix with eigenvalues 1, 0.95, . . . , 0.9599.
0 10 20 30 40 10−15 10−10 10−5 100 10 20 30 40 10−15 10−10 10−5 100
x-axis: dimension of subspace. y-axis: error. Add relative error ǫ = 10−3 to Au.
Residual Arnoldi method
• Subspace is expanded by residuals.
• Let (µ, z) be an eigenpair approximation. Its
residual is r = Az − µz.
• The pair (µ, z) is called a candidate.
University of Maryland, College Park
Residual Arnoldi method
• Subspace is expanded by residuals.
• Let (µ, z) be an eigenpair approximation. Its
residual is r = Az − µz.
• The pair (µ, z) is called a candidate.
0 10 20 30 40 10−15 10−10 10−5 100 40
Residual Arnoldi method
• Subspace is expanded by residuals.
• Let (µ, z) be an eigenpair approximation. Its
residual is r = Az − µz.
• The pair (µ, z) is called a candidate.
0 10 20 30 40 10−15 10−10 10−5 100 0 10 20 30 40 10−15 10−10 10−5 100 3
University of Maryland, College Park
Change candidate
• What happens if we select a different candidate
during the computation?
40
Change candidate
• What happens if we select a different candidate
during the computation?
• Example: candidate is changed at iteration 30.
0 10 20 30 40
10−15 10−10 10−5 100
University of Maryland, College Park
Shift-invert enhancement
• Given a shift σ, the subspace is generated by the
following steps:
1. Select a candidate and compute its residual r. 2. Solve the linear system (A − σI)v = r.
3. Use v is subspace expansion
40
Shift-invert enhancement
• Given a shift σ, the subspace is generated by the
following steps:
1. Select a candidate and compute its residual r. 2. Solve the linear system (A − σI)v = r.
3. Use v is subspace expansion
• Example:
Use σ = 1.3 and
solve linear systems to precision 10−3. 0 10 20 30 40 10−15 10−10 10−5 100
University of Maryland, College Park
Theory
• Perturbation theory of eigenproblem • Algorithm of residual Arnoldi method • Residual Arnoldi relation
• The backward error • Convergence theory
• Shift-invert enhancement
Perturbation theory
• Let ˜A = A + E. For an eigenpair (λ, x) of A,
there exists an eigenpair (˜λ, ˜x) of ˜A, such that when kEk is small enough,
˜
λ ≃ λ + (y∗Ex) ˜
x ≃ x + X(λI − L)−1Y ∗Ex,
where (x X) is a nonsingular matrix, (y Y )∗ is its inverse, and L = Y ∗AX.
University of Maryland, College Park
Condition number
˜ λ ≃ λ + (y∗Ex) ˜ x ≃ x + X(λI − L)−1Y ∗Ex,Condition number
˜
λ ≃ λ + (y∗Ex) ˜
x ≃ x + X(λI − L)−1Y ∗Ex,
• cond(λ) = kykkxk, and
University of Maryland, College Park
Condition number
˜ λ ≃ λ + (y∗Ex) ˜ x ≃ x + X(λI − L)−1Y ∗Ex,• cond(λ) = kykkxk, and
cond(x) = sep−1(λ, L) = k(λI − L)−1k.
• Therefore, |˜λ − λ| ≤ cond(λ)kEk
k˜x − xk ≤ C1cond(x)kEk.
Condition number
˜
λ ≃ λ + (y∗Ex) ˜
x ≃ x + X(λI − L)−1Y ∗Ex,
• cond(λ) = kykkxk, and
cond(x) = sep−1(λ, L) = k(λI − L)−1k.
• Therefore, |˜λ − λ| ≤ cond(λ)kEk
k˜x − xk ≤ C1cond(x)kEk.
• If E has some special structure, kExk ≪ kEk,
|˜λ − λ| ≤ cond(λ)kExk
University of Maryland, College Park
Start from the algorithm
1. Compute an eigenpair approximation
2. Compute its residual (inexactly).
3. Orthogonalize residual against Uk
Start from the algorithm
1. Compute an eigenpair approximation
• Using Rayleigh–Ritz method.
• Rayleigh quotient: Hk = U∗
k AUk.
• Ritz pair: (µk, Ukyk), where Hkyk = µkyk.
2. Compute its residual (inexactly).
University of Maryland, College Park
Start from the algorithm
1. Compute an eigenpair approximation
• Using Rayleigh–Ritz method.
• Rayleigh quotient: Hk = U∗
k AUk.
• Ritz pair: (µk, Ukyk), where Hkyk = µkyk.
2. Compute its residual (inexactly).
• r˜k = rk + fk = AUkyk − µkUkyk + fk.
• Relative error condition: kfkk ≤ ǫkrkk.
3. Orthogonalize residual against Uk
Start from the algorithm
1. Compute an eigenpair approximation
• Using Rayleigh–Ritz method.
• Rayleigh quotient: Hk = U∗
k AUk.
• Ritz pair: (µk, Ukyk), where Hkyk = µkyk.
2. Compute its residual (inexactly).
• r˜k = rk + fk = AUkyk − µkUkyk + fk.
• Relative error condition: kfkk ≤ ǫkrkk.
3. Orthogonalize residual against Uk
• rk + f⊥
k = Ukgk + βkuk+1e∗k
• f⊥
University of Maryland, College Park
Residual Arnoldi relation
For i = 1, · · · , k
• Put all yi into an upper triangular matrix Yk • Put all µi into a diagonal matrix Mk
• Put all gi and βi (except βk) into an upper
Hessenberg matrix Gk
• Put all f⊥
k into Fk.
Residual Arnoldi relation
For i = 1, · · · , k
• Put all yi into an upper triangular matrix Yk • Put all µi into a diagonal matrix Mk
• Put all gi and βi (except βk) into an upper
Hessenberg matrix Gk • Put all f⊥ k into Fk. AUk + FkYk−1 = Uk(Gk + YkMk)Yk−1 + βk ηk uk+1eTk
University of Maryland, College Park
Residual Arnoldi relation
For i = 1, · · · , k
• Put all yi into an upper triangular matrix Yk • Put all µi into a diagonal matrix Mk
• Put all gi and βi (except βk) into an upper
Hessenberg matrix Gk • Put all f⊥ k into Fk. AUk + FkYk−1 = Uk(Gk + YkMk)Yk−1 + βk ηk uk+1eTk • (Gk + YkMk)Y −1 k is upper Hessenberg.
Backward error
University of Maryland, College Park
Backward error
AUk + FkYk−1 = Uk(Gk + YkMk)Yk−1 + βηkk uk+1eTk • Let Ek = FkY −1 k Uk∗. (A + Ek)Uk = Uk(Gk + YkMk)Yk−1 + βk ηk uk+1e T k .Backward error
AUk + FkYk−1 = Uk(Gk + YkMk)Yk−1 + βηkk uk+1eTk • Let Ek = FkY −1 k Uk∗. (A + Ek)Uk = Uk(Gk + YkMk)Yk−1 + βk ηk uk+1e T k .• By the uniqueness of Arnoldi relation, Ek is the
backward error of the residual Arnoldi method, and Uk spans a Krylov subspace of A + Ek.
University of Maryland, College Park
Backward error
AUk + FkYk−1 = Uk(Gk + YkMk)Yk−1 + βηkk uk+1eTk • Let Ek = FkY −1 k Uk∗. (A + Ek)Uk = Uk(Gk + YkMk)Yk−1 + βk ηk uk+1e T k .• By the uniqueness of Arnoldi relation, Ek is the
backward error of the residual Arnoldi method, and Uk spans a Krylov subspace of A + Ek.
• Empirically, kEkk is around the level of ǫ. With
that, we can prove kEkxk ≤ C2ǫkrkk.
Some notation
Let (˜λk, ˜xk) be an eigenpair of A + Ek corresponding to (λ, x) of A, and let (˜µk, ˜zk) be the candidate
University of Maryland, College Park
Convergence theory
Some assumptions for our proof.
Convergence theory
Some assumptions for our proof.
University of Maryland, College Park
Convergence theory
Some assumptions for our proof.
1. The target eigenpair (λ, x) is simple.
2. There exists a constant C3 > 0 such that
sep−1(µk, L) < C3.
• Matrix L = X∗AX, where X is an
orthonormal basis of span{I − xx∗}.
Convergence theory
Some assumptions for our proof.
1. The target eigenpair (λ, x) is simple.
2. There exists a constant C3 > 0 such that
sep−1(µk, L) < C3.
• Matrix L = X∗AX, where X is an
orthonormal basis of span{I − xx∗}.
3. There exists a positive constant C4 such that if
kEk ≤ C4, then there are descending constants
˜
κ1, ˜κ2, . . . independent of E, with limkκ˜k = 0
University of Maryland, College Park
Convergence theory
Some assumptions for our proof.
1. The target eigenpair (λ, x) is simple.
2. There exists a constant C3 > 0 such that
sep−1(µk, L) < C3.
• Matrix L = X∗AX, where X is an
orthonormal basis of span{I − xx∗}.
3. There exists a positive constant C4 such that if
kEk ≤ C4, then there are descending constants
˜
κ1, ˜κ2, . . . independent of E, with limkκ˜k = 0
such that k˜zk − ˜xkk ≤ ˜κk. 4. kEkk ≤ ǫC5.
Put everything together
• Perturbation theory: k˜xk − xk ≤ C6kEkxk. • Backward error: kEkxk ≤ C2ǫkrkk. • Assumption 3: k˜zk − ˜xkk ≤ ˜κk. • Residual bound: krkk ≤ 2kzk − xk. • Invariant property z˜k = zk.University of Maryland, College Park
Put everything together
• Perturbation theory: k˜xk − xk ≤ C6kEkxk. • Backward error: kEkxk ≤ C2ǫkrkk. • Assumption 3: k˜zk − ˜xkk ≤ ˜κk. • Residual bound: krkk ≤ 2kzk − xk. • Invariant property z˜k = zk. If ǫ ≤ 1/2C2C6, krkk ≤ 2˜κk 1 − 2C2C6ǫ .
Shift-invert enhancement
• Let S = (A − σI)−1 and Tk = (σI − Mk)−1Y −1
k .
The SIRA relation is
SUk+FkTk = Uk(Hk−Yk)Tk+
βk
(σ − µk)ηk
University of Maryland, College Park
Shift-invert enhancement
• Let S = (A − σI)−1 and Tk = (σI − Mk)−1Y −1
k .
The SIRA relation is
SUk+FkTk = Uk(Hk−Yk)Tk+ βk (σ − µk)ηk uk+1eTk . • Backward error Ek = FkTkU∗ k .
Shift-invert enhancement
• Let S = (A − σI)−1 and Tk = (σI − Mk)−1Y −1
k .
The SIRA relation is
SUk+FkTk = Uk(Hk−Yk)Tk+ βk (σ − µk)ηk uk+1eTk . • Backward error Ek = FkTkU∗ k .
University of Maryland, College Park
Shift-invert enhancement
• Let S = (A − σI)−1 and Tk = (σI − Mk)−1Y −1
k .
The SIRA relation is
SUk+FkTk = Uk(Hk−Yk)Tk+ βk (σ − µk)ηk uk+1eTk . • Backward error Ek = FkTkU∗ k .
• We can prove that kEkxk ≤ C8ǫkrkk. • If ǫ < 1/C9 for some constant C9, then
krkk ≤
2˜κk 1 − C9ǫ
.
Experiments
• RAPACK
• Compare with ARPACK • Compare with SRRIT • Inexact Krylov method
University of Maryland, College Park
RAPACK
• A numerical package implementing the residual
Arnoldi method.
RAPACK
• A numerical package implementing the residual
Arnoldi method.
University of Maryland, College Park
RAPACK
• A numerical package implementing the residual
Arnoldi method.
• Two computational modes: RA and SIRA. • Uses reverse communication to get matrix
operation results.
RAPACK
• A numerical package implementing the residual
Arnoldi method.
• Two computational modes: RA and SIRA. • Uses reverse communication to get matrix
operation results.
• Implements Krylov Schur restarting method for
University of Maryland, College Park
RAPACK
• A numerical package implementing the residual
Arnoldi method.
• Two computational modes: RA and SIRA. • Uses reverse communication to get matrix
operation results.
• Implements Krylov Schur restarting method for
memory management.
• Allows an arbitrary initial subspace.
ARPACK
University of Maryland, College Park
ARPACK
• Implements implicitly restarted Arnoldi method. • Can solve standard eigenproblems, generalized
eigenproblems, and singular value
decompositions for symmetric, nonsymmetric and complex matrices.
ARPACK
• Implements implicitly restarted Arnoldi method. • Can solve standard eigenproblems, generalized
eigenproblems, and singular value
decompositions for symmetric, nonsymmetric and complex matrices.
• Four computational modes.
• Mode 1: Standard eigenproblem.
• Mode 2: Generalized eigenproblem.
University of Maryland, College Park
ARPACK
• Implements implicitly restarted Arnoldi method. • Can solve standard eigenproblems, generalized
eigenproblems, and singular value
decompositions for symmetric, nonsymmetric and complex matrices.
• Four computational modes.
• Mode 1: Standard eigenproblem.
• Mode 2: Generalized eigenproblem.
• Mode 3, 4: With shift-invert enhancement. • We only compare mode 1 with the RA mode and
mode 3 with the SIRA mode.
Test problem
• A real nonsymmetric eigenmat A of order 10000. • First 100 eigenvalues are 1, 0.95, · · · , 0.9599. • Other eigenvalues are in (0.25, 0.75).
University of Maryland, College Park
Test problem
• A real nonsymmetric eigenmat A of order 10000. • First 100 eigenvalues are 1, 0.95, · · · , 0.9599. • Other eigenvalues are in (0.25, 0.75).
• The condition number is around 105. • Tasks
• Compute 6 largest eigenvalues using mode 1
of ARPACK and the RA mode of RAPACK.
• Compute 6 smallest eigenvalues using mode 3
of ARPACK and the SIRA mode of RAPACK.
Test problem
• A real nonsymmetric eigenmat A of order 10000. • First 100 eigenvalues are 1, 0.95, · · · , 0.9599. • Other eigenvalues are in (0.25, 0.75).
• The condition number is around 105. • Tasks
• Compute 6 largest eigenvalues using mode 1
of ARPACK and the RA mode of RAPACK.
• Compute 6 smallest eigenvalues using mode 3
of ARPACK and the SIRA mode of RAPACK.
• Setting
• Maximum dimension of subspace 20. • Convergence precision 10−13.
University of Maryland, College Park
Mode 1 and the RA mode
Mode 1 RA mode ETime (second) 4.6860 8.4242
MVM 113 138
Let xi be the ith eigen-vector of A. The error is measured by kxi − U U∗xik. 0 50 100 150 10−15 10−10 10−5 100
Mode 3 and the SIRA mode
Use GMRES to solve linear systems with shift=0.
Mode 3 SIRA mode
Etime (second) 378 168
MVM 11842 4606
Outer iterations 68 144 Precision for solving 10−13 10−3
University of Maryland, College Park
Mode 3 and the SIRA mode
Use GMRES to solve linear systems with shift=0.
Mode 3 SIRA mode
Etime (second) 378 168
MVM 11842 4606
Outer iterations 68 144 Precision for solving 10−13 10−3
20 40 60 80 100 120 0 50 100 150 200 250 150
Mode 3 and the SIRA mode
Use GMRES to solve linear systems with shift=0.
Mode 3 SIRA mode
Etime (second) 378 168
MVM 11842 4606
Outer iterations 68 144 Precision for solving 10−13 10−3
50 100 150 200 250 10−10 10−5 100
University of Maryland, College Park
SRRIT
• Implements Schur–Rayleigh–Ritz iteration
method.
• Can compute the dominant invariant subspace.
• Can use an arbitrary subspace to start the process.
SRRIT
• Implements Schur–Rayleigh–Ritz iteration
method.
• Can compute the dominant invariant subspace.
• Can use an arbitrary subspace to start the process. • Compare it with the RA mode for using an
existing subspace as initialization.
• Use matrix S = A−1, where A is previously
defined, to compute 6 smallest eigenvalues.
University of Maryland, College Park
Successive inner-outer process
Properties of Krylov subspaces 1. Stagnate around error level 2. Invariant convergent curves 3. Superlinear convergence 0 10 20 30 40 10−15 10−10 10−5 100 1.e−3 1.e−6 1.e−9 1.e−12
Successive inner-outer process
Properties of Krylov subspaces 1. Stagnate around error level 2. Invariant convergent curves 3. Superlinear convergence 0 10 20 30 40 10−15 10−10 10−5 100 1.e−3 1.e−6 1.e−9 1.e−12 Algorithm:
1. Divide the process into 4 stages with increasing precision requirement 10−3, 10−6, 10−9, 10−12. 2. Stage i computes matrix-vector multiplication
(solves linear system) to precision ǫi.
3. Each stage uses previously generated subspace as an initial subspace.
University of Maryland, College Park
SRRIT and the RA mode
Stage 10−3 10−6 10−9 10−12 Total SRRIT 305 120 152 213 783 RA mode 39 40 40 34 153 50 100 150 10−10 10−5 100
Inexact Krylov method
• Allows increasing errors in matrix-vector
University of Maryland, College Park
Inexact Krylov method
• Allows increasing errors in matrix-vector
multiplication.
• Implemented in the RA mode with S = A−1, and
tolerable error size max ǫ, mkrǫτ
i −1k
ǫ: relative error
τ : convergence precision
m: maximum number of subspace ri: residual in the ith iteration
Inexact Krylov method
• Allows increasing errors in matrix-vector
multiplication.
• Implemented in the RA mode with S = A−1, and
tolerable error size max ǫ, mkrǫτ
i −1k
ǫ: relative error (=10−3) τ : convergence precision (=10−12) m: maximum number of subspace (=50)
University of Maryland, College Park
Inexact Krylov method
• Allows increasing errors in matrix-vector
multiplication.
• Implemented in the RA mode with S = A−1, and
tolerable error size max ǫ, mkrǫτ
i −1k
ǫ: relative error (=10−3) τ : convergence precision (=10−12) m: maximum number of subspace (=50)
ri: residual in the ith iteration
• Compare it with mode 3 and the SIRA mode to
compute 6 smallest eigenvalues of A.
Result of inexact Krylov method
Inexact Mode 3 SIRA
Etime 80 106 48
TMVM 5240 7083 2829 Iteration 43 50 89
University of Maryland, College Park
Result of inexact Krylov method
Inexact Mode 3 SIRA
Etime 80 106 48 TMVM 5240 7083 2829 Iteration 43 50 89 20 40 60 80 0 50 100 150 Inexact Krylov Mode 3 SIRA Mode 0 10 20 30 40 50 10−15 10−10 10−5 100
Conclusion
• Residual Arnoldi method for eigenproblems
allows errors in the computation, and can work on an appropriate initial subspace.
University of Maryland, College Park
Conclusion
• Residual Arnoldi method for eigenproblems
allows errors in the computation, and can work on an appropriate initial subspace.
• With shift-invert enhancement, residual Arnoldi
method can reduce a lot of computational cost.
Conclusion
• Residual Arnoldi method for eigenproblems
allows errors in the computation, and can work on an appropriate initial subspace.
• With shift-invert enhancement, residual Arnoldi
method can reduce a lot of computational cost.
• RAPACK can compute few selected eigenpairs
for real matrices efficiently, and only requires moderate memory.
University of Maryland, College Park
Conclusion
• Residual Arnoldi method for eigenproblems
allows errors in the computation, and can work on an appropriate initial subspace.
• With shift-invert enhancement, residual Arnoldi
method can reduce a lot of computational cost.
• RAPACK can compute few selected eigenpairs
for real matrices efficiently, and only requires moderate memory.
• Many other algorithms can be implemented in
RAPACK and get better performance.
Future work
• Block residual Arnoldi method.
• Using other eigenvector approximations, such as
refine Ritz vector or harmonic Ritz vector.
• More inexact Krylov subspace methods. • Extension of RAPACK to solve other
eigenproblems, such as generalized eigenproblem.
• Parallelization of RAPACK.