-
Notifications
You must be signed in to change notification settings - Fork 707
Fall back to op.decompose if op is unsolved in decomposition graph #8156
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #8156 +/- ##
==========================================
- Coverage 99.69% 99.69% -0.01%
==========================================
Files 548 548
Lines 56815 56805 -10
==========================================
- Hits 56641 56631 -10
Misses 174 174 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Isaac De Vlugt <[email protected]>
Co-authored-by: Pietropaolo Frisoni <[email protected]>
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.
Thanks for implementing this fallback logic! Would you like to add a test over a dummy operator with no matrix to see it gets channelled back to old decomposition and emits DeviceError as well? Something like:
class NoMatNoDecompOp(qml.operation.Operation):
"""Dummy operation for checking check_validity throws error when
expected."""
# pylint: disable=arguments-renamed, invalid-overridden-method
@property
def has_matrix(self):
return False
That would be irrelevant to this PR. The behaviour you're talking about is exclusive to |
This PR does not involve any Operator with |
Whether or not an operator has matrix is completely irrelevant here. The |
Context:
The DecompositionGraph currently errors out completely if any of the operators is unsolved for, and as a result, with graph enabled, if a circuit contains a single operator/template that is not yet integrated with the new decomposition system, the entire thing fails, and the user is forced to turn off graph mode and use the old decomposition system. We want to change this behaviour, make it so that the DecompositionGraph raise a warning instead of an error if certain operators are unsolved for, and fall back to using op.decomposition for those operators.
Description of the Change:
Benefits:
Possible Drawbacks:
Related GitHub Issues:
[sc-98390]