-
Notifications
You must be signed in to change notification settings - Fork 34
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
Avoid infinite recursion in decomposition of Controlled
#468
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The `qml.matrix` falls back to decomposition of the supplied operator if the matrix cannot be computed. Since we explicitly map the decomposition function of an operator to a `qml.matrix` call, this can lead to infinite decomposition loop. Avoid the problem by invoking `op.matrix()` directly.
Adding a test shortly. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #468 +/- ##
=======================================
Coverage 99.56% 99.56%
=======================================
Files 43 43
Lines 7662 7666 +4
Branches 514 514
=======================================
+ Hits 7629 7633 +4
Misses 17 17
Partials 16 16 ☔ View full report in Codecov by Sentry. |
maliasadi
approved these changes
Jan 19, 2024
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.
🙌
maliasadi
reviewed
Jan 19, 2024
... when Controlled decomposition to matrix fails.
dime10
force-pushed
the
dime10-patch-2
branch
from
January 19, 2024 23:05
316f148
to
8dc026a
Compare
Merged
josh146
pushed a commit
that referenced
this pull request
Jan 29, 2024
The `qml.matrix` falls back to decomposition of the supplied operator if the matrix cannot be computed. Since we explicitly map the decomposition function of an operator to a `qml.matrix` call, this can lead to infinite decomposition loop. Avoid the problem by invoking `op.matrix()` directly. fixes #463 [sc-54969]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
qml.matrix
falls back to decomposition of the supplied operator if the matrix cannot be computed. Since we explicitly map the decomposition function of an operator to aqml.matrix
call, this can lead to infinite decomposition loop.Avoid the problem by invoking
op.matrix()
directly.fixes #463
[sc-54969]