-
Notifications
You must be signed in to change notification settings - Fork 615
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
Fix ControlledQubitUnitary
consistency with program capture
#6719
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6719 +/- ##
=======================================
Coverage 99.62% 99.62%
=======================================
Files 478 478
Lines 45025 45045 +20
=======================================
+ Hits 44856 44876 +20
Misses 169 169 ☔ View full report in Codecov by Sentry. |
Co-authored-by: Mudit Pandey <[email protected]>
Co-authored-by: Mudit Pandey <[email protected]>
Co-authored-by: Mudit Pandey <[email protected]>
Co-authored-by: Yushao Chen (Jerry) <[email protected]>
…nto fix-ctrl-qb-unit
I would actually expect
to raise the same error as
|
Why are you still working when on vacation ( |
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.
🚀
Context:
The
ControlledQubitUnitary
operator previously exhibited inconsistent behavior when capture was enabled. This PR addresses the issue by updating and overwriting the_primitive_bind_call
class method to handle the operator's unique call signature correctly.Description of the Change:
Important Consequence: If the user does not specify
wires
but provides more than onecontrol_wire
, thewires
will now be inferred from the input dimensions of the base operator. This is necessary to get program capture working. Oncecontrol_wires
is deprecated, this can be improved.The behaviour, with or without capture enabled, is the following,
Benefits:
Code is now behaving consistently when
qml.capture
is enabled or disabled.Possible Drawbacks: Example (3) above isn't necessarily expected. This should be sorted out when
control_wires
is deprecated.Related GitHub Issues: Fixes #6675
[sc-79808]