-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Support passing empty lists to Pauli delete method #10849
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
Support passing empty lists to Pauli delete method #10849
Conversation
The test failure here in CI isn't unrelated: at the moment there's a place in the code where we accidentally call |
Thank you! It was a simply fix by reordering the checks for edge cases. I looked at the logs for Run Docs build and am confused where the issue arises from. Not sure how to proceed. |
The docs failing wasn't your fault - just a dodgy connection from the VM to crates.io. I've re-run it, because it should just be ephemeral. |
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:
|
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, this looks solid and straightforward to me. I've just put in a comment showing how to add proper cross-references to the release note, but that's it.
releasenotes/notes/support-empty-delete-for-pauli-16c5c5fae890c16c.yaml
Outdated
Show resolved
Hide resolved
Co-authored-by: Jake Lishman <jake@binhbar.com>
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!
* handle empty lists in delete methods, added release notes * fixed ordering of empty list check in pauli delete method * add proper cross-references to classes Co-authored-by: Jake Lishman <jake@binhbar.com> --------- Co-authored-by: Jake Lishman <jake@binhbar.com> (cherry picked from commit 6a38279)
* handle empty lists in delete methods, added release notes * fixed ordering of empty list check in pauli delete method * add proper cross-references to classes Co-authored-by: Jake Lishman <jake@binhbar.com> --------- Co-authored-by: Jake Lishman <jake@binhbar.com> (cherry picked from commit 6a38279) Co-authored-by: AlexanderGroeger <46076580+AlexanderGroeger@users.noreply.github.com>
Fixes #10839
Summary
This PR addresses this issue where the Pauli operator's delete method does not gracefully handle an empty list parameter.
Details and comments
For the Pauli, PauliList, and PauliTable classes, performing a delete with an empty list argument will return a copy of the calling object.
Side note: I get unrelated errors with tox and tests sometimes, so I'm submitting this as a draft for now.