-
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
Implement SparseObservable.apply_layout
#13372
Merged
Merged
Conversation
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
One or more of the following people are relevant to this code:
|
Pull Request Test Coverage Report for Build 11579733532Details
💛 - Coveralls |
Cryoris
reviewed
Oct 28, 2024
This is one more usability method to bring `SparseObservable` closer inline with `SparsePauliOp`. The same functionality is relatively easily implementable by the user by iterating through the terms, mapping the indices, and putting the output back into `SparseObservable.from_sparse_list`, but given how heavily we promote the method for `SparsePauliOp`, it probably forms part of the core of user expectations.
ae2e4a4
to
e4df147
Compare
Rebased and no longer on hold. |
Cryoris
approved these changes
Oct 30, 2024
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.
LGTM 👍🏻
It's true we don't strictly require this for 1.3 but this looks solid, brief and ready, so I'd say there's no reason to put it off 🙂
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Changelog: New Feature
Include in the "Added" section of the changelog
mod: primitives
Related to the Primitives module
mod: quantum info
Related to the Quantum Info module (States & Operators)
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.
Summary
This is one more usability method to bring
SparseObservable
closer inline withSparsePauliOp
. The same functionality is relatively easily implementable by the user by iterating through the terms, mapping the indices, and putting the output back intoSparseObservable.from_sparse_list
, but given how heavily we promote the method forSparsePauliOp
, it probably forms part of the core of user expectations.Details and comments
Built on top of #13298 (though mostly just because it touches similar changes to the error structs).
I only finalised this after the 1.3 feature-freeze period. There's probably no huge necessity to rush it in since it's not going to be used by the primitives before Qiskit 2.0 anyway, though it's nice to get these things early.
There's still
compose
andevolve
to go forSparseObservable
, but those are definitely for a later release, because I haven't written them yet, and the tests will take a good amount of time to write still.