1. Home
  2. Explore
  3. Mathematics
  4. Computing Eigenvalues and Singular Values

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Computing Eigenvalues and Singular Values

Computing Eigenvalues and Singular Values with Orthogonal Factorizations

Large matrices often contain far more information than is needed for a particular computation. For example, a matrix may be millions by millions, yet a problem may require only a few of its eigenvalues or singular values. Numerical linear algebra develops algorithms that preserve the important mathematical quantities while transforming the matrix into a much easier form.

Two central ideas are:

  1. Similarity transformations preserve eigenvalues.
  2. Orthogonal transformations on the left and right preserve singular values.

The QR factorization provides the foundation for both types of algorithms.

Eigenvalues and Similarity Transformations

An eigenvalue λ\lambdaλ of a matrix AAA is a number for which there is a nonzero vector vvv satisfying

Av=λv.Av=\lambda v.Av=λv.

The vector vvv is an eigenvector. Eigenvalues describe directions in which a matrix acts by simple scaling rather than by changing the direction of a vector.

When computing eigenvalues numerically, the goal is not necessarily to find a closed-form formula. Instead, the goal is to transform the matrix into a form whose eigenvalues are easy to read while making sure that the eigenvalues do not change during the transformation.

Two matrices AAA and BBB are similar if there is an invertible matrix SSS such that

B=S−1AS.B=S^{-1}AS.B=S−1AS.

Similar matrices have exactly the same eigenvalues. This makes similarity transformations the natural tool for eigenvalue algorithms.

A similarity transformation changes the representation of a matrix without changing its eigenvalues.

Think About It

If two matrices represent the same linear transformation in different bases, why should their eigenvalues remain the same?

The QR Factorization

The QR factorization writes a matrix AAA as

A=QR,A=QR,A=QR,

where:

  • QQQ is orthogonal, so QTQ=IQ^TQ=IQTQ=I,
  • RRR is upper triangular.

The columns of QQQ form an orthonormal basis. The columns of the original matrix AAA may not be perpendicular, so a process such as Gram–Schmidt is used to replace them with orthogonal, normalized directions. The upper-triangular matrix RRR records how the original columns are expressed in terms of this new orthonormal basis.

Suppose the initial matrix is called A0A_0A0​. Its QR factorization is

A0=Q0R0.A_0=Q_0R_0.A0​=Q0​R0​.

The QR method then reverses the order of the factors:

A1=R0Q0.A_1=R_0Q_0.A1​=R0​Q0​.

The factorization is repeated:

A1=Q1R1,A2=R1Q1,A_1=Q_1R_1,\qquad A_2=R_1Q_1,A1​=Q1​R1​,A2​=R1​Q1​,

and so on.

The surprising fact is that every matrix in this sequence has the same eigenvalues.

Why the QR Iteration Preserves Eigenvalues

Starting from

A0=Q0R0,A_0=Q_0R_0,A0​=Q0​R0​,

multiply on the left by Q0TQ_0^TQ0T​. Since Q0T=Q0−1Q_0^T=Q_0^{-1}Q0T​=Q0−1​,

Q0TA0=R0.Q_0^TA_0=R_0.Q0T​A0​=R0​.

Therefore,

A1=R0Q0=Q0TA0Q0.A_1=R_0Q_0 =Q_0^TA_0Q_0.A1​=R0​Q0​=Q0T​A0​Q0​.

This has the form

A1=Q0−1A0Q0,A_1=Q_0^{-1}A_0Q_0,A1​=Q0−1​A0​Q0​,

so A1A_1A1​ is similar to A0A_0A0​. Consequently, A1A_1A1​ and A0A_0A0​ have the same eigenvalues. The same argument applies at every iteration.

The QR method therefore separates the problem into two tasks:

  1. Use QR factorization to create a new matrix.
  2. Reverse the factors to obtain a similar matrix with the same eigenvalues.

Why the Diagonal Eventually Reveals the Eigenvalues

For many matrices, repeated QR iterations cause entries below the main diagonal to become smaller and smaller. The matrix gradually approaches an upper-triangular form:

Ak≈[λ1∗∗0λ2∗00λ3].A_k\approx \begin{bmatrix} \lambda_1 & * & * \\ 0 & \lambda_2 & * \\ 0 & 0 & \lambda_3 \end{bmatrix}.Ak​≈​λ1​00​∗λ2​0​∗∗λ3​​​.

The eigenvalues of a triangular matrix are its diagonal entries. Since every AkA_kAk​ has the same eigenvalues as A0A_0A0​, the diagonal entries of the nearly triangular matrix provide approximations to the eigenvalues of the original matrix.

The entries below the diagonal may not become exactly zero in finite arithmetic, but once they are sufficiently small, the diagonal entries become accurate eigenvalue approximations.

This behavior is the key numerical phenomenon behind the QR algorithm. It is not simply a matter of solving a characteristic polynomial directly. Instead, the matrix is repeatedly transformed into a form in which the eigenvalues become visible.

A Small 2×22\times 22×2 Illustration

In a suitable 2×22\times 22×2 example involving cos⁡θ\cos\thetacosθ and sin⁡θ\sin\thetasinθ, one QR step can transform an off-diagonal entry involving sin⁡θ\sin\thetasinθ into one involving

sin⁡3θ.\sin^3\theta.sin3θ.

A later step produces approximately

sin⁡9θ,\sin^9\theta,sin9θ,

and the next produces approximately

sin⁡27θ.\sin^{27}\theta.sin27θ.

Thus, an off-diagonal quantity is raised successively to the powers 333, 999, and 272727. When its magnitude is less than 111, it approaches zero extremely rapidly. This behavior is called cubic convergence in the example.

The exact convergence behavior depends on the matrix, but the example illustrates why QR iteration can be remarkably effective.

The QR method preserves eigenvalues through similarity while driving the matrix toward a form whose diagonal displays those eigenvalues.

Shifted QR Iteration

The basic QR method can be made much faster by introducing a shift. A shift is a scalar multiple of the identity matrix, written as

sI.sI.sI.

Instead of factoring AkA_kAk​ directly, the shifted method factors

Ak−sI=QkRk.A_k-sI=Q_kR_k.Ak​−sI=Qk​Rk​.

It then reverses the factors and adds the shift back:

Ak+1=RkQk+sI.A_{k+1}=R_kQ_k+sI.Ak+1​=Rk​Qk​+sI.

The shift changes the location of the eigenvalues temporarily, but it does not change the eigenvectors.

If

A0v=λv,A_0v=\lambda v,A0​v=λv,

then

(A0−sI)v=A0v−sIv=λv−sv=(λ−s)v.(A_0-sI)v =A_0v-sIv =\lambda v-sv =(\lambda-s)v.(A0​−sI)v=A0​v−sIv=λv−sv=(λ−s)v.

Therefore:

  • The eigenvectors remain the same.
  • Every eigenvalue changes from λ\lambdaλ to λ−s\lambda-sλ−s.

If the shift sss is chosen close to an eigenvalue, that eigenvalue of Ak−sIA_k-sIAk​−sI becomes close to zero. This often accelerates the QR iteration and causes the corresponding part of the matrix to converge rapidly.

Why the Shifted Method Still Preserves Eigenvalues

Assume

Ak−sI=QkRk.A_k-sI=Q_kR_k.Ak​−sI=Qk​Rk​.

Then

Rk=QkT(Ak−sI).R_k=Q_k^T(A_k-sI).Rk​=QkT​(Ak​−sI).

The new matrix is

Ak+1=RkQk+sI.A_{k+1}=R_kQ_k+sI.Ak+1​=Rk​Qk​+sI.

Substituting the expression for RkR_kRk​ gives

Ak+1=QkT(Ak−sI)Qk+sI.A_{k+1} =Q_k^T(A_k-sI)Q_k+sI.Ak+1​=QkT​(Ak​−sI)Qk​+sI.

Expanding the shifted term,

