Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cirq-core/cirq/ops/common_gates.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def _phase_by_(self, phase_turns, qubit_index):
def _has_stabilizer_effect_(self) -> bool | None:
if self._is_parameterized_() or self._dimension != 2:
return None
return self.exponent % 0.5 == 0
return abs(self.exponent % 0.5) < 1e-8

def __str__(self) -> str:
if self._global_shift == 0:
Expand Down Expand Up @@ -480,7 +480,7 @@ def _phase_by_(self, phase_turns, qubit_index):
def _has_stabilizer_effect_(self) -> bool | None:
if self._is_parameterized_():
return None
return self.exponent % 0.5 == 0
return abs(self.exponent % 0.5) < 1e-8

def __str__(self) -> str:
if self._global_shift == 0:
Expand Down Expand Up @@ -760,7 +760,7 @@ def _phase_by_(self, phase_turns: float, qubit_index: int):
def _has_stabilizer_effect_(self) -> bool | None:
if self._is_parameterized_() or self._dimension != 2:
return None
return self.exponent % 0.5 == 0
return abs(self.exponent % 0.5) < 1e-8

def _circuit_diagram_info_(
self, args: cirq.CircuitDiagramInfoArgs
Expand Down
Loading