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:
|
SparseObservableSparseObservable
|
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
Cryoris
left a comment
There was a problem hiding this comment.
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 <jul@zurich.ibm.com>
Co-authored-by: Julien Gacon <jul@zurich.ibm.com>
Cryoris
left a comment
There was a problem hiding this comment.
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
SparseObservableare 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 ↩