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
[BUGFIX] qml.equal via pauli_rep #5177
Conversation
Hello. You may have forgotten to update the changelog!
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5177 +/- ##
==========================================
- Coverage 99.68% 99.67% -0.01%
==========================================
Files 394 394
Lines 36306 36051 -255
==========================================
- Hits 36191 35935 -256
- Misses 115 116 +1 ☔ View full report in Codecov by Sentry. |
@@ -269,12 +269,12 @@ def _equal_operators( | |||
# pylint: disable=unused-argument, protected-access | |||
def _equal_prod_and_sum(op1: CompositeOp, op2: CompositeOp, **kwargs): | |||
"""Determine whether two Prod or Sum objects are equal""" | |||
if len(op1.operands) != len(op2.operands): |
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.
simply changed the order
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.
Looks good. Ready to approve once a test for Prod
is added as well.
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
Potential fix for #5162 and many other related issues
Simply compares the pauli_rep between operators, when both have one.
Original Story: [sc-56269]
Duplicate: [sc-56466]