-
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
better unrolling in preset passmanagers #6133
Conversation
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, it would be good to include this in 0.17.0, but given the timing I think we just missed it. We'll have to include it in a 0.17.1 in a week or two. Just one small comment on the release note.
Before I merge this, I did have one question. Do we know which pass the gates outside of the basis were coming from? It doesn't really effect this PR because I think having the |
So I dug into this a bit, and the pass that was introducing U2s for level 0 and level 1 before was |
* move unroll inside optimization loop for level1-3 * add test and release note for bugfix of basis respect * remove print * Update releasenotes/notes/bugfix-respect-basis-d2204b9b7c403722.yaml * Update releasenotes/notes/bugfix-respect-basis-d2204b9b7c403722.yaml Co-authored-by: Matthew Treinish <mtreinish@kortar.org> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit 9004023)
* move unroll inside optimization loop for level1-3 * add test and release note for bugfix of basis respect * remove print * Update releasenotes/notes/bugfix-respect-basis-d2204b9b7c403722.yaml * Update releasenotes/notes/bugfix-respect-basis-d2204b9b7c403722.yaml Co-authored-by: Matthew Treinish <mtreinish@kortar.org> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit 9004023) Co-authored-by: Ali Javadi-Abhari <ajavadia@users.noreply.github.com>
#5609 introduced a performance regression in time and quality of transpilation by doing unrolling at the end of transpilation level0, 1, 3.
This reclaims some of the performance back by doing the unrolling in an optimization loop. But the unrolling is necessary because the generated circuits were actually wrong before (they generated circuits that did not respect the basis). I added a release note to highlight this fact, and added tests (these tests would have failed prior to #5609 )
This also points to a need for better testing in the randomized transpiler passes to make sure the generated circuit is equivalent and respects the constraints in transpile().