Skip to content

Commit

Permalink
Add clifford gates to collect_cliffords (backport #12750) (#12763)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people authored Jul 11, 2024
1 parent 6b57b78 commit 0e429af
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
21 changes: 6 additions & 15 deletions qiskit/transpiler/passes/optimization/collect_cliffords.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
)

from qiskit.quantum_info.operators import Clifford
from qiskit.quantum_info.operators.symplectic.clifford_circuits import _BASIS_1Q, _BASIS_2Q


class CollectCliffords(CollectAndCollapse):
Expand Down Expand Up @@ -69,21 +70,11 @@ def __init__(
)


clifford_gate_names = [
"x",
"y",
"z",
"h",
"s",
"sdg",
"cx",
"cy",
"cz",
"swap",
"clifford",
"linear_function",
"pauli",
]
clifford_gate_names = (
list(_BASIS_1Q.keys())
+ list(_BASIS_2Q.keys())
+ ["clifford", "linear_function", "pauli", "permutation"]
)


def _is_clifford_gate(node):
Expand Down
6 changes: 6 additions & 0 deletions releasenotes/notes/fix-collect-clifford-83af26d98b8c69e8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
fixes:
- |
Add more Clifford gates to the :class:`.CollectCliffords()` transpiler pass.
In particular, we have added the gates :class:`ECRGate()`, :class:`DCXGate()`,
:class:`iSWAPGate()`, :class:`SXGate()` and :class:`SXdgGate()` to this transpiler pass.

0 comments on commit 0e429af

Please sign in to comment.