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

Request: Add Eigsh-Cupy Mode #22

Open
cgbsu opened this issue Dec 11, 2022 · 1 comment
Open

Request: Add Eigsh-Cupy Mode #22

cgbsu opened this issue Dec 11, 2022 · 1 comment

Comments

@cgbsu
Copy link

cgbsu commented Dec 11, 2022

CuPy also has eigsh and it makes computation much faster, the code should be almost identical to what is alraedy there

        if method == 'eigsh':
            from scipy.sparse.linalg import eigsh

            # Note: uses shift-invert trick for stability finding low-lying states
            # Ref: https://docs.scipy.org/doc/scipy/reference/tutorial/arpack.html#shift-invert-mode

            eigenvalues, eigenvectors = eigsh(H, k=max_states, which='LM', sigma=min(0, self.E_min))

Simply change the import (and condition) and it should work.

@astralm0nke
Copy link

Added this and pushed in a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants