diff --git a/src/qibo/models/circuit.py b/src/qibo/models/circuit.py index fb038a54e3..4aff6fd184 100644 --- a/src/qibo/models/circuit.py +++ b/src/qibo/models/circuit.py @@ -87,7 +87,7 @@ def from_fused(self): @property def nmeasurements(self): - return len([1 for gate in self if isinstance(gate, gates.M)]) + return len(list(filter(lambda gate: isinstance(gate, gates.M), self))) @property def moments(self):