Skip to content

Commit

Permalink
Remove stale condition from assert_controlled_and_controlled_by_ident…
Browse files Browse the repository at this point in the history
…ical test (#5391)

* Remove stale condition from assert_controlled_and_controlled_by_identical test

* Fix lint errors
  • Loading branch information
tanujkhattar authored May 23, 2022
1 parent 3e3d6f7 commit 352a976
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions cirq-core/cirq/testing/consistent_controlled_gate_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from typing import Sequence, Optional, Union, Collection

from cirq import protocols, devices, ops
from cirq import devices, ops


def assert_controlled_and_controlled_by_identical(
Expand All @@ -39,10 +39,6 @@ def _assert_gate_consistent(
num_controls: int,
control_values: Optional[Sequence[Union[int, Collection[int]]]],
) -> None:
if isinstance(gate, ops.DensePauliString) and protocols.is_parameterized(gate):
# Parameterized `DensePauliString`s cannot be applied to qubits to produce valid operations.
# TODO: This behavior should be fixed (https://github.com/quantumlib/Cirq/issues/4508)
return None
gate_controlled = gate.controlled(num_controls, control_values)
qubits = devices.LineQid.for_gate(gate_controlled)
control_qubits = qubits[:num_controls]
Expand Down

0 comments on commit 352a976

Please sign in to comment.