Jutho / KrylovKit.jl

Krylov methods for linear problems, eigenvalues, singular values and matrix functions
Other
284 stars 37 forks source link

Missing eigenvalues #90

Closed ttx002000 closed 3 months ago

ttx002000 commented 4 months ago

I have the some big sparse matrix to be diagonalized. When compared with the Arpack results, it seems that there are multiple eigenvalues missing in the degenerate subspace using Krylovkit.

The only change I make in my code is changing from

MB_spectrum,ζ,info=eigsolve(sparse(matrix_index1,matrix_index2,matrix_value,length(state_can),length(state_can)),25,:SR)

to

MB_spectrum,ζ=eigs(sparse(matrix_index1,matrix_index2,matrix_value,length(state_can),length(state_can)), nev=25,which=:SR)

The second one use Arpack method, and here are the eigenvalues it obtained (the first 15 of it) image

The first one use KrylovKit method, and here are the eigenvalues it obtained (the first 15 of it) image

It seems that Krylovkit missed 2 of the 6 eigenvalues at 3.212527.

lkdvos commented 3 months ago

Hi ttx, Note that really, Krylov methods are not super well-suited for degenerate subspaces. (See for example the note in the docstring) This being said, often the Krylov methods still work, but you typically have to play around a bit with the parameters. If you make the tol more strict, or the krylovdim a bit larger, it might then find these other eigenvectors as well.

lkdvos commented 3 months ago

Did you manage to find the other eigenvalues with the higher tolerances? Can I close this issue?