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

Use a stable SVD function call #65

Open
NominHanggai opened this issue May 6, 2022 · 4 comments
Open

Use a stable SVD function call #65

NominHanggai opened this issue May 6, 2022 · 4 comments
Assignees
Labels
bug Something isn't working priority Important to get done soon

Comments

@NominHanggai
Copy link

NominHanggai commented May 6, 2022

Hi OQuPy developers,

The SVD call in OQuPy fails occasionally. Is it possible for users to configure OQuPy so that it uses a stable SVD function?

Best,
Mulliken

@NominHanggai NominHanggai changed the title Use a stable SVD funtion call Use a stable SVD function call May 6, 2022
@gefux
Copy link
Member

gefux commented May 7, 2022

Hi @Mulliken,
Thank you for the question. As you might be aware, we are using the google/TensorNetwork package as a backend. If the SVD fail you are seeing is similar to my occasional experience then I believe this should be related to this issue: google/TensorNetwork#896.
The problem most likely lies with the gesdd function in LAPACK and a common workaround is to default back to gesvd if gesdd fails: https://tenpy.readthedocs.io/en/v0.5.0/_modules/tenpy/linalg/svd_robust.html

I will chase this up with the google/TensorNetwork people to see if there is either a newer version which has that fail save built in or if it could be added. If not, then we might be forced to depend on our own fork of google/TensorNetwork which I'd like to avoid for a ton of reasons. I'll get back to you sometime next week on this. Best, ~gefux

@NominHanggai
Copy link
Author

Thanks for the reply! It will be great if the problem can be solved on the google/TensorNetwork side!

@gefux gefux added bug Something isn't working priority Important to get done soon labels May 9, 2022
@gefux
Copy link
Member

gefux commented May 13, 2022

Hi. I've created a pull request google/TensorNetwork#962 with google/TensorNetwork a few days ago.

If you'd like to try a quick-fix you could simply change a few lines your installed TensorNetwork package. The error message should somewhere point you to %somewhere-on-your-computer%/tensornetwork/backends/numpy/decompositions.py. You could try to change a few lines as described here and see if it fixes your problem. (Be aware that you might have to reinstall tensornetwork if something goes wrong!) In case you decide to give this a try I'd be keen to hear if it fixed your problem. Also, it would be great if you could share a minimal failing example at some point.

Best, ~gefux

@NominHanggai
Copy link
Author

Thanks for the solution, gefux!! I will attach a minimal failing example later.

@gefux gefux added this to the version 0.5 milestone Jan 26, 2024
@gefux gefux self-assigned this Jan 26, 2024
@gefux gefux removed this from the version 0.5 milestone Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority Important to get done soon
Projects
None yet
Development

No branches or pull requests

2 participants