Consider the following pattern where the corrections define a closed loop:
from graphix.pattern import Pattern
p1 = Pattern(input_nodes=[0, 1, 2], cmds=[X(0, domain={1}), X(1, domain={2}), X(2, domain={0})])
Calling p1.get_layers() results in an infinite loop. Desired behaviour should be to return None or raise an exception.
To be fixed in Flow refactor part 2.
Related #364