-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 eigh, eigsh in NumPyEigensolver #6987
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
567fe78
Use eigh, eigsh
ikkoham e60040f
add is_hermitian method
ikkoham 97f950d
Merge branch 'main' into numpysolver-eigh
ikkoham 8ab4fd0
add is_hermitian method to OperatorBase
ikkoham b091d74
Merge branch 'main' into numpysolver-eigh
ikkoham 43f4410
Merge branch 'main' into numpysolver-eigh
ikkoham 9228b25
rm unnecessary files
ikkoham a70cc34
modify releasenot
ikkoham 70c8abe
Merge branch 'main' into numpysolver-eigh
ikkoham 313e9b6
Apply suggestions from code review
ikkoham 1dae7a6
fix test name
ikkoham d2013d1
Merge branch 'main' into numpysolver-eigh
ikkoham 1907a73
Update releasenotes/notes/add-opflow-is-hermitian-method-6a461549e3c6…
ikkoham b73cb62
Merge branch 'main' into numpysolver-eigh
ikkoham fab4c8f
Merge branch 'main' into numpysolver-eigh
ikkoham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
releasenotes/notes/add-opflow-is-hermitian-method-6a461549e3c6b32c.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
features: | ||
- | | ||
The :meth:`~qiskit.opflow.OperatorBase.is_hermitian` method is added to :obj:`~qiskit.opflow.OperatorBase` to check whether | ||
the operator is Hermitian or not. :class:`~qiskit.algorithms.NumPyEigensolver` and | ||
:class:`~qiskit.algorithms.NumPyMinimumEigensolver` use eigh or eigsh to solve the | ||
eigenvalue problem when the operator is Hermitian. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With floating-point maths, there's always the thorny question of tolerances to consider. I don't really know if it's appropriate for your use-cases, here, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. Personally, I think OperatorBase should inherit TolerancesMixin. However, the OpFlow implementation does not do so. e.g. https://github.com/Qiskit/qiskit-terra/blob/d2013d1812c9229455c1cfb1c79c560fecbc5dfe/qiskit/opflow/primitive_ops/pauli_op.py#L90
The concept of equality is different between Opflow and quantum_info.operators. opflow is exact and qinfo allows errors.
I believe that it should be unified in the future, but this is beyond the scope of this PR, so please leave it for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds fine to me, then - definitely best just to follow what's already there in this case!