Operations added _outside_ a control-flow sub-schedule but _simultaneous with_ the control-flow sub-schedule should not be included in the control-flow block
The title is very generic, but an example of what I mean is the following:
inner = Schedule("inner")
inner.add(SquarePulse(amp=0.5, duration=100e-9, port="q0:mw", clock="q0.01"))
sched = Schedule("test")
loop = sched.add(inner, control_flow=Loop(repetitions=3))
sched.add(
SquarePulse(amp=0.25, duration=40e-9, port="q6:mw", clock="q6.01"),
ref_pt="start",
rel_time=20e-9,
ref_op=loop,
)
In this example, the second square pulse will also be included in the loop, which is unintuitive. This should be resolved by either not having a loop on the q6:mw-q6.01
port-clock, or rejecting code like this with an error.
The example is a bit contrived, but in the future this may become a larger issue, in particular for the Qblox backend. This is because I want to introduce a feature where, if an operation consists of 2 parts in Q1ASM, e.g. set marker high and set marker low, or enable TTL acquisition and disable TTL acquisition, it should be possible to schedule something in between on the same port-clock. See !934 (comment 1816664083) for an example of what may go wrong in that case.