Skip to content

Commit daedcc7

Browse files
combine if-branches
Co-authored-by: Pavol Juhas <juhas@google.com>
1 parent 639f85e commit daedcc7

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

cirq-core/cirq/transformers/lightcone_filter.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,8 @@ def lightcone_filter(
4141
for moment in circuit[::-1]:
4242
new_ops = []
4343
for op in moment:
44-
if protocols.is_measurement(op):
44+
if not support.isdisjoint(op.qubits) or protocols.is_measurement(op):
4545
new_ops.append(op)
4646
support.update(op.qubits)
47-
else:
48-
if max(q in support for q in op.qubits):
49-
new_ops.append(op)
50-
support.update(op.qubits)
5147
new_moments.append(circuits.Moment(*new_ops))
5248
return circuits.Circuit.from_moments(*new_moments[::-1])

0 commit comments

Comments
 (0)