-
Notifications
You must be signed in to change notification settings - Fork 595
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
[BugFix] - PennyLane raises an informative error if running circuit(s) with dynamic tracers as wires #6405
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6405 +/- ##
=======================================
Coverage 99.40% 99.40%
=======================================
Files 447 447
Lines 42400 42418 +18
=======================================
+ Hits 42146 42164 +18
Misses 254 254 ☔ View full report in Codecov by Sentry. |
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.
lgtm!
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.
Excellent choice of location for this fix 👍
Context: Pennylane provides incorrect results or non-informative errors (depending on the circumstances) when working with
@jax.jit
and dynamic wires (that is, JAX tracers) at the same time. For example:Description of the Change: Pennylane raises an informative error in the
validate_device_wires
transform to inform the user that abstract wires are not currently supported. We cannot raise this error in theWires
class since this would be a problem for Catalyst. This solution should not (hopefully) cause issues in other repositories.Benefits: This prevents non-informative errors and, most importantly, wrong results.
Possible Drawbacks: This change could potentially break existing code(s) that somehow used abstract wires and for some reason they worked fine.
Related GitHub Issues: #6380
Related ShortCut Stories: [sc-75756]