Ak+1=QkTAkQk−sQkTQk+sI.A_{k+1} =Q_k^TA_kQ_k-sQ_k^TQ_k+sI.Ak+1​=QkT​Ak​Qk​−sQkT​Qk​+sI.

Because QkQ_kQk​ is orthogonal,

QkTQk=I.Q_k^TQ_k=I.QkT​Qk​=I.

Thus,

Ak+1=QkTAkQk−sI+sI=QkTAkQk.A_{k+1} =Q_k^TA_kQ_k-sI+sI =Q_k^TA_kQ_k.Ak+1​=QkT​Ak​Qk​−sI+sI=QkT​Ak​Qk​.

The shift cancels out. The resulting matrix is still similar to AkA_kAk​, so the eigenvalues are preserved.

A shift changes the temporary matrix being factored, but the shift is canceled after the factors are reversed and the shift is restored.

Think About It

Why would making one eigenvalue close to zero in the shifted matrix help the iteration converge more quickly?

Making QR Factorization Less Expensive

The main computational cost in the QR method is the QR factorization itself. Reversing the factors is comparatively inexpensive. Therefore, numerical algorithms try to transform the original matrix into a form containing many zeros before beginning repeated QR iterations.

The most useful general form is upper Hessenberg form.

An upper Hessenberg matrix has zeros below the first subdiagonal. Its pattern looks like

[∗∗∗∗∗∗∗∗0∗∗∗00∗∗].\begin{bmatrix} * & * & * & * \\ * & * & * & * \\ 0 & * & * & * \\ 0 & 0 & * & * \end{bmatrix}.​∗∗00​∗∗∗0​∗∗∗∗​∗∗∗∗​​.

It is almost upper triangular, but it retains one additional nonzero diagonal below the main diagonal.

A matrix can be reduced to upper Hessenberg form using orthogonal similarity transformations. Because these are similarity transformations, the eigenvalues remain unchanged.

The advantage is that the zeros in the Hessenberg structure remain in place during QR iteration. The algorithm therefore avoids operating on the entire dense matrix at every step. The number of nonzero entries and the amount of arithmetic are substantially reduced.

The complete practical strategy for a general matrix is therefore:

  1. Reduce the matrix to upper Hessenberg form using orthogonal similarity transformations.
  2. Apply shifted QR iterations to the Hessenberg matrix.
  3. Read the eigenvalues from the resulting diagonal or diagonal blocks.

The Special Advantage of Symmetric Matrices

A matrix AAA is symmetric if

AT=A.A^T=A.AT=A.

Symmetric matrices receive special treatment because orthogonal transformations preserve symmetry. If a symmetric matrix is transformed by

A1=QTAQ,A_1=Q^TAQ,A1​=QTAQ,

then

A1T=(QTAQ)T=QTATQ=QTAQ=A1.A_1^T=(Q^TAQ)^T=Q^TA^TQ=Q^TAQ=A_1.A1T​=(QTAQ)T=QTATQ=QTAQ=A1​.

Thus, A1A_1A1​ is also symmetric.

Now combine symmetry with upper Hessenberg structure. An upper Hessenberg matrix has zeros below the first subdiagonal. Symmetry forces the corresponding entries above the first superdiagonal to be zero as well. The matrix therefore has nonzero entries only on:

  • the main diagonal,
  • the diagonal immediately above it,
  • the diagonal immediately below it.

Such a matrix is called tridiagonal:

[∗∗00∗∗∗00∗∗∗00∗∗].\begin{bmatrix} * & * & 0 & 0 \\ * & * & * & 0 \\ 0 & * & * & * \\ 0 & 0 & * & * \end{bmatrix}.​∗∗00​∗∗∗0​0∗∗∗​00∗∗​​.

For a symmetric matrix, the entries above and below the main diagonal are mirror images. Therefore, only about two sets of nnn numbers need to be stored rather than roughly n2n^2n2 entries.

The symmetric eigenvalue algorithm becomes:

  1. Reduce the symmetric matrix to symmetric tridiagonal form.
  2. Apply QR iteration with shifts while maintaining the tridiagonal structure.
  3. Extract the eigenvalues from the converged diagonal.

This is much faster than applying the general dense QR method.

A symmetric Hessenberg matrix is tridiagonal, so symmetry reduces the eigenvalue computation to a much more efficient problem.

Think About It

Why does symmetry turn an upper Hessenberg matrix into a tridiagonal matrix rather than leaving the entire upper Hessenberg pattern intact?

Why Direct Characteristic-Polynomial Methods Are Not Used

The eigenvalues of an n×nn\times nn×n matrix are roots of the characteristic equation

det⁡(A−λI)=0.\det(A-\lambda I)=0.det(A−λI)=0.

Although this equation is mathematically correct, directly computing the determinant and solving the resulting polynomial is a poor numerical strategy.

There are several reasons:

  • Determinant computation is unnecessarily slow for this purpose.
  • The determinant compresses information from many matrix entries into a small number of polynomial coefficients.
  • The polynomial coefficients can be extremely sensitive to small numerical errors.
  • Finding the roots of a high-degree polynomial can be ill-conditioned.

A major mathematical result associated with Abel states that, in general, polynomial equations of degree 555 or higher do not have solutions expressible by a simple formula using radicals. Consequently, one cannot expect a universal closed-form formula for the eigenvalues of a general matrix of size 5×55\times 55×5 or larger.

This does not mean that eigenvalues cannot be computed. It means that they are generally obtained through numerical iteration rather than through a simple finite symbolic formula.

The QR method can approximate eigenvalues to a desired tolerance. In contrast to a symbolic formula, it may require many small computational steps, but it provides accurate numerical answers. The overall work for dense problems is on the order of

n3n^3n3

operations, which is practical for matrices of moderate and large size.

Singular Values

The singular values of a matrix AAA are the nonnegative diagonal entries in its singular value decomposition, or SVD:

A=UΣVT,A=U\Sigma V^T,A=UΣVT,

where UUU and VVV are orthogonal and Σ\SigmaΣ is diagonal with nonnegative entries.

The singular values measure how strongly the matrix stretches different orthogonal directions. Unlike eigenvalues, singular values are defined for rectangular matrices as well as square matrices, and they are always real and nonnegative.

The singular values are related to the eigenvalues of ATAA^TAATA. If σi\sigma_iσi​ is a singular value, then

σi2\sigma_i^2σi2​

is an eigenvalue of ATAA^TAATA. Equivalently,

σi=λi(ATA).\sigma_i=\sqrt{\lambda_i(A^TA)}.σi​=λi​(ATA)​.

However, a numerical algorithm should not normally form ATAA^TAATA explicitly.

Why ATAA^TAATA Should Not Be Formed Directly

Although forming ATAA^TAATA gives a theoretical route to the singular values, it can be numerically undesirable. Multiplying a matrix by its transpose can worsen conditioning and can magnify the effects of rounding errors.

A better method transforms AAA directly using orthogonal matrices. Orthogonal transformations are numerically stable because they preserve lengths and do not magnify errors in the same way that arbitrary transformations can.

What Transformations Preserve Singular Values?

For eigenvalues, similarity transformations have the form

S−1AS.S^{-1}AS.S−1AS.

For singular values, the corresponding freedom is greater. A matrix can be multiplied on the left and right by different orthogonal matrices without changing its singular values.

Suppose

A=UΣVT.A=U\Sigma V^T.A=UΣVT.

Let Q1Q_1Q1​ and Q2Q_2Q2​ be orthogonal matrices. Then

Q1AQ2T=Q1UΣVTQ2T.Q_1AQ_2^T = Q_1U\Sigma V^TQ_2^T.Q1​AQ2T​=Q1​UΣVTQ2T​.

Because products of orthogonal matrices are orthogonal, both

Q1UQ_1UQ1​U

and

Q2VQ_2VQ2​V

are orthogonal. Therefore,

Q1AQ2T=(Q1U)Σ(Q2V)T.Q_1AQ_2^T = (Q_1U)\Sigma(Q_2V)^T.Q1​AQ2T​=(Q1​U)Σ(Q2​V)T.

The middle diagonal matrix Σ\SigmaΣ has not changed. Hence the singular values are unchanged.

Left and right multiplication by independent orthogonal matrices preserves the singular values.

This is more flexible than similarity because the orthogonal matrix on the left does not have to be related to the one on the right.

Think About It

Why does changing the orthogonal factors in an SVD leave the singular values unchanged as long as the diagonal matrix Σ\SigmaΣ stays the same?

Bidiagonal Reduction for the SVD

The additional freedom available for singular values allows a general matrix to be reduced further than a general eigenvalue problem.

Using orthogonal transformations on the left and right, a matrix can be reduced to bidiagonal form. A bidiagonal matrix has nonzero entries only on the main diagonal and one neighboring diagonal, for example:

B=[∗∗000∗∗000∗∗000∗].B= \begin{bmatrix} * & * & 0 & 0 \\ 0 & * & * & 0 \\ 0 & 0 & * & * \\ 0 & 0 & 0 & * \end{bmatrix}.B=​∗000​∗∗00​0∗∗0​00∗∗​​.

The reduction can be written conceptually as

B=Q1AQ2T,B=Q_1AQ_2^T,B=Q1​AQ2T​,

where Q1Q_1Q1​ and Q2Q_2Q2​ are orthogonal. Since these transformations preserve singular values, AAA and BBB have the same singular values.

The numerical SVD algorithm therefore has two main stages:

  1. Reduce AAA to bidiagonal form using orthogonal transformations.
  2. Apply an iterative method, related in spirit to QR iteration, to the bidiagonal matrix.

The bidiagonal structure makes each later step very fast because most entries are already zero.

The Connection Between Bidiagonal and Tridiagonal Matrices

If BBB is bidiagonal, then BTBB^TBBTB is symmetric tridiagonal. The zero pattern explains this relationship.

For example, each column of BBB overlaps with only nearby columns. When BTB^TBT multiplies BBB, entries far from the main diagonal receive no contributions and become zero. Thus,

BTBB^TBBTB

has the pattern

[∗∗00∗∗∗00∗∗∗00∗∗].\begin{bmatrix} * & * & 0 & 0 \\ * & * & * & 0 \\ 0 & * & * & * \\ 0 & 0 & * & * \end{bmatrix}.​∗∗00​∗∗∗0​0∗∗∗​00∗∗​​.

This matches the structure used in symmetric eigenvalue algorithms. In that sense:

  • Symmetric eigenvalue computation reduces a matrix to tridiagonal form.
  • Singular value computation reduces a matrix to bidiagonal form.
  • The square of the singular values corresponds to the eigenvalues of a symmetric tridiagonal matrix associated with the bidiagonal matrix.

The direct bidiagonal approach avoids explicitly forming ATAA^TAATA while retaining the same underlying mathematical relationship.

When Matrices Become Extremely Large: Krylov Methods

The dense QR and SVD algorithms are highly successful for matrices of moderate size, but they become too expensive when the matrix is extremely large. If a matrix has size one million by one million, storing and processing all of its entries may be impossible.

A different strategy is to work in a much smaller subspace. This is the central idea behind Krylov methods.

Start with a vector bbb and repeatedly multiply by AAA:

b,Ab,A2b,A3b,…b,\quad Ab,\quad A^2b,\quad A^3b,\quad \ldotsb,Ab,A2b,A3b,…

The resulting vectors span a Krylov subspace. After generating, for example, 100100100 such vectors, the subspace has the form

K100(A,b)=span⁡{b,Ab,A2b,…,A99b}.\mathcal{K}_{100}(A,b) = \operatorname{span} \left\{ b,Ab,A^2b,\ldots,A^{99}b \right\}.K100​(A,b)=span{b,Ab,A2b,…,A99b}.

These vectors may not be orthogonal, so Gram–Schmidt-type procedures are used to create a stable orthonormal basis for the subspace.

A vector in this subspace can be written approximately as

v≈c1b+c2Ab+c3A2b+⋯+c100A99b.v\approx c_1b+c_2Ab+c_3A^2b+\cdots+c_{100}A^{99}b.v≈c1​b+c2​Ab+c3​A2b+⋯+c100​A99b.

The approximation ignores components outside the chosen subspace.

Restricting the Large Matrix

Although AAA may have one million rows and columns, its action can be studied on the 100100100-dimensional Krylov subspace. The large eigenvalue problem is then replaced by a much smaller problem involving a 100×100100\times100100×100 matrix.

The smaller matrix describes how AAA acts on the selected subspace. Its eigenvalues provide approximations to some eigenvalues of the original matrix, provided the relevant eigenvectors are well represented inside the Krylov subspace.

This method is especially valuable when:

  • The original matrix is sparse.
  • Matrix-vector multiplication by AAA is relatively inexpensive.
  • Only a small number of eigenvalues or singular values are needed.
  • The full matrix is too large for dense QR methods.

The method does not automatically guarantee that the smallest 100100100 eigenvalues, or any particular set of eigenvalues, will be captured. Its success depends on how well the chosen starting vector and generated subspace represent the desired eigenvectors.

Krylov methods replace a huge matrix problem with a smaller projected problem built from repeated matrix-vector multiplication.

Think About It

Why might repeated multiplication by AAA reveal important eigenvector directions even though the entire matrix is never converted to a dense factorization?

How the Methods Fit Together

The main algorithms differ in the quantities they preserve and the forms to which they reduce matrices.

ProblemPreserved quantityInitial reductionIterative stage
General eigenvaluesEigenvalues under similarityUpper Hessenberg formShifted QR iteration
Symmetric eigenvaluesEigenvalues under orthogonal similarityTridiagonal formShifted QR iteration
Singular valuesSingular values under left/right orthogonal transformationsBidiagonal formQR-like iteration
Extremely large sparse eigenvalue problemApproximate eigenvalues in a subspaceKrylov subspaceSmall projected eigenvalue problem

The key computational principle is to create zeros before beginning the iterative work. These zeros reduce the cost of QR factorization and remain useful throughout later iterations.

Comprehensive Review

The QR method begins with a factorization

Ak=QkRkA_k=Q_kR_kAk​=Qk​Rk​

and forms the next matrix as

Ak+1=RkQk.A_{k+1}=R_kQ_k.Ak+1​=Rk​Qk​.

Because

Ak+1=QkTAkQk,A_{k+1}=Q_k^TA_kQ_k,Ak+1​=QkT​Ak​Qk​,

the new matrix is similar to the old one and therefore has the same eigenvalues. Repetition generally causes entries below the main diagonal to shrink, so the eigenvalues eventually appear on the diagonal.

A shifted QR step factors

Ak−sI=QkRkA_k-sI=Q_kR_kAk​−sI=Qk​Rk​

and forms

Ak+1=RkQk+sI.A_{k+1}=R_kQ_k+sI.Ak+1​=Rk​Qk​+sI.

The shift moves the temporary eigenvalues by −s-s−s, while adding it back restores similarity to the original matrix. A well-chosen shift can greatly accelerate convergence.

For efficiency, a general matrix is first reduced to upper Hessenberg form. A symmetric matrix remains symmetric under orthogonal similarity transformations, so symmetric Hessenberg form becomes tridiagonal. This makes symmetric eigenvalue computations especially efficient.

Singular values are the diagonal entries in

A=UΣVT.A=U\Sigma V^T.A=UΣVT.

They are the square roots of the eigenvalues of ATAA^TAATA, but numerical algorithms avoid explicitly forming ATAA^TAATA. Instead, independent orthogonal transformations on the left and right reduce AAA to bidiagonal form without changing its singular values.

Finally, when a matrix is too large for dense QR or SVD algorithms, Krylov methods generate a smaller subspace from

b,Ab,A2b,…b,Ab,A^2b,\ldotsb,Ab,A2b,…

and solve a reduced eigenvalue problem there. Across all these methods, the central strategy is to preserve the desired spectral information while transforming the matrix into a sparse, structured form that can be processed efficiently.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent