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

globalphase decomposes to nothing #4855

Merged
merged 8 commits into from
Nov 21, 2023
Merged

globalphase decomposes to nothing #4855

merged 8 commits into from
Nov 21, 2023

Conversation

timmysilv
Copy link
Contributor

@timmysilv timmysilv commented Nov 17, 2023

Context:
GlobalPhase is a relatively new operator, and some plugins may not be able to handle it. To be consistent with the pre-GlobalPhase days, I'm making it decompose to nothing so devices will decompose it and make it disappear.

Description of the Change:
Implement GlobalPhase.compute_decomposition so it decomposes to nothing

Benefits:
Plugins won't break if they see it. It does have a matrix defined, but maybe some plugins need a whitelist of operators.

Possible Drawbacks:
Maybe plugins should fail if they see it, and maybe that's what we wanted?

Related GitHub Issues:
Good to merge with/before #4666
[sc-50428]

@timmysilv timmysilv requested a review from a team November 17, 2023 20:46
Copy link

codecov bot commented Nov 17, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (bea3682) 99.65% compared to head (acb11f5) 99.64%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4855      +/-   ##
==========================================
- Coverage   99.65%   99.64%   -0.01%     
==========================================
  Files         383      383              
  Lines       34513    34258     -255     
==========================================
- Hits        34393    34137     -256     
- Misses        120      121       +1     

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

pennylane/ops/identity.py Outdated Show resolved Hide resolved
pennylane/ops/identity.py Show resolved Hide resolved
pennylane/ops/identity.py Show resolved Hide resolved
@timmysilv timmysilv enabled auto-merge (squash) November 21, 2023 19:39
@timmysilv timmysilv merged commit 34aba12 into master Nov 21, 2023
32 checks passed
@timmysilv timmysilv deleted the global-phase-no-decomp branch November 21, 2023 19:53
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.

4 participants