-
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
Add clifford gates to collect_cliffords #12750
Conversation
One or more of the following people are relevant to this code:
|
Pull Request Test Coverage Report for Build 9890871127Warning: 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 @ShellyGarion, this looks good! If we want a more general approach that supports whatever is supported by
or
My only concern with these suggestions is whether they are not prohibitively slow for large clifford circuits. UPDATE: unfortunately the suggestions do make the pass slower: a quick experiment on 10 random circuits (created by
|
another suggestion: can we use |
@alexanderivrii - thanks for your suggestion. I also fixed |
"pauli", | ||
] | ||
clifford_gate_names = ( | ||
list(_BASIS_1Q.keys()) + list(_BASIS_2Q.keys()) + ["clifford", "linear_function", "pauli"] |
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.
should we also add "permutation" here?
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.
I think it's a good idea. I have checked and we can indeed construct a Clifford from a circuit containing PermutationGate
objects, so it makes sense for the collection pass to handle these as well
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 for doing this!
* add clifford gates to collect_cliffords * replace hard coded clifford names by clifford_circuit names * move import * replace hard coded clifford names in random_clifford_circuit * add release notes * add permutation to collect_clifford gate list (cherry picked from commit 41267ec) # Conflicts: # qiskit/circuit/random/utils.py
* Add clifford gates to collect_cliffords (#12750) * add clifford gates to collect_cliffords * replace hard coded clifford names by clifford_circuit names * move import * replace hard coded clifford names in random_clifford_circuit * add release notes * add permutation to collect_clifford gate list (cherry picked from commit 41267ec) # Conflicts: # qiskit/circuit/random/utils.py * Update utils.py * Update utils.py --------- Co-authored-by: Shelly Garion <46566946+ShellyGarion@users.noreply.github.com> Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
* add clifford gates to collect_cliffords * replace hard coded clifford names by clifford_circuit names * move import * replace hard coded clifford names in random_clifford_circuit * add release notes * add permutation to collect_clifford gate list
Summary
This PR adds some Clifford gates to the
CollectClifford()
transpiler pass.Details and comments
This is an immediate bugfix which does not handle the following problems:
When adding a gate to the Clifford class, it should be added in other places of the code,
and there is no single list of gates that the Clifford class supports.
qiskit/qiskit/transpiler/passes/optimization/collect_cliffords.py
Line 27 in 6b57b78
and
qiskit/qiskit/circuit/random/utils.py
Line 290 in fa3d6df
The current Clifford class can handle certain
u
gates (for certain angles), and this does not appear in the docs, neither in the code above:qiskit/qiskit/quantum_info/operators/symplectic/clifford_circuits.py
Line 100 in fa3d6df