Template Function LanczosEigenvalue¶
Defined in File Lanczos.hpp
Function Documentation¶
-
template<typename T, typename HilbertField>
void LanczosEigenvalue(T &H, vector<HilbertField> &gs, vector<double> &alpha, vector<double> &beta, vector<double> &energy, size_t &niter, bool verb = false)¶ Implementation of the Lanczos method for the lowest eigenvalue.
Applies the Lanczos algorithm for the lowest eigenvalue. Doesn’t calculate the correponding eigenvector. Assumes the multiply-add matrix routine is usually provided by a struct method
The structure H is assumed to have the following elements:
A method hamil.multadd(vector<HilbertField> &x, vector<HilbertField> &y) that does y –> y + H.x
- Parameters:
H – Hamiltonian matrix
gs – initial vector
alpha – Diagonal of the tridiagonal matrix (allocated on input, provided on output).
beta – Second Diagonal of the tridiagonal matrix (allocated on input, provided on output).
energy – eigenvalues
niter – Number of iterations (maximum number provided on input, actual number on output).