diff --git a/cirq-core/cirq/ops/raw_types.py b/cirq-core/cirq/ops/raw_types.py index 696868fe780..168c3cd1765 100644 --- a/cirq-core/cirq/ops/raw_types.py +++ b/cirq-core/cirq/ops/raw_types.py @@ -939,7 +939,9 @@ def _trace_distance_bound_(self) -> float: return protocols.trace_distance_bound(self.sub_operation) def _phase_by_(self, phase_turns: float, qubit_index: int) -> 'cirq.Operation': - return protocols.phase_by(self.sub_operation, phase_turns, qubit_index) + return protocols.phase_by( + self.sub_operation, phase_turns, qubit_index, default=NotImplemented + ) def __pow__(self, exponent: Any) -> 'cirq.Operation': return self.sub_operation**exponent diff --git a/cirq-core/cirq/ops/raw_types_test.py b/cirq-core/cirq/ops/raw_types_test.py index 34804c95fdf..97cfb3e5a13 100644 --- a/cirq-core/cirq/ops/raw_types_test.py +++ b/cirq-core/cirq/ops/raw_types_test.py @@ -662,6 +662,8 @@ def test_tagged_operation_forwards_protocols(): assert cirq.commutes(tagged_x, clifford_x) assert cirq.commutes(clifford_x, tagged_x) assert cirq.commutes(tagged_x, tagged_x) + assert cirq.phase_by(clifford_x, 0.125, 0, default=None) is None + assert cirq.phase_by(tagged_x, 0.125, 0, default=None) is None assert cirq.trace_distance_bound(y**0.001) == cirq.trace_distance_bound( (y**0.001).with_tags(tag)