Skip to content

Commit

Permalink
feat: replaced loop with filter
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoLiegiBastonLiegi committed Mar 11, 2024
1 parent 0567eff commit 400e163
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/qibo/models/circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 400e163

Please sign in to comment.