-
Notifications
You must be signed in to change notification settings - Fork 603
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 bug where unexpected queuing occurs in qml.ctrl
among other functions
#6284
Closed
Closed
Changes from 9 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
0a01915
recursive approach
KetpuntoG e8d2048
Update controlled.py
KetpuntoG 4de0ac3
Update controlled.py
KetpuntoG fcbcb87
Merge branch 'master' into queueing_controls
KetpuntoG 000b88d
adding tests
KetpuntoG e921546
Update prod.py
KetpuntoG bfee7c0
add test and changelog
KetpuntoG 36c2a20
Merge branch 'master' into queueing_controls
KetpuntoG 342a92c
Update pennylane/ops/op_math/prod.py
KetpuntoG 661dd52
Changes to setup development for 0.40.0 (#6456)
mudit2812 8dde8f8
Use `pytest-rng` generated seeds for stochastic tests (#6435)
astralcai ce0ab85
[no ci] bump nightly version
ringo-but-quantum 7fafc93
Merge branch 'master' into queueing_controls
KetpuntoG 3324b8e
suggestion, pytrees
KetpuntoG 30ec1d1
Merge branch 'queueing_controls' of https://github.com/PennyLaneAI/pe…
KetpuntoG e4f55e0
Merge branch 'v0.39.0-rc0' into queueing_controls
KetpuntoG File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Oops, something went wrong.
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.
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.
Maybe move this helper method to the
tape
module and just call it something likerecursively_remove_operators_from_queue
.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.
Sounds good, is okey in
tape/operation_recorder.py
?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.
Might be more suitable in
pennylane/queueing.py
actually.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.
We can use pytrees and simply do:
Given this is just two lines, I'd be worried that adding a public function adds more complexity and coupling that it solves. Duplicate code is not a bad thing when it helps keep modules simple and loosely coupled.
I'd prefer to just copy those two lines into
adjoint
,controlled
, andTransformDispatcher._qfunc_transform
.