Transpiler pass that converts a generic circuit to PBC #15502
Transpiler pass that converts a generic circuit to PBC #15502alexanderivrii merged 79 commits intoQiskit:mainfrom
Conversation
Pull Request Test Coverage Report for Build 22140508833Warning: 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 |
|
Thanks Shelly for working on this. Some quick comments:
|
alexanderivrii
left a comment
There was a problem hiding this comment.
Huge thanks Shelly for working on this, this pass is shaping up quite nicely. I haven't fully checked the heart of the pass (i.e. which Pauli-based decompositions we construct for different gates, and whether these can be improved), for now I have just left a few high-level comments that may help you finalize the rust code;
- please see my previous comments here, I don't think all are fully addressed yet
- we should support parameterized gates (as we have methods to multiply a parameter expression by a float factor)
- we should try to deduplicate the code (combine common logic when possible)
- we should avoid
panic!andunreachable!when it makes sense
|
Thanks for the hard work, Shelly. If it's not too much to ask, could you please update using |
|
failing tests are due to an error with binding parameters for parmatrized |
alexanderivrii
left a comment
There was a problem hiding this comment.
Thanks Shelly for the quick updates to use PPRs. I have a few minor nitpicks about the comments + the docstrings, otherwise it is completely ready.
| /// Map gates to a list of equivalent Pauli product rotations and a global phase. | ||
| /// Each element of the list is of the form ((pauli, phase, [qubit indices]), global_phase). |
There was a problem hiding this comment.
Could you please update this comment something like that this writes a standard gate
| /// Map gates with more than one parameter to a list of equivalent Pauli product rotations and a global phase. | ||
| /// Each element of the list is of the form ((pauli, phase, [qubit indices]), global_phase). |
There was a problem hiding this comment.
Same here: add a comment about the factor of 2 for pauli product rotations.
| standard gates, barriers and measurements, into an equivalent list of | ||
| :class:`.PauliProductRotationGate` and a global phase, as well as | ||
| :class:`.PauliProductMeasurement`. |
There was a problem hiding this comment.
same comment here: the pass converts a circuit to a circuit, not to a list.
Co-authored-by: Alexander Ivrii <alexi@il.ibm.com>
Co-authored-by: Alexander Ivrii <alexi@il.ibm.com>
Co-authored-by: Alexander Ivrii <alexi@il.ibm.com>
Co-authored-by: Alexander Ivrii <alexi@il.ibm.com>
Co-authored-by: Alexander Ivrii <alexi@il.ibm.com>
Co-authored-by: Alexander Ivrii <alexi@il.ibm.com>
…ns.py Co-authored-by: Alexander Ivrii <alexi@il.ibm.com>
alexanderivrii
left a comment
There was a problem hiding this comment.
Thanks for the quick updates, LGTM!
Summary
close #15451
For each of the standard 1-qubit and 2-qubit gates, that do not have parameters, or have only one parameter,
we currently map the gate to a list of equivalent Pauli rotations and a global phase.
Each element of the list is of the form
((Pauli string, phase rescale factor, [qubit indices]), global phase).For gates that didn't have a phase (e.g. X)
the phase rescale factor is simply the phase of the rotation gate. The convention is
original_gate = PauliEvolutionGate(pauli, phase) * e^{i global_phase * phase}The transpiler pass will output the corresponding
PauliEvolutionGate.Details and comments