Skip to content
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

Merged
merged 13 commits into from Feb 9, 2024
Merged

[BUGFIX] qml.equal via pauli_rep #5177

merged 13 commits into from Feb 9, 2024

Conversation

Qottmann
Copy link
Contributor

@Qottmann Qottmann commented Feb 8, 2024

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]

Copy link
Contributor

github-actions bot commented Feb 8, 2024

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

@codecov-commenter
Copy link

codecov-commenter commented Feb 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (fd3e75e) 99.68% compared to head (dea6f1d) 99.67%.
Report is 2 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

@@ -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):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simply changed the order

@Qottmann Qottmann changed the title Fix qml.equal via pauli_rep [BUGFIX] qml.equal via pauli_rep Feb 8, 2024
Copy link
Contributor

@mudit2812 mudit2812 left a 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.

@albi3ro albi3ro merged commit e69be08 into master Feb 9, 2024
33 checks passed
@albi3ro albi3ro deleted the fix_equal_via_pauli_rep branch February 9, 2024 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants