-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add CommutativeOptimization to transpiler pipeline
#15464
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
base: main
Are you sure you want to change the base?
Add CommutativeOptimization to transpiler pipeline
#15464
Conversation
…lt transpiler pipeline for continuous basis sets
|
One or more of the following people are relevant to this code:
|
CommutativeOptimization to transpiler pipeline
Pull Request Test Coverage Report for Build 21170921342Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
|
I have slightly changed the order of the passes in the default optimization pass manager for The previous order when
There was one example where this got stuck in an infinite loop with the basis set
With the new order, optimize1q brings the circuit to the desired basis, the optional basis translator is no longer needed, and no "wobbling" happens. Regardless of the problematic example above, I believe that applying CommutativeOptimization before Optimize1q also makes sense in general. |
|
I have rebased this pass on top of main and locally run the full suite of ASV benchmarks. Regarding performance. Except for the benchmarks mentioned previously in this comment, there was nothing else statistically significant. Regarding quality of the output circuit. There are actually two family of benchmarks where the depth has increased:
In both cases the change is due not to interchanging the order of QFT:
QUEKO:
There is no statistical difference on these benchmarks. |
Summary
Addresses #15452.
This PR replaces
CommutativeCancellationbyCommutativeOptimizationin the default compilation pipeline for continuous basis sets, which is relevant for optimization levels 2 and 3. This should provide higher quality results at similar runtimes.Since this is an important change, we did not want to do it late in 2.3, but it would be nice to do it early for 2.4, so that we have a sufficient time to test the impact.
Details and Comments:
We do not want to apply this change for Clifford+T transpilation, since we need to fully rethink that pipeline, and this is tracked independently in #15457.