-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Refactor z2symmetries #9227
Refactor z2symmetries #9227
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 the following people are requested to review this:
|
Pull Request Test Coverage Report for Build 3745399651
💛 - Coveralls |
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.
Alright this is a rather lengthy review but a lot of these comments revolve around documentation. Other than that I just suggest some minor refactorings and code changes.
Overall this looks like its in good shape 👍
releasenotes/notes/add-sparsepauliop-based-z2symetries-1811e956c232f664.yaml
Outdated
Show resolved
Hide resolved
So following one of your comments @mrossinek, I'm proposing a refactored version of the |
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.
Just a quick second round of reviews (I ran out of time).
I compared the logic which you implemented here with the original one and as far as I could see everything seems to be correct 👍 Thanks a lot, this implementation looks a lot better!
releasenotes/notes/add-sparsepauliop-based-z2symetries-1811e956c232f664.yaml
Outdated
Show resolved
Hide resolved
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.
Thank you. Nice PR. I left some comments.
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.
Some more suggestions but other than that, this looks good to me!
Thanks a lot, Anthony! 🙂
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, thanks a lot Anthony! 👍
EDIT: you just need to run make black
once to fix that formatting error
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.
Sorry for late review. LGTM! Thank you for using PauliList
!
(I will try to improve Clifford part as my review comments above)
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, too! Thanks a lot, Anthony! 👍
* first step * first step and new files * pass all tests * Add release note and fix mypy * First batch of corrections * Second batch of Fixes: subtests, docstring, qiskiterror * Fix release note * First working attempt to factor find_Z2_symmetries * Moved _sparse_pauli_op_is_zero to Z2symmetries * rename find_Z2_symmetries to find_z2_symmetries * Fix docstrings and refactor _test_symmetry_at_row_col method * rm logging and fix type hints * add return types * fix lint Co-authored-by: ikkoham <ikkoham@users.noreply.github.com>
Summary
Fix #9140
This PR adds an implementation of the
Z2symmetries
class based on SparsePauliOp.The tests of the main Z2Symmetry class were adapted and considered as based requirements of this class.
Overall the changes are minor because most of the logic is shared between
PauliSumOp
andSparsePauliOp
.