The Lanczos algorithm is an iterative method used to approximate the eigenvalues and eigenvectors of a real, symmetric matrix, A. It's particularly useful for large sparse matrices, which can be computationally expensive to diagonalize directly. The algorithm iteratively constructs an orthogonal basis set and a tridiagonal matrix T, which can then be used to find the eigenvalues of A efficiently. This document explains the Lanczos algorithm and highlights how the resulting matrix T is tridiagonal and can be employed in a divide-and-conquer approach to determine the eigenvalues of A.
- We start with a random initial vector,
$\mathbf{v}$ . - Normalize
$\mathbf{v}$ to have a unit length. - Compute
$\mathbf{u} = A\mathbf{v}$ . - Set
$\mathbf{v}$ as the first column vector of the matrix$V$ - Compute
$a = \mathbf{u}^T \mathbf{v}$ - Set the first diagonal entry of
$T$ to$a$ - Compute
$w$ as the residual between$u$ and its projection onto$v$ :
-
At each iteration
$i$ , we perform the following steps:-
Compute the norm
$b_i$ of the vector$\mathbf{w}_i$ . -
Confront the norm
$b_i$ with respect to a tolerance (or machine precision)$\epsilon$ :- If it's bigger, then compute
$\mathbf{v}_i = \frac{\mathbf{w}_i}{ b_i} $ . - If it's lower, then select a new random vector
$\mathbf{v}_i$ orthogonal to all previous $\mathbf{v}_1, \mathbf{v}2, \ldots, \mathbf{v}{i-1}$ using the Gram-Schmidt process.
- If it's bigger, then compute
-
Set
$\mathbf{v}_i$ as the$i$ -th column of$V$ . -
Compute
$\mathbf{u}_{i+1} = A\mathbf{v}_i$ -
Compute
$a_{i+1} = \mathbf{u}_{i+1}^T \mathbf{v}_i $ -
Compute
$\mathbf{w}_{i+1}$ as:
-
-
...
- Update the tridiagonal matrix
$T$ with the computed values$a_{i+1}$ as diagonal entry and the norm$b_i$ as off-by-1 diagonal entries.
- Update the tridiagonal matrix
Repeat the iteration process until convergence, where convergence can be defined based on a tolerance value or a predefined number of iterations.
The Lanczos algorithm produces two main results: An orthogonal basis set, V, whose columns are the vectors generated during the iterations. A tridiagonal matrix, T, which is symmetric and tridiagonal.
The matrix
- The diagonal entries (
$T[i, i]$ ) contain approximations of the eigenvalues of the original matrix$A$ . - The off-diagonal entries (
$T[i, i+1]$ and$T[i+1, i]$ ) contain information about the off-diagonal elements of$A$ .
The key advantage of having a tridiagonal matrix
The divide-and-conquer method is a technique used to find the eigenvalues of a tridiagonal matrix. The code and method presented closely follows https://people.inf.ethz.ch/arbenz/ewp/Lnotes/chapters5-6.pdf
It works as follows:
Given the tridiagonal matrix
Recursively calling the method on the two smaller submatrices
Combine the eigenvalues of
then
While the columns of
Then, since the spectral decomposition of
finding the eigenvectors is a matter of finding
Repeat the partitioning and eigenvalue computation process recursively until you have the eigenvalues of the original matrix
In summary, the Lanczos algorithm is an iterative method for approximating the eigenvalues and eigenvectors of a real, symmetric matrix