-
Notifications
You must be signed in to change notification settings - Fork 624
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
[Capture] First PR for enabling dynamic decompositions with PLxPR
enabled
#6859
base: master
Are you sure you want to change the base?
Conversation
Hello. You may have forgotten to update the changelog!
|
qml.cond
in decompositions can be captured into PLxPRPLxPR
enabled
…o cond_dynamic_decomp
…o cond_dynamic_decomp
…o cond_dynamic_decomp
…o cond_dynamic_decomp
…o cond_dynamic_decomp
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6859 +/- ##
=======================================
Coverage 99.59% 99.59%
=======================================
Files 480 480
Lines 45495 45504 +9
=======================================
+ Hits 45310 45319 +9
Misses 185 185 ☔ View full report in Codecov by Sentry. |
PLxPR
enabledPLxPR
enabled
…o cond_dynamic_decomp
…o cond_dynamic_decomp
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. Left a few comments. I'm confused why all the QNode tests explicitly disable autograph. Might be worth parametrizing the tests to check with both autograph=False
and True
tests/capture/transforms/test_capture_dynamic_decompositions.py
Outdated
Show resolved
Hide resolved
@staticmethod | ||
def _compute_plxpr_decomposition(phi, wires): | ||
|
||
if phi > 0.5: | ||
qml.RX(phi, wires=wires) | ||
|
||
else: | ||
qml.RY(phi, wires=wires) | ||
|
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.
For this to work, don't you need to set autograph=True
in the call to make_plxpr
in _plxpr_decomposition
?
…o cond_dynamic_decomp
Context: The main purpose of this story is to implement a prototype for dynamic decompositions in PL with program capture enabled.
At this stage, we only focus on one-level dynamic decompositions (without implementing additional parameters that can be passed to the interpreter). The UI might change in the future.
Therefore, these are the main current limitations of the prototype introduced in this PR:
Description of the Change: As above.
Benefits: We can start capturing the decompositions dynamically with program capture enabled instead of simply returning the operators list at the end.
Possible Drawbacks: Still experimental. It shouldn't cause issues with the current program capture scaffolding.
Related GitHub Issues: None
Related Shortcut Stories: [sc-82690]