Skip to content

Commit a5ae2c5

Browse files
authored
Add support for decompositions of parameterized cirq.CCZPowGate (quantumlib#5087)
* Add support for decompositions of parameterized cirq.CCZPowGate * Add test for parameterized decomposition of CCZ
1 parent 78c2b79 commit a5ae2c5

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

cirq/ops/three_qubit_gates.py

-3
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,6 @@ def _decompose_(self, qubits):
9595
9696
where p = T**self._exponent
9797
"""
98-
if protocols.is_parameterized(self):
99-
return NotImplemented
100-
10198
a, b, c = qubits
10299

103100
# Hacky magic: avoid the non-adjacent edge.

cirq/ops/three_qubit_gates_test.py

+1
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ def test_identity_multiplication():
192192
(cirq.CCZ(*cirq.LineQubit.range(3)), 8),
193193
(cirq.CCX(*cirq.LineQubit.range(3)), 8),
194194
(cirq.CCZ(cirq.LineQubit(0), cirq.LineQubit(2), cirq.LineQubit(1)), 8),
195+
(cirq.CCZ(cirq.LineQubit(0), cirq.LineQubit(2), cirq.LineQubit(1)) ** sympy.Symbol("s"), 8),
195196
(cirq.CSWAP(*cirq.LineQubit.range(3)), 9),
196197
(cirq.CSWAP(*reversed(cirq.LineQubit.range(3))), 9),
197198
(cirq.CSWAP(cirq.LineQubit(1), cirq.LineQubit(0), cirq.LineQubit(2)), 12),

0 commit comments

Comments
 (0)