eigs_lanczos
Performs an iterative eigenvalue calculation building eigenvectors using the Lanczos algorithm. Returns the tridiagonal matrix, eigenvalues, number of iterations and the stopping criterion. The Lanczos interations are performed twice, where at the second run the eigenvectors are built.
Sources
eigs_lanczos.hpp
eigs_lanczos.cpp
eigs_lanczos.jl
Definition
The Lanczos algorithm can be run in two distinct ways:
-
A random intial state with normal distributed entries is used.
-
The initial state is explicitly specified
Parameters
Name | Description | Default |
---|---|---|
ops | OpSum defining the bonds of the operator | |
block | block on which the operator is defined | |
psi0 | Initial State from which the Lanczos algorithm is started | |
neigvals | number of eigenvalues to converge | 1 |
precision | accuracy of the computed ground state | 1e-12 |
max_iterations | maximum number of iterations | 1000 |
deflation_tol | tolerance for deflation, i.e. breakdown of Lanczos due to Krylow space exhaustion | 1e-7 |
random_seed | random seed for setting up the initial vector | 42 |
Returns
A struct with the following entries
Entry | Description |
---|---|
alphas | diagonal elements of the tridiagonal matrix |
betas | off-diagonal elements of the tridiagonal matrix |
eigenvalues | the computed Ritz eigenvalues of the tridiagonal matrix |
eigenvectors | State of shape neigvals holding all low-lying eigenvalues up to neigvals |
niterations | number of iterations performed |
criterion | string denoting the reason why the algorithm stopped |
Convergence criterion
The algorithm terminates if the -th ( is the argument neigvals
) approximate eigenvalue changes only by a fraction smaller than ( is the argument precision
), i.e.
Here, denotes the Lanczos approximation to the -th eigenvalue after iterations.
Usage Example
int N = 8;
int nup = N / 2;
auto block = Spinhalf(N, nup);
// Define the nearest-neighbor Heisenberg model
auto ops = OpSum();
for (int i=0; i<N; ++i) {
ops += "J" * Op("SdotS", {i, (i+1) % N});
}
ops["J"] = 1.0;
// With random intial state
auto res = eigs_lanczos(ops, block);
XDIAG_SHOW(res.alphas);
XDIAG_SHOW(res.betas);
XDIAG_SHOW(res.eigenvalues);
XDIAG_SHOW(res.eigenvectors);
let
N = 8
nup = N ÷ 2
block = Spinhalf(N, nup)
# Define the nearest-neighbor Heisenberg model
ops = OpSum()
for i in 1:N
ops += "J" * Op("SdotS", [i, mod1(i+1, N)])
end
ops["J"] = 1.0
# With random intial state
res = eigs_lanczos(ops, block)
@show res.alphas
@show res.betas
@show res.eigenvalues
@show res.eigenvectors
end