@@ -230,7 +230,7 @@ def bloq_is_rotation(b: Bloq) -> bool:
230230 This function has a shim for counting Controlled[Rotation] gates as a rotation, which
231231 will be remediated when the Qualtran standard library gains a bespoke bloq for each CRot.
232232 """
233- from qualtran .bloqs .basic_gates import GlobalPhase , SGate , TGate
233+ from qualtran .bloqs .basic_gates import SGate , TGate
234234 from qualtran .bloqs .basic_gates .rotation import (
235235 CZPowGate ,
236236 Rx ,
@@ -242,12 +242,17 @@ def bloq_is_rotation(b: Bloq) -> bool:
242242 )
243243
244244 if isinstance (b , Controlled ):
245+ if b .ctrl_spec .num_qubits > 1 :
246+ return False
247+
245248 # TODO https://github.com/quantumlib/Qualtran/issues/878
246249 # explicit representation of all two-qubit rotations.
247- if isinstance (b .subbloq , (SGate , TGate , GlobalPhase )):
250+ if isinstance (b .subbloq , (SGate , TGate )):
248251 return True
249252
250- return bloq_is_rotation (b .subbloq )
253+ # For historical reasons, this hacky solution for controlled rotations does *not*
254+ # do clifford, T angle simplification.
255+ return isinstance (b .subbloq , (Rx , Ry , Rz , XPowGate , YPowGate , ZPowGate ))
251256
252257 if isinstance (b , CZPowGate ):
253258 return True
0 commit comments