Pattern.get_layers assumes that inputs cannot be outputs.
This results in inconsistent behaviour, e.g.,
from graphix.pattern import Pattern
p1 = Pattern(input_nodes=[0, 1], cmds=[E((0, 1))])
print(p1) # E(0,1)
meas_order_1 = p1._measurement_order_depth()
print(meas_order_1) # [0, 1] -> Incorrect, [0, 1] are not measured.
p2 = Pattern(input_nodes=[], cmds=[N(0), N(1), E((0, 1))])
print(p2) # E(0,1) N(1) N(0)
meas_order_2 = p2._measurement_order_depth()
print(meas_order_2) # [] -> Correct
assert set(meas_order_1) == set(meas_order_2) # Error
To be fixed in Flow refactor part 2