Lanczos tridiagonalization algorithm

Lanczos tridiagonalization is the transformation of a real symmetric N×N matrix A,
A  VTAV=T ,
(where V is an N×n semiorthogonal matrix and T is an n×n tridiagonal matrix with n≤N) that uses power iteration and Gram-Schmidt orthogonalization. Read the book and/or the Wikipedia article. The algorithm is often used as the first step in matrix diagonalization. Particularly with lossy (with n<N) compression that preserves extreme eigenvalues.

Implement the Lanczos tridiagonalization algorithm for real symmetric matrices.

Consider the hydrogen atom using our discretization method with the given Δr and rmax=NΔr. Use the Lanczos iteration algorithm and build a size-n (where n≤N) tridiagonal representation T of the Hamiltonian. Calculate the ground state energy of the matrix T. Investigate the convergence of the ground state energy as function of n.

Check whether Jacobi eigenvalue algorithm can be tuned to take advantage of the tridiagonal form of a matrix.