-
Notifications
You must be signed in to change notification settings - Fork 635
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
Move pauli word logic from qml.grouping.utils.is_commuting
to qml.is_commuting
#3033
Conversation
Hello. You may have forgotten to update the changelog!
|
Codecov Report
@@ Coverage Diff @@
## master #3033 +/- ##
=======================================
Coverage 99.66% 99.66%
=======================================
Files 271 271
Lines 23161 23164 +3
=======================================
+ Hits 23084 23087 +3
Misses 77 77
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
Nice work @timmysilv!
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.
Great to have this simplification!
Context:
There are currently two different implementations of
is_commuting()
: one at the top-level for a variety of operators, and another inpennylane/grouping/utils.py
specifically for Pauli words. These should be in the same place to avoid drift, give a simpler user interface and ease future development, so I'm putting them in the same place (qml.is_commuting
)Description of the Change:
qml.is_commuting()
(thereby removingqml.grouping.utils.is_commuting()
), and try to check this before other checksBenefits:
Possible Drawbacks:
qml.is_commuting()
is becoming large and messy (as hinted by our pylint disabled features 😄 ). Hopefully this gets some love in the future. The code is still organized and legible, just a warning.Related GitHub Issues:
Fixes #3007