-
Notifications
You must be signed in to change notification settings - Fork 2.6k
CliffordT optimization #14433
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
CliffordT optimization #14433
Conversation
One or more of the following people are relevant to this code:
|
Pull Request Test Coverage Report for Build 15293708241Warning: 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 |
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.
This is a small PR and we should definitely think how to extend it in the future. It's specifically useful after the SK decomposition.
One suggestion for he future is to handle Rz gates with proper angles (as well as Rx and Ry).
- | | ||
Added a new :class:`.OptimizeCliffordT` transpiler optimization pass that | ||
merges pairs of consecutive ``T``-gates into ``S``-gates and pairs of | ||
consecutive ``Tdg``-gates into ``Sdg``-gates. |
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.
perhaps it's worth to explain that this is useful after SK? and provide some example?
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.
Done in cb37227
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. thanks!
* CliffordT optimization * Adding OptimizeCliffordT to the Clifford+T pipeline * improving release notes based on review comments
Summary
This PR adds a Clifford+T optimization pass (see #14225 (review)). For now all it does is merging pairs of consecutive T-gates into S-gates, and pairs of consecutive Tdg-gates into Sdg-gates.
Despite its simplicity, it's already quite useful on circuits generated by the Solovay-Kitaev algorithm (which we call with
["t", "tdg", "h"]
basis set) reducing the overall T-count by approximately 5%-10%.Longer-term the internals of this pass will be completely rewritten based on better algorithms available.
Details and comments
One can think of this as a placeholder for Clifford+T optimization algorithms that we are planning to implement.
I thought that
CommutativeCancellation
could merge consecutiveRz
andT
-rotations (exploiting commutativity), however it does not do that. And I could not find any other Qiskit pass that can do this for us.ToDo: add this to the optimization stage of the Clifford+T pipeline.