-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Lift trivial transpiler passes to handle control flow #8752
Lift trivial transpiler passes to handle control flow #8752
Conversation
This converts all transpiler passes whose structure allows their `run` methods to be made trivially recursive, either by eagerly modifying all control-flow operations in a depth-first pass before running the method on the top level of the circuit, or by inserting the recursion during an interior loop. There are other passes that are relatively simple to handle as well (`UnitarySynthesis` is one), but their current structure would require just a shade more work than the trivial cases in this commit.
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the the following people are requested to review this:
|
Pull Request Test Coverage Report for Build 3063338228
💛 - Coveralls |
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.
Overall this LGTM. Just a minor comment about tests.
Ok sure, I'll tag this for automerge and we can revisit later if needed. I've not added a changelog because I imagine we'll do that in a unified manner for all the control-flow transpiler work. |
Summary
This converts all transpiler passes whose structure allows their
run
methods to be made trivially recursive, either by eagerly modifying all control-flow operations in a depth-first pass before running the method on the top level of the circuit, or by inserting the recursion during an interior loop.There are other passes that are relatively simple to handle as well (
UnitarySynthesis
is one), but their current structure would require just a shade more work than the trivial cases in this commit.Details and comments
Close #8445 (by obsoleting it). We can rework #8565 to do essentially this as well - we probably just want to take a bit more care than that PR currently does not to redo all the setup work in the pass.