The following repository contains an implementation of the standard Lanczos Algorithm.
To play around with the algorithm yourself, git clone
the repository onto your local machine. Then, in the cloned directory, initialize the conda environment by running
conda env create --file environment.yml
From there, you can activate the environment like so
conda activate LanczosAlgo
and run the notebook in src/lanczos.ipynb
.
The Lanczos algorithm is a direct algorithm devised by Cornelius Lanczos that is an adaptation of power methods to find the
The algorithm proceeds as follows:
- Given a Hermitian matrix
$A$ of size$n\times n$ , and an arbitrary vector$v_1$ with Euclidean norm 1, specify a default number of function calls$m=n$ - Let
$w_1'$ =$Av_1$ - Let
$\alpha_1=w_1'^* v_1$ - Let
$w_1=w_1'^*-\alpha_1 v_1$
We refer to steps 2 - 4 as the first iteration steps. Subsequently,
- Let
$\beta_j=||w_{j-1}||$ - If
$\beta_j\neq0$ , let$v_j=\frac{w_{j-1}}{\beta_j}$ . Else, let$v_j$ be an arbitrary vector with Euclidean norm 1 that is orthogonal to$v_1, ..., v_{j-1}$ - Let
$w_j'=Av_j$ - Let
$\alpha_j=w_j'v_j$ - Let
$w_j=w_j'-\alpha_j v_j-\beta_j v_{j-1}$
where
Efforts are currently ongoing to extend the algorithm to include scattering-state systems. Star this repo if you'd like to be notified when that goes live!