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

update has_diagonalizing_gates and remove xfail on test #5603

Merged
merged 4 commits into from
May 2, 2024

Conversation

lillian542
Copy link
Contributor

@lillian542 lillian542 commented Apr 30, 2024

Context:
A missing check in has_diagonalizing_gates was causing CompositeOp instances to sometimes incorrectly return True for has_diagonalizing_gates, i.e.:

>>> op1 = qml.PauliZ(0)
>>> op2 = qml.Rot(1.2, 2.3, 3.4, wires=0)
>>> op3 = qml.IsingZZ(4.32, wires=("a", "b"))
>>> op = qml.prod(op1, op2, op3)
>>> op.has_diagonalizing_gates    # should be False
True

Description of the Change:
Add the missing check to create consistency between for what base operators a CompositeOp can return diagonalizing_gates, and what for what operators it returns True for has_diagonalzing_gates.

Removes the xfail for the related test.

Copy link
Contributor

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.

@lillian542 lillian542 marked this pull request as ready for review April 30, 2024 18:53
@lillian542
Copy link
Contributor Author

[sc-49608]

Copy link

codecov bot commented Apr 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (v0.36.0-rc0@f15151d). Click here to learn what that means.

Additional details and impacted files
@@              Coverage Diff               @@
##             v0.36.0-rc0    #5603   +/-   ##
==============================================
  Coverage               ?   99.69%           
==============================================
  Files                  ?      412           
  Lines                  ?    38315           
  Branches               ?        0           
==============================================
  Hits                   ?    38197           
  Misses                 ?      118           
  Partials               ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lillian542 lillian542 enabled auto-merge (squash) May 2, 2024 19:31
@lillian542 lillian542 merged commit e101637 into v0.36.0-rc0 May 2, 2024
37 checks passed
@lillian542 lillian542 deleted the prod-diag-gates branch May 2, 2024 19:58
@astralcai astralcai added this to the v0.36 milestone May 2, 2024
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.

3 participants