-
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
Synthesis of a Clifford circuit into layers #9220
Conversation
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 3890612257
💛 - 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.
Thanks Shelly for driving this development. This is an important decomposition for Clifford circuits that I know many people are eagerly waiting for being available in Qiskit.
I am not sure that I should be the one officially approving this PR, since I am listed as a co-author. I have included a few minor comments, mostly about documentation.
I am also no longer sure that we need the new LayeredCircuit
class. Initially it seemed a good idea since the decomposition algorithm produces the final circuit which consists of multiple subcircuits (aka "layers"), including a layer consisting only of Hadamard gates, a layer consisting only of CX-gates. a layer consisting only of CZ-gates, etc. And thus it seemed a good idea that we should first create such a layered decomposition, and then apply layer-specific synthesis algorithms to synthesize each layer (e.g., either Patel-Markov-Hayes or Kutin-Moulton-Smithline linear function synthesis algorithm for CX-layers, a CZ-synthesis algorithm for CZ-layers, etc.), but now we are synthesizing these layers eagerly anyway. Bottom line: let's remove the LayeredCircuit
class and simply keep a list of QuantumCircuits as you originally had.
Another question is whether we want to use HighLevelSynthesis
to synthesize layers instead of calling specific cx_synth_func
, etc.? Oh, I have realized that one does not prevent the other, e.g., we can pass cx_synth_func
that simply replaces a "CX layer" by LinearFunction
, and then HLS would be applicable as a follow-up stage. Which means: there is nothing extra needed to do.
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 LGTM, with the caveat I didn't get to check the algorithm details... But then I count the unit test to suffice for this purpose. I left a couple minor comments but I don't think those are blockers for merge
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.
Thanks Shelly! Since I am listed as a co-author on this PR (as I have helped a bit with the initial prototype), I have asked Eli for additional comments. Given that you have also fully addressed his comments, I am marking this as approved.
Summary
This PR decompose a Clifford into 8 layers of 1-qubit and 2-qubit gates.
There are two layers of CZ gates, and one layer of CX gates.
This PR provides a similar construction to Lemma 8 of https://arxiv.org/abs/2003.09412.
co-authored by @alexanderivrii.
Details and comments
The aim is to decompose a Clifford for LNN (linear nearest neighbor) connectivity, see #9036
This PR will be followed by two other PRs for LNN connectivity:
Decompose a CZ circuit in depth 2n by https://arxiv.org/abs/1705.09176
Decompose a CX-CZ circuit in depth 5n by https://arxiv.org/abs/2210.16195
Both of these PRs will allow to decompose a Clifford circuit in depth 7n over LNN connectivity.
This code has been used in: https://arxiv.org/abs/2212.03937