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

equal with sum and product of no wires op #5562

Merged
merged 5 commits into from
Apr 24, 2024
Merged

equal with sum and product of no wires op #5562

merged 5 commits into from
Apr 24, 2024

Conversation

albi3ro
Copy link
Contributor

@albi3ro albi3ro commented Apr 23, 2024

Context:

Operators that don't have any wires (GlobalPhase and Identity) are newer additions that don't have full feature coverage in all places. This can lead to some logic that is unable to handle them.

Description of the Change:

Allows Sum._sort and Prod._sort to work with operators that don't have any wires.

Benefits:

Possible Drawbacks:

Related GitHub Issues:

Fixes #5498 [sc-61115]

@lillian542 lillian542 self-requested a review April 23, 2024 18:01
Copy link
Contributor

@lillian542 lillian542 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 to me!

Copy link

codecov bot commented Apr 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.68%. Comparing base (f504341) to head (c6e0d82).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5562      +/-   ##
==========================================
- Coverage   99.69%   99.68%   -0.01%     
==========================================
  Files         410      410              
  Lines       38235    37951     -284     
==========================================
- Hits        38118    37833     -285     
- Misses        117      118       +1     

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

Copy link
Contributor

@Qottmann Qottmann left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

Perhaps an integration test with qml.equal and the appropriate cases?

@albi3ro albi3ro requested a review from Qottmann April 24, 2024 13:46
Copy link
Contributor

@Qottmann Qottmann left a comment

Choose a reason for hiding this comment

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

Very nice, thanks @albi3ro !

@albi3ro albi3ro enabled auto-merge (squash) April 24, 2024 13:57
@albi3ro albi3ro merged commit 2bbeb77 into master Apr 24, 2024
38 checks passed
@albi3ro albi3ro deleted the prod-global-phase branch April 24, 2024 14:31
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.

[BUG] qml.equal does not work with qml.GlobalPhase
3 participants