We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 639f85e commit daedcc7Copy full SHA for daedcc7
1 file changed
cirq-core/cirq/transformers/lightcone_filter.py
@@ -41,12 +41,8 @@ def lightcone_filter(
41
for moment in circuit[::-1]:
42
new_ops = []
43
for op in moment:
44
- if protocols.is_measurement(op):
+ if not support.isdisjoint(op.qubits) or protocols.is_measurement(op):
45
new_ops.append(op)
46
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)
51
new_moments.append(circuits.Moment(*new_ops))
52
return circuits.Circuit.from_moments(*new_moments[::-1])
0 commit comments