-
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
Add base representation of SparseObservable
#12671
Conversation
4dce391
to
acd7d56
Compare
This comment was marked as outdated.
This comment was marked as outdated.
acd7d56
to
0fa4a90
Compare
This comment was marked as outdated.
This comment was marked as outdated.
No longer "on hold" because its dependency merged, but I do still need to write a lot more of the initialisation methods for this. |
641d87f
to
83ca5a9
Compare
One or more of the following people are relevant to this code:
|
SparseObservable
SparseObservable
This base PR for |
Pull Request Test Coverage Report for Build 11458543910Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
83ca5a9
to
50319a5
Compare
The only missing lines in the coverage report are ones that are unreachable, either clearly from the code, or because they're error paths to handle things like a (Also there's a line about |
This adds the base representation of `SparseObservable`, including the simple constructors from Python space and the ability to view the data buffers. This commit does not include the mathematical manipulations of the operators, nor some of the helper methods that will be used to manipulate the operators in the context of primitives execution. These will follow in subsequent patches. The design and implementation notes of `SparseObservable` are described in a Qiskit RFC that preceeded this patch series[^1], and it's best to consult that document for full details on the operator considerations. [^1]: https://github.com/Qiskit/RFCs/blob/7a74b08793475b7b0142d3a3f7142cabcfd33ab8/0021-sparse-observable.md
50319a5
to
d88dce5
Compare
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'm not quite through with the first look, but there's some bits I don't 100% understand (like how bytemuck
works) but overall this looks really nice and the the comments help a ton to understand it 🙂 I have mainly questions below for now and will have a look at the rest (and play with it) in a bit!
Co-authored-by: Julien Gacon <[email protected]>
Co-authored-by: Julien Gacon <[email protected]>
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.
Thanks for the detailed comments and responses, this looks really nice (and I learned quite a bunch in reviewing 😄)!
Summary
This adds the base representation of
SparseObservable
, including the simple constructors from Python space and the ability to view the data buffers.This commit does not include the mathematical manipulations of the operators, nor some of the helper methods that will be used to manipulate the operators in the context of primitives execution. These will follow in subsequent patches.
The design and implementation notes of
SparseObservable
are described in a Qiskit RFC that preceeded this patch series1, and it's best to consult that document for full details on the operator considerations.Details and comments
This is the beginnings of the implementation of Qiskit/RFCs#74, and subject to change based on decisions made there.
A current simple example of what works with the PR:
This PR depends on #12669.
Close #12282. This PR only adds the representation of such operators, but that's sufficient to immediately fulfil the feature as an MVP. Qiskit/RFCs#75 tracks the rest of the implementation of the RFC.
Footnotes
https://github.com/Qiskit/RFCs/blob/7a74b08793475b7b0142d3a3f7142cabcfd33ab8/0021-sparse-observable.md ↩