Skip to content

Commit cfc3bf8

Browse files
committed
fix TComplexity for cirq.GlobalPhaseGate and cirq.global_phase_operation
1 parent 4a91c20 commit cfc3bf8

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

qualtran/bloqs/basic_gates/su2_rotation.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def wire_symbol(self, soq: 'Soquet') -> 'WireSymbol':
138138
)
139139

140140
def _t_complexity_(self) -> TComplexity:
141-
return TComplexity(rotations=3, clifford=1)
141+
return TComplexity(rotations=3)
142142

143143
def _is_parameterized_(self) -> bool:
144144
return any(

qualtran/cirq_interop/t_complexity_protocol.py

+5
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ def _is_clifford_or_t(stc: Any, fail_quietly: bool) -> Optional[TComplexity]:
9494
if not isinstance(stc, (cirq.Gate, cirq.Operation)):
9595
return None
9696

97+
if isinstance(stc, cirq.GlobalPhaseGate) or (
98+
isinstance(stc, cirq.Operation) and isinstance(stc.gate, cirq.GlobalPhaseGate)
99+
):
100+
return TComplexity()
101+
97102
if isinstance(stc, cirq.ClassicallyControlledOperation):
98103
stc = stc.without_classical_controls()
99104

0 commit comments

Comments
 (0)