Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sparse matrix algebra fails with a 0 eigenvalue #6

Open
jakelishman opened this issue Sep 11, 2018 · 0 comments
Open

Sparse matrix algebra fails with a 0 eigenvalue #6

jakelishman opened this issue Sep 11, 2018 · 0 comments
Labels
bug Something isn't working

Comments

@jakelishman
Copy link
Member

The sparse eigenvalue solver uses "shift-invert" mode to find the eigenvalues closest to zero. This involves solving for shifted eigenvalues w' = 1.0 / (w - s), where w are the original eigenvalues and s is the shift. We use zero for the shift, which causes a division by 0 when an eigenvalue is exactly 0, which isn't that rare.

This is something that the user can work around, usually by adding a constant term onto the input Hamiltonian - the dynamics aren't changed by a global phase rotation. That's not a particularly satisfying solution, though. Dense matrix algebra is immune to this problem, because the routines are far more robust, and safely calculate all the eigenvalues. This is impractical for large matrices.

Because the error happens inside the ARPACK routines, there is no ZeroDivisionError to be caught. The code throws a RuntimeError, but the entire routine fails and there seems to be no way to recover the other eigenvalues.

@jakelishman jakelishman added the bug Something isn't working label Sep 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant