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

Fix NumPy(Minimum)Eigensolver for sparse matrices #9575

Merged
merged 3 commits into from
Feb 13, 2023

Conversation

Cryoris
Copy link
Contributor

@Cryoris Cryoris commented Feb 13, 2023

Summary

As reported by @stefan-woerner: Due to a missing indentation the NumPyEigensolver (and thus also the minimum eigensolver) first tried to convert an operator to a sparse matrix and then always computed the dense representation anyways. What should happen is that the dense matrix is only constructed, if the sparse matrix conversion failed. This led to dead kernels instead of a few seconds compute time 🙂

@Cryoris Cryoris added Changelog: Bugfix Include in the "Fixed" section of the changelog mod: algorithms Related to the Algorithms module labels Feb 13, 2023
@qiskit-bot
Copy link
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the the following people are requested to review this:

@Cryoris Cryoris added the stable backport potential The bug might be minimal and/or import enough to be port to stable label Feb 13, 2023
@Cryoris Cryoris added this to the 0.23.2 milestone Feb 13, 2023
Copy link
Contributor

@ElePT ElePT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this 😅 the fix LGTM.

@coveralls
Copy link

coveralls commented Feb 13, 2023

Pull Request Test Coverage Report for Build 4167166786

  • 2 of 4 (50.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.008%) to 85.282%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/algorithms/eigensolvers/numpy_eigensolver.py 2 4 50.0%
Totals Coverage Status
Change from base Build 4165350138: 0.008%
Covered Lines: 67275
Relevant Lines: 78885

💛 - Coveralls

@Cryoris
Copy link
Contributor Author

Cryoris commented Feb 13, 2023

@Mergifyio requeue

@mergify
Copy link
Contributor

mergify bot commented Feb 13, 2023

requeue

✅ The queue state of this pull request has been cleaned. It can be re-embarked automatically

@mergify mergify bot merged commit 1fb00e6 into Qiskit:main Feb 13, 2023
mergify bot pushed a commit that referenced this pull request Feb 13, 2023
* add reno

* fix sparse calculation

(cherry picked from commit 1fb00e6)
nbronn pushed a commit to nbronn/qiskit-terra that referenced this pull request Feb 13, 2023
@Cryoris Cryoris deleted the fix-numpy-eigsolver-sparse branch February 14, 2023 07:30
ElePT pushed a commit that referenced this pull request Feb 14, 2023
* add reno

* fix sparse calculation

(cherry picked from commit 1fb00e6)

Co-authored-by: Julien Gacon <gaconju@gmail.com>
ElePT pushed a commit to ElePT/qiskit that referenced this pull request Jun 27, 2023
ElePT pushed a commit to ElePT/qiskit-algorithms-test that referenced this pull request Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the "Fixed" section of the changelog mod: algorithms Related to the Algorithms module stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants