← Wiki Index / Computation & Algorithms / Lanczos Algorithm
💻 Computation & Algorithms

Lanczos Algorithm

The Lanczos algorithm is an iterative Krylov subspace method that reduces a large sparse symmetric or Hermitian matrix to a compact tridiagonal matrix in order to compute extremal eigenvalues and eigenvectors.

Lanczos algorithm is an iterative projection method in numerical linear algebra and scientific computing, devised by Cornelius Lanczos in 1950, that approximates the extremal eigenvalues and eigenvectors of a large, sparse symmetric real matrix A ∈ ℝn×n (or Hermitian complex matrix A ∈ ℂn×n). Rather than applying dense orthogonal similarity transformations directly to A—which would destroy sparsity and require O(n3) arithmetic operations and O(n2) memory—the Lanczos method constructs an orthonormal basis Qk = [q1, q2, …, qk] for the order-k Krylov subspace Kk(A, q1) = span{q1, Aq1, A2q1, …, Ak−1q1} using only matrix-vector multiplications v ↦ Av.

Because A is symmetric, the projected Rayleigh–Ritz matrix Tk = QkTAQk is both upper Hessenberg and symmetric, forcing Tk to be a symmetric tridiagonal matrix. As a consequence, generating each new basis vector qj+1 requires orthogonalizing Aqj against only the two most recent vectors qj and qj−1 via a three-term recurrence relation. This close structural relationship links the Lanczos process to the conjugate gradient method for symmetric positive-definite linear systems and distinguishes it from the Arnoldi iteration used inside the generalized minimal residual method for non-symmetric matrices.

Krylov Subspaces and the Three-Term Recurrence

Starting with a unit-norm starting vector q1 ∈ ℝn (‖q1‖2 = 1), setting β1 = 0 and q0 = 0, step j (for j = 1, 2, …, k) of the Lanczos iteration executes four vector operations:

  1. Matrix-vector product: wj = Aqj − βjqj−1
  2. Diagonal Rayleigh quotient: αj = qjTwj
  3. Orthogonal residual: rj = wj − αjqj
  4. Off-diagonal norm and normalization: βj+1 = ‖rj‖2; if βj+1 ≠ 0, set qj+1 = rj / βj+1.

In compact matrix form, after k steps the Lanczos vectors satisfy the Lanczos decomposition:

AQk = QkTk + βk+1qk+1ekT,

where ek is the k-th canonical unit vector of ℝk, and Tk ∈ ℝk×k is the symmetric tridiagonal matrix with main diagonal entries α1, …, αk and sub-/superdiagonal entries β2, …, βk. Each iteration requires one sparse matrix-vector product (costing O(nnz(A)) flops) plus O(n) vector arithmetic and storage for only three vectors of length n.

Ritz Values, Ritz Vectors, and Kaniel–Paige Convergence Theory

Let Tk = S Θ ST be the spectral decomposition of the small k × k tridiagonal matrix Tk, computed in O(k2) operations via the symmetric tridiagonal QR decomposition or divide-and-conquer eigensolver. The eigenvalues θ1, …, θk on the diagonal of Θ are called the Ritz values, and the lifted vectors yi = Qksi (where si is the i-th column of S) are the Ritz vectors. Crucially, the residual norm of each Ritz pair (θi, yi) can be evaluated without ever forming yi ∈ ℝn:

‖Ayi − θiyi‖2 = ‖(AQk − QkTk)si‖2 = βk+1 |ekTsi| = βk+1 |sk,i|,

meaning that convergence of the i-th Ritz pair is monitored directly from the bottom entry sk,i of the eigenvector of Tk. By the Kaniel–Paige–Saad convergence bound, which uses Chebyshev polynomials of degree k − 1 on the interior spectrum [λ2, λn], the largest eigenvalue λ1 is approximated with error decaying as O(e−4(k−1)√γ), where γ = (λ1 − λ2)/(λ2 − λn) is the relative spectral gap. Extremal eigenvalues at the top and bottom of the spectrum therefore emerge in k ≪ n iterations (often k ≈ 50–200 even when n > 107).

Loss of Orthogonality and Reorthogonalization Strategies

Although infinite-precision arithmetic ensures QkTQk = Ik, Christopher C. Paige proved in his landmark 1971 dissertation that in finite-precision floating-point arithmetic, loss of orthogonality among the Lanczos vectors is not a gradual random drift; instead, it occurs precisely as the first Ritz values converge to eigenvalues of A. Once a Ritz vector yi converges to accuracy εmach ‖A‖ / βk+1, rounding errors re-inject components along yi into subsequent vectors qj, spawning spurious duplicate "ghost" copies of already converged eigenvalues in Tk.

Three main remedies restore numerical stability in production eigensolvers:

Stabilization StrategyStorage CostOrthogonalization Work at Step kRepresentative Software & Variants
Full ReorthogonalizationO(nk) vectorsO(nk) flops against all q1, …, qjImplicitly Restarted Lanczos (ARPACK dsaupd)
Selective / Partial ReorthogonalizationO(nk) or converged subsetOrthogonalize only when ‖qjTyi‖ > √εmachPROPACK (Larsen), Parlett–Scott selective scheme
Cullum–Willoughby No-Reorthogonalization3 vectors (O(n))Zero extra work; filter ghost eigenvalues post hocUltra-scale quantum many-body diagonalization
Thick-Restart / Krylov–SchurO(nm) fixed subspace size mO(nm) flops per stepSLEPc, Trilinos Anasazi

Applications Across Quantum Physics, Data Science, and Structural Mechanics

Quantum Many-Body Hamiltonian Ground States

In condensed-matter physics, quantum chemistry, and lattice gauge theory, the Hamiltonian matrix H of an interacting spin or fermion system on a Hilbert space of dimension n = 2L (or 4L) is far too large to store as a dense matrix, yet applying H to a state vector ψ requires only O(L n) operations. The Lanczos algorithm extracts the ground-state energy E0 (lowest eigenvalue) and low-lying excitations in 50 to 300 matrix-vector products, serving as the core eigensolver inside Exact Diagonalization (ED) and the Density Matrix Renormalization Group (DMRG).

Golub–Kahan Lanczos Bidiagonalization for SVD and PCA

Applying the symmetric Lanczos process to the augmented matrix [0, A; AT, 0] or equivalently to ATA without explicitly forming the product yields Golub–Kahan Lanczos bidiagonalization, which constructs left and right orthonormal bases Uk and Vk reducing rectangular A ∈ ℝm×n to a k × k upper bidiagonal matrix Bk. This algorithm computes the top k singular values and vectors for large-scale principal component analysis, latent semantic indexing, and the LSQR iterative solver for ill-conditioned least-squares systems.

Shift-and-Invert Spectral Transformations

When interior eigenvalues near a target shift σ are needed—such as acoustic resonance modes in finite-element structural mechanics—running the Lanczos iteration on the shifted-and-inverted operator (A − σI)−1 maps eigenvalues λi ≈ σ to huge extremal eigenvalues (λi − σ)−1, where sparse LU decomposition or Cholesky decomposition factors A − σI once before the Lanczos loop.

Frequently Asked Questions

How does the Lanczos algorithm relate to the conjugate gradient method?

When A is symmetric positive-definite, the conjugate gradient method for solving Ax = b computes the unique vector xk ∈ Kk(A, r0) that solves the projected tridiagonal system Tkzk = ‖r0‖2 e1 with xk = Qkzk, updating xk via an implicit LDLT factorization of Tk.

Why does Lanczos fail to find the multiplicity of degenerate eigenvalues in a single run?

Because the cyclic Krylov subspace Kk(A, q1) generated by a single starting vector q1 can contain only one linearly independent eigenvector per distinct eigenvalue of A, single-vector Lanczos resolves only one copy of a degenerate eigenspace. Block Lanczos, which propagates a tall block Q1 ∈ ℝn×b of b orthogonal vectors simultaneously, resolves eigenspaces of multiplicity up to b.

References

  1. Lanczos, C. (1950). An iteration method for the solution of the eigenvalue problem of linear differential and integral operators. Journal of Research of the National Bureau of Standards, 45(4), 255–282. https://doi.org/10.6028/jres.045.026
  2. Paige, C. C. (1972). Computational variants of the Lanczos method for the eigenproblem. Journal of the Institute of Mathematics and Its Applications, 10(3), 373–381. https://doi.org/10.1093/imamat/10.3.373
  3. Parlett, B. N., & Scott, D. S. (1979). The Lanczos algorithm with selective orthogonalization. Mathematics of Computation, 33(145), 217–238. https://doi.org/10.1090/S0025-5718-1979-0514820-3
  4. Saad, Y. (2011). Numerical Methods for Large Eigenvalue Problems (Revised ed.). Society for Industrial and Applied Mathematics. https://doi.org/10.1137/1.9781611970739
🧬 Support Open Science
Explore interactive science games on LowKey Games or browse scientific apparel & accessories in the CRV Science Shop.
💡 Spot an inaccuracy or have primary literature to expand this article?
Submit a citation or revision note using your shared CRV Science / LowKey Games profile ID.
Suggest Revision