Innumerical analysis, one of the most important problems is designing efficient andstablealgorithms for finding theeigenvalues of amatrix. Theseeigenvalue algorithms may also find eigenvectors.
Given ann ×nsquare matrixA ofreal orcomplex numbers, aneigenvalueλ and its associatedgeneralized eigenvectorv are a pair obeying the relation[1]
wherev is a nonzeron × 1 column vector,I is then ×nidentity matrix,k is a positive integer, and bothλ andv are allowed to be complex even whenA is real. Whenk = 1, the vector is called simply aneigenvector, and the pair is called aneigenpair. In this case,Av =λv. Any eigenvalueλ ofA has ordinary[note 1] eigenvectors associated to it, for ifk is the smallest integer such that(A −λI)kv = 0 for a generalized eigenvectorv, then(A −λI)k−1v is an ordinary eigenvector. The valuek can always be taken as less than or equal ton. In particular,(A −λI)nv = 0 for all generalized eigenvectorsv associated withλ.
For each eigenvalueλ ofA, thekernelker(A −λI) consists of all eigenvectors associated withλ (along with 0), called theeigenspace ofλ, while the vector spaceker((A −λI)n) consists of all generalized eigenvectors, and is called thegeneralized eigenspace. Thegeometric multiplicity ofλ is the dimension of its eigenspace. Thealgebraic multiplicity ofλ is the dimension of its generalized eigenspace. The latter terminology is justified by the equation
wheredet is thedeterminant function, theλi are all the distinct eigenvalues ofA and theαi are the corresponding algebraic multiplicities. The functionpA(z) is thecharacteristic polynomial ofA. So the algebraic multiplicity is the multiplicity of the eigenvalue as azero of the characteristic polynomial. Since any eigenvector is also a generalized eigenvector, the geometric multiplicity is less than or equal to the algebraic multiplicity. The algebraic multiplicities sum up ton, the degree of the characteristic polynomial. The equationpA(z) = 0 is called thecharacteristic equation, as its roots are exactly the eigenvalues ofA. By theCayley–Hamilton theorem,A itself obeys the same equation:pA(A) = 0.[note 2] As a consequence, the columns of the matrix must be either 0 or generalized eigenvectors of the eigenvalueλj, since they are annihilated by. In fact, thecolumn space is the generalized eigenspace ofλj.
Any collection of generalized eigenvectors of distinct eigenvalues is linearly independent, so a basis for all ofCn can be chosen consisting of generalized eigenvectors. More particularly, this basis{vi}n
i=1 can be chosen and organized so that
If these basis vectors are placed as the column vectors of a matrixV = [v1v2 ⋯vn], thenV can be used to convertA to itsJordan normal form:
where theλi are the eigenvalues,βi = 1 if(A −λi+1)vi+1 =vi andβi = 0 otherwise.
More generally, ifW is any invertible matrix, andλ is an eigenvalue ofA with generalized eigenvectorv, then(W−1AW −λI)kW−kv = 0. Thusλ is an eigenvalue ofW−1AW with generalized eigenvectorW−kv. That is,similar matrices have the same eigenvalues.
TheadjointM* of a complex matrixM is the transpose of the conjugate ofM:M* =MT. A square matrixA is callednormal if it commutes with its adjoint:A*A =AA*. It is calledHermitian if it is equal to its adjoint:A* =A. All Hermitian matrices are normal. IfA has only real elements, then the adjoint is just the transpose, andA is Hermitian if and only if it issymmetric. When applied to column vectors, the adjoint can be used to define the canonical inner product onCn:w ⋅v =w*v.[note 3] Normal, Hermitian, and real-symmetric matrices have several useful properties:
It is possible for a real or complex matrix to have all real eigenvalues without being Hermitian. For example, a realtriangular matrix has its eigenvalues along its diagonal, but in general is not symmetric.
Any problem of numeric calculation can be viewed as the evaluation of some functionf for some inputx. Thecondition numberκ(f,x) of the problem is the ratio of the relative error in the function's output to the relative error in the input, and varies with both the function and the input. The condition number describes how error grows during the calculation. Its base-10 logarithm tells how many fewer digits of accuracy exist in the result than existed in the input. The condition number is a best-case scenario. It reflects the instability built into the problem, regardless of how it is solved. No algorithm can ever produce more accurate results than indicated by the condition number, except by chance. However, a poorly designed algorithm may produce significantly worse results. For example, as mentioned below, the problem of finding eigenvalues for normal matrices is always well-conditioned. However, the problem of finding the roots of a polynomial can bevery ill-conditioned. Thus eigenvalue algorithms that work by finding the roots of the characteristic polynomial can be ill-conditioned even when the problem is not.
For the problem of solving the linear equationAv =b whereA is invertible, thematrix condition numberκ(A−1,b) is given by||A||op||A−1||op, where|| ||op is theoperator norm subordinate to the normalEuclidean norm onCn. Since this number is independent ofb and is the same forA andA−1, it is usually just called the condition numberκ(A) of the matrixA. This valueκ(A) is also the absolute value of the ratio of the largestsingular value ofA to its smallest. IfA isunitary, then||A||op = ||A−1||op = 1, soκ(A) = 1. For general matrices, the operator norm is often difficult to calculate. For this reason, othermatrix norms are commonly used to estimate the condition number.
For the eigenvalue problem,Bauer and Fike proved that ifλ is an eigenvalue for adiagonalizablen ×n matrixA witheigenvector matrixV, then the absolute error in calculatingλ is bounded by the product ofκ(V) and the absolute error inA.[2]As a result, the condition number for findingλ isκ(λ,A) =κ(V) = ||V ||op ||V−1||op. IfA is normal, thenV is unitary, andκ(λ,A) = 1. Thus the eigenvalue problem for all normal matrices is well-conditioned.
The condition number for the problem of finding the eigenspace of a normal matrixA corresponding to an eigenvalueλ has been shown to be inversely proportional to the minimum distance betweenλ and the other distinct eigenvalues ofA.[3] In particular, the eigenspace problem for normal matrices is well-conditioned for isolated eigenvalues. When eigenvalues are not isolated, the best that can be hoped for is to identify the span of all eigenvectors of nearby eigenvalues.
The most reliable and most widely used algorithm for computing eigenvalues isJohn G. F. Francis' andVera N. Kublanovskaya'sQR algorithm, considered one of the top ten algorithms of 20th century.[4]
Any monic polynomial is the characteristic polynomial of itscompanion matrix. Therefore, a general algorithm for finding eigenvalues could also be used to find the roots of polynomials. TheAbel–Ruffini theorem shows that any such algorithm for dimensions greater than 4 must either be infinite, or involve functions of greater complexity than elementary arithmetic operations and fractional powers. For this reason algorithms that exactly calculate eigenvalues in a finite number of steps only exist for a few special classes of matrices. For general matrices, algorithms areiterative, producing better approximate solutions with each iteration.
Some algorithms produce every eigenvalue, others will produce a few, or only one. However, even the latter algorithms can be used to find all eigenvalues. Once an eigenvalueλ of a matrixA has been identified, it can be used to either direct the algorithm towards a different solution next time, or to reduce the problem to one that no longer hasλ as a solution.
Redirection is usually accomplished by shifting: replacingA withA −μI for some constantμ. The eigenvalue found forA −μI must haveμ added back in to get an eigenvalue forA. For example, forpower iteration,μ =λ. Power iteration finds the largest eigenvalue in absolute value, so even whenλ is only an approximate eigenvalue, power iteration is unlikely to find it a second time. Conversely,inverse iteration based methods find the lowest eigenvalue, soμ is chosen well away fromλ and hopefully closer to some other eigenvalue.
Reduction can be accomplished by restrictingA to the column space of the matrixA −λI, whichA carries to itself. SinceA -λI is singular, the column space is of lesser dimension. The eigenvalue algorithm can then be applied to the restricted matrix. This process can be repeated until all eigenvalues are found.
If an eigenvalue algorithm does not produce eigenvectors, a common practice is to use an inverse iteration based algorithm withμ set to a close approximation to the eigenvalue. This will quickly converge to the eigenvector of the closest eigenvalue toμ. For small matrices, an alternative is to look at the column space of the product ofA −λ'I for each of the other eigenvaluesλ'.
A formula for the norm of unit eigenvector components of normal matrices was discovered by Robert Thompson in 1966 and rediscovered independently by several others.[5][6][7][8][9]IfA is an normal matrix with eigenvaluesλi(A) and corresponding unit eigenvectorsvi whose component entries arevi,j, letAj be the matrix obtained by removing thei-th row and column fromA, and letλk(Aj) be itsk-th eigenvalue. Then
If are the characteristic polynomials of and, the formula can be re-written asassuming the derivative is not zero at.
Because the eigenvalues of a triangular matrix are its diagonal elements, for general matrices there is no finite method likegaussian elimination to convert a matrix to triangular form while preserving eigenvalues. But it is possible to reach something close to triangular. Anupper Hessenberg matrix is a square matrix for which all entries below thesubdiagonal are zero. A lower Hessenberg matrix is one for which all entries above thesuperdiagonal are zero. Matrices that are both upper and lower Hessenberg aretridiagonal. Hessenberg and tridiagonal matrices are the starting points for many eigenvalue algorithms because the zero entries reduce the complexity of the problem. Several methods are commonly used to convert a general matrix into a Hessenberg matrix with the same eigenvalues. If the original matrix was symmetric or Hermitian, then the resulting matrix will be tridiagonal.
When only eigenvalues are needed, there is no need to calculate the similarity matrix, as the transformed matrix has the same eigenvalues. If eigenvectors are needed as well, the similarity matrix may be needed to transform the eigenvectors of the Hessenberg matrix back into eigenvectors of the original matrix.
| Method | Applies to | Produces | Cost without similarity matrix | Cost with similarity matrix | Description |
|---|---|---|---|---|---|
| Householder transformations | General | Hessenberg | 2n3⁄3 +O(n2)[10]: 474 | 4n3⁄3 +O(n2)[10]: 474 | Reflect each column through a subspace to zero out its lower entries. |
| Givens rotations | General | Hessenberg | 4n3⁄3 +O(n2)[10]: 470 | Apply planar rotations to zero out individual entries. Rotations are ordered so that later ones do not cause zero entries to become non-zero again. | |
| Arnoldi iteration | General | Hessenberg | Perform Gram–Schmidt orthogonalization on Krylov subspaces. | ||
| Lanczos algorithm | Hermitian | Tridiagonal | Arnoldi iteration for Hermitian matrices, with shortcuts. |
For symmetric tridiagonal eigenvalue problems all eigenvalues (without eigenvectors) can be computed numerically in time O(n log(n)), using bisection on the characteristic polynomial.[11]
Iterative algorithms solve the eigenvalue problem by producing sequences that converge to the eigenvalues. Some algorithms also produce sequences of vectors that converge to the eigenvectors. Most commonly, the eigenvalue sequences are expressed as sequences of similar matrices which converge to a triangular or diagonal form, allowing the eigenvalues to be read easily. The eigenvector sequences are expressed as the corresponding similarity matrices.
| Method | Applies to | Produces | Cost per step | Convergence | Description |
|---|---|---|---|---|---|
| Lanczos algorithm | Hermitian | m largest/smallest eigenpairs | |||
| Power iteration | general | eigenpair with largest value | O(n2) | linear | Repeatedly applies the matrix to an arbitrary starting vector and renormalizes. |
| Inverse iteration | general | eigenpair with value closest toμ | linear | Power iteration for(A −μI)−1 | |
| Rayleigh quotient iteration | Hermitian | any eigenpair | cubic | Power iteration for(A −μiI)−1, whereμi for each iteration is the Rayleigh quotient of the previous iteration. | |
| Preconditioned inverse iteration[12] orLOBPCG algorithm | positive-definite real symmetric | eigenpair with value closest toμ | Inverse iteration using apreconditioner (an approximate inverse toA). | ||
| Bisection method | real symmetric tridiagonal | any eigenvalue | linear | Uses thebisection method to find roots of the characteristic polynomial, supported by the Sturm sequence. | |
| Laguerre iteration | real symmetric tridiagonal | any eigenvalue | cubic[13] | UsesLaguerre's method to find roots of the characteristic polynomial, supported by the Sturm sequence. | |
| QR algorithm | Hessenberg | all eigenvalues | O(n2) | cubic | FactorsA =QR, whereQ is orthogonal andR is triangular, then applies the next iteration toRQ. |
| all eigenpairs | 6n3 +O(n2) | ||||
| Jacobi eigenvalue algorithm | real symmetric | all eigenvalues | O(n3) | quadratic | Uses Givens rotations to attempt clearing all off-diagonal entries. This fails, but strengthens the diagonal. |
| Divide-and-conquer | Hermitian tridiagonal | all eigenvalues | O(n2) | Divides the matrix into submatrices that are diagonalized then recombined. | |
| all eigenpairs | (4⁄3)n3 +O(n2) | ||||
| Homotopy method | real symmetric tridiagonal | all eigenpairs | O(n2)[14] | Constructs a computable homotopy path from a diagonal eigenvalue problem. | |
| Folded spectrum method | real symmetric | eigenpair with value closest toμ | Preconditioned inverse iteration applied to(A −μI)2 | ||
| MRRR algorithm[15] | real symmetric tridiagonal | some or all eigenpairs | O(n2) | "Multiple relatively robust representations" – performs inverse iteration on aLDLT decomposition of the shifted matrix. | |
| Gram iteration[16] | general | Eigenpair with largest eigenvalue | super-linear | Repeatedly computes the Gram product and rescales, deterministically. |
While there is no simple algorithm to directly calculate eigenvalues for general matrices, there are numerous special classes of matrices where eigenvalues can be directly calculated. These include:
Since the determinant of atriangular matrix is the product of its diagonal entries, ifT is triangular, then. Thus the eigenvalues ofT are its diagonal entries.
Ifp is any polynomial andp(A) = 0, then the eigenvalues ofA also satisfy the same equation. Ifp happens to have a known factorization, then the eigenvalues ofA lie among its roots.
For example, aprojection is a square matrixP satisfyingP2 =P. The roots of the corresponding scalar polynomial equation,λ2 =λ, are 0 and 1. Thus any projection has 0 and 1 for its eigenvalues. The multiplicity of 0 as an eigenvalue is thenullity ofP, while the multiplicity of 1 is the rank ofP.
Another example is a matrixA that satisfiesA2 =α2I for some scalarα. The eigenvalues must be±α. The projection operators
satisfy
and
Thecolumn spaces ofP+ andP− are the eigenspaces ofA corresponding to+α and−α, respectively.
For dimensions 2 through 4, formulas involving radicals exist that can be used to find the eigenvalues. While a common practice for 2×2 and 3×3 matrices, for 4×4 matrices the increasing complexity of theroot formulas makes this approach less attractive.
For the 2×2 matrix
the characteristic polynomial is
Thus the eigenvalues can be found by using thequadratic formula:
Defining to be the distance between the two eigenvalues, it is straightforward to calculate
with similar formulas forc andd. From this it follows that the calculation is well-conditioned if the eigenvalues are isolated.
Eigenvectors can be found by exploiting theCayley–Hamilton theorem. Ifλ1,λ2 are the eigenvalues, then(A −λ1I)(A −λ2I) = (A −λ2I)(A −λ1I) = 0, so the columns of(A −λ2I) are annihilated by(A −λ1I) and vice versa. Assuming neither matrix is zero, the columns of each must include eigenvectors for the other eigenvalue. (If either matrix is zero, thenA is a multiple of the identity and any non-zero vector is an eigenvector.)
For example, suppose
thentr(A) = 4 − 3 = 1 anddet(A) = 4(−3) − 3(−2) = −6, so the characteristic equation is
and the eigenvalues are 3 and -2. Now,
In both matrices, the columns are multiples of each other, so either column can be used. Thus,(1, −2) can be taken as an eigenvector associated with the eigenvalue -2, and(3, −1) as an eigenvector associated with the eigenvalue 3, as can be verified by multiplying them byA.
The characteristic equation of a symmetric 3×3 matrixA is:
This equation may be solved using the methods ofCardano orLagrange, but an affine change toA will simplify the expression considerably, and lead directly to atrigonometric solution. IfA =pB +qI, thenA andB have the same eigenvectors, andβ is an eigenvalue ofB if and only ifα =pβ +q is an eigenvalue ofA. Letting and, gives
The substitutionβ = 2cosθ and some simplification using the identitycos 3θ = 4cos3θ − 3cosθ reduces the equation tocos 3θ = det(B) / 2. Thus
Ifdet(B) is complex or is greater than 2 in absolute value, the arccosine should be taken along the same branch for all three values ofk. This issue doesn't arise whenA is real and symmetric, resulting in a simple algorithm:[17]
% Given a real symmetric 3x3 matrix A, compute the eigenvalues% Note that acos and cos operate on angles in radiansp1=A(1,2)^2+A(1,3)^2+A(2,3)^2if(p1==0)% A is diagonal.eig1=A(1,1)eig2=A(2,2)eig3=A(3,3)elseq=trace(A)/3% trace(A) is the sum of all diagonal valuesp2=(A(1,1)-q)^2+(A(2,2)-q)^2+(A(3,3)-q)^2+2*p1p=sqrt(p2/6)B=(1/p)*(A-q*I)% I is the identity matrixr=det(B)/2% In exact arithmetic for a symmetric matrix -1 <= r <= 1% but computation error can leave it slightly outside this range.if(r<=-1)phi=pi/3elseif(r>=1)phi=0elsephi=acos(r)/3end% the eigenvalues satisfy eig3 <= eig2 <= eig1eig1=q+2*p*cos(phi)eig3=q+2*p*cos(phi+(2*pi/3))eig2=3*q-eig1-eig3% since trace(A) = eig1 + eig2 + eig3end
Once again, the eigenvectors ofA can be obtained by recourse to theCayley–Hamilton theorem. Ifα1,α2,α3 are distinct eigenvalues ofA, then(A −α1I)(A −α2I)(A −α3I) = 0. Thus the columns of the product of any two of these matrices will contain an eigenvector for the third eigenvalue. However, ifα3 =α1, then(A −α1I)2(A −α2I) = 0 and(A −α2I)(A −α1I)2 = 0. Thus thegeneralized eigenspace ofα1 is spanned by the columns ofA −α2I while the ordinary eigenspace is spanned by the columns of(A −α1I)(A −α2I). The ordinary eigenspace ofα2 is spanned by the columns of(A −α1I)2.
For example, let
The characteristic equation is
with eigenvalues 1 (of multiplicity 2) and -1. Calculating,
and
Thus(−4, −4, 4) is an eigenvector for −1, and(4, 2, −2) is an eigenvector for 1.(2, 3, −1) and(6, 5, −3) are both generalized eigenvectors associated with 1, either one of which could be combined with(−4, −4, 4) and(4, 2, −2) to form a basis of generalized eigenvectors ofA. Once found, the eigenvectors can be normalized if needed.
If a 3×3 matrix is normal, then the cross-product can be used to find eigenvectors. If is an eigenvalue of, then the null space of is perpendicular to its column space. Thecross product of two independent columns of will be in the null space. That is, it will be an eigenvector associated with. Since the column space is two dimensional in this case, the eigenspace must be one dimensional, so any other eigenvector will be parallel to it.
If does not contain two independent columns but is not0, the cross-product can still be used. In this case is an eigenvalue of multiplicity 2, so any vector perpendicular to the column space will be an eigenvector. Suppose is a non-zero column of. Choose an arbitrary vector not parallel to. Then and will be perpendicular to and thus will be eigenvectors of.
This does not work when is not normal, as the null space and column space do not need to be perpendicular for such matrices.