Request: add back support for multiple timing constraints
!1242 (merged) added the functionality for the support of ALAP scheduling. However, it also removed support of multiple timing constraints. This is functionality that we rely heavily on within OrangeQS. Hence, I'd like to request to re-add it.
To indicate the problem, let's take a simple Bell schedule, adapted from the documentation
import numpy as np
from quantify_scheduler import Schedule
from quantify_scheduler.operations import CZ, Measure, Reset, Rxy, X90
sched = Schedule("Bell experiment")
for acq_idx, theta in enumerate(np.linspace(0, 360, 21)):
sched.add(Reset(q0, q1))
x0 = sched.add(X90(q0))
x1 = sched.add(X90(q1), ref_pt="start") # Start at the same time as the other X90
cz = sched.add(CZ(q0, q1))
cz.add_timing_constraint(ref_schedulable=x0) # Required in case x1 is longer than x0
sched.add(Rxy(theta=theta, phi=0, qubit=q0))
sched.add(Measure(q0, acq_index=acq_idx), label="M q0 {:.2f} deg".format(theta))
sched.add(
Measure(q1, acq_index=acq_idx),
label="M q1 {:.2f} deg".format(theta),
ref_pt="start", # Start at the same time as the other measure
)
sched
Here, I've added an additional timing constraint of the CZ on the X90 on q0. This is required, because if the X90 on q0 is 40 ns, and the X90 on q1 is 20 ns (which is not an unrelealistic scenario), the CZ would overlap with the X90 on q0.
The removal of the multiple timing constraints disallows even simple schedules as this one. Another example schedule could be
sched = Schedule("Simple schedule)
reset = sched.add(Reset(q0, q1))
x0_0 = sched.add(X(q0))
x0_1 = sched.add(X(q0))
x1_0 = sched.add(X(q1), ref_op=reset)
measure = sched.add(Measure(q0, q1))
measure.add_timing_constraint(ref_op=x0_1)
Assuming we don't want the Measure operation to overlap with any of the X operations, we'll need multiple timing constraints even if we are using pulses of the same length.