Skip to content

Commit dafceb3

Browse files
committed
Simplify type check
1 parent e16e42c commit dafceb3

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/bloqade/cirq_utils/noise/model.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ def validate_moments(moments: Iterable[cirq.Moment]):
102102
allowed_target_gates: frozenset[cirq.GateFamily] = cirq.CZTargetGateset(
103103
additional_gates=[reset_family]
104104
).gates
105-
# allowed_target_gates: frozenset[cirq.GateFamily] = cirq.CZTargetGateset().gates
106105

107106
for moment in moments:
108107
for operation in moment:
@@ -370,11 +369,10 @@ def noisy_moments(
370369
interleaved_moments = []
371370

372371
def count_remaining_cz_moments(moments_2q):
373-
cz = cirq.CZ
374372
remaining_cz_counts = []
375373
count = 0
376374
for m in moments_2q[::-1]:
377-
if any(isinstance(op.gate, type(cz)) for op in m.operations):
375+
if any(isinstance(op.gate, cirq.CZPowGate) for op in m.operations):
378376
count += 1
379377
remaining_cz_counts = [count] + remaining_cz_counts
380378
return remaining_cz_counts

0 commit comments

Comments
 (0)