subroutine perform_spectral_lanczos()
integer :: i
! Data for the testsuite to use.
real(dp) :: h_sum, spec_low, spec_high
call init_spectral_lanczos()
do i = 1, n_lanc_vecs_sl - 1
call subspace_expansion_lanczos(i, sl_vecs, full_vec_sl, sl_hamil, ndets_sl, disps_sl)
write(stdout, '(1x,a19,1x,i3)') "Iteration complete:", i
call neci_flush(stdout)
end do
call calc_final_hamil_elem(sl_vecs, full_vec_sl, sl_hamil, ndets_sl, disps_sl)
h_sum = sum(sl_hamil)
call subspace_extraction_sl()
write(stdout, '(1x,a60,/)') "Spectral Lanczos calculation complete. Outputting results..."
call neci_flush(stdout)
call output_spectrum(n_lanc_vecs_sl, sl_h_eigv, spec_low, spec_high)
if (tPrint_sl_eigenvecs) call print_sl_eigenvecs()
if (iProcIndex == root) call write_spec_lanc_testsuite_data(h_sum, spec_low, spec_high)
call end_spectral_lanczos()
end subroutine perform_spectral_lanczos