Repository navigation
Implement SparseObservable.evolve - #15561
Alexander Ivrii (alexanderivrii) merged 34 commits into
Conversation
|
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 following people are relevant to this code:
|
Pull Request Test Coverage Report for Build 21390225658Details
💛 - Coveralls |
Julien Gacon (Cryoris)
left a comment
There was a problem hiding this comment.
Thanks for the modifications! I didn't have a look at how the evolve logic is implemented yet, but here's already comments on the interface and some tests.
Co-authored-by: Julien Gacon <gaconju@gmail.com>
Co-authored-by: Julien Gacon <gaconju@gmail.com>
… enhance tests. Also update evolve logic
…/qiskit into evolve_sparseobservable
…, and also enhance comments
…tity pauli to make more physical sense
Co-authored-by: Julien Gacon <gaconju@gmail.com>
Co-authored-by: Julien Gacon <gaconju@gmail.com>
Co-authored-by: Julien Gacon <gaconju@gmail.com>
Co-authored-by: Julien Gacon <gaconju@gmail.com>
Co-authored-by: Julien Gacon <gaconju@gmail.com>
…ke exception testing more explicit
…/qiskit into evolve_sparseobservable
…parseobservable
Gadi Aleksandrowicz (gadial)
left a comment
There was a problem hiding this comment.
I created a script to generate the table independently and compared it to the one in the PR - all seems good to me. I approve.
SparseObservable.evolve
- docs were failing - remove some test dups and dangling comments - more efficient qargs duplicate check
Julien Gacon (Cryoris)
left a comment
There was a problem hiding this comment.
Thanks for the contribution Aaryav (@aaryav-3) and thanks for the review Gadi Aleksandrowicz (@gadial) 🙂 There's some minor improvements we can do on the error handling here but nothing to hold the feature off on.
Summary
Fixes #13763
This PR adds support for efficient evolution of SparseObservable objects under conjugation by single-term operators via a new :meth:
SparseObservable.evolveAPI.The implementation introduces an efficient, deterministic conjugation based on a precomputed lookup table for single-qubit BitTerm conjugation. Support for partial and non-contiguous evolution through optional qargs has been added, and so has the edge-case to handle scalar (0-qubit) operators. (Identity)
Further work could be done to support evolution via Cliffords, and Pauli Lists (as these cannot be coerced to a :class:
SparseObservableby default), and also support cross-term conjugations (for BitTerm Operators with num_terms > 1, i.e. a sum of terms) can be added in a later PRAI tool used: Claude Sonnet 4.5 (on Browser) for Lookup table generator script, and automated testing of the same.