From a5ae5d7c54c3c81f98e4fa36af84cb4f45494866 Mon Sep 17 00:00:00 2001 From: Tanuj Khattar Date: Wed, 16 Mar 2022 15:50:08 -0700 Subject: [PATCH 1/2] Add support for decompositions of parameterized cirq.CCZPowGate --- cirq-core/cirq/ops/three_qubit_gates.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/cirq-core/cirq/ops/three_qubit_gates.py b/cirq-core/cirq/ops/three_qubit_gates.py index fc48391c4c8..25e583f1f73 100644 --- a/cirq-core/cirq/ops/three_qubit_gates.py +++ b/cirq-core/cirq/ops/three_qubit_gates.py @@ -95,9 +95,6 @@ def _decompose_(self, qubits): where p = T**self._exponent """ - if protocols.is_parameterized(self): - return NotImplemented - a, b, c = qubits # Hacky magic: avoid the non-adjacent edge. From feb7ef77becc74042afae6f9b72f1f233f765074 Mon Sep 17 00:00:00 2001 From: Tanuj Khattar Date: Wed, 16 Mar 2022 18:40:19 -0700 Subject: [PATCH 2/2] Add test for parameterized decomposition of CCZ --- cirq-core/cirq/ops/three_qubit_gates_test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cirq-core/cirq/ops/three_qubit_gates_test.py b/cirq-core/cirq/ops/three_qubit_gates_test.py index 61d29a1a322..bf9e3f4b7f4 100644 --- a/cirq-core/cirq/ops/three_qubit_gates_test.py +++ b/cirq-core/cirq/ops/three_qubit_gates_test.py @@ -192,6 +192,7 @@ def test_identity_multiplication(): (cirq.CCZ(*cirq.LineQubit.range(3)), 8), (cirq.CCX(*cirq.LineQubit.range(3)), 8), (cirq.CCZ(cirq.LineQubit(0), cirq.LineQubit(2), cirq.LineQubit(1)), 8), + (cirq.CCZ(cirq.LineQubit(0), cirq.LineQubit(2), cirq.LineQubit(1)) ** sympy.Symbol("s"), 8), (cirq.CSWAP(*cirq.LineQubit.range(3)), 9), (cirq.CSWAP(*reversed(cirq.LineQubit.range(3))), 9), (cirq.CSWAP(cirq.LineQubit(1), cirq.LineQubit(0), cirq.LineQubit(2)), 12),