Skip to content

Commit

Permalink
Add support for decompositions of parameterized cirq.CCZPowGate (qu…
Browse files Browse the repository at this point in the history
…antumlib#5087)

* Add support for decompositions of parameterized cirq.CCZPowGate

* Add test for parameterized decomposition of CCZ
  • Loading branch information
tanujkhattar authored Mar 17, 2022
1 parent 78c2b79 commit a5ae2c5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 0 additions & 3 deletions cirq/ops/three_qubit_gates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions cirq/ops/three_qubit_gates_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit a5ae2c5

Please sign in to comment.