QuTech-Delft / OpenQL

OpenQL: A Portable Quantum Programming Framework for Quantum Accelerators. https://dl.acm.org/doi/10.1145/3474222
https://openql.readthedocs.io
Other
100 stars 44 forks source link

Quantum and classical scheduling are not independent #487

Open jvansomeren opened 1 year ago

jvansomeren commented 1 year ago

Unlike earlier reasoning, the quantum scheduling depends on classical dependences and, when not done at the same time but in sequence, the quantum scheduling will impose deadlines to the classical scheduling.

For example: in a conditional gate, the condition may depend on classical boolean variables that got their value through long dependence chains that at the start could be fed by measurement results. A b[x] is depending on an earlier q[x] having been measured. That would indeed imply a dependence in the quantum program. With the classical and the quantum stream, the quantum stream being operations with at least one qubit reference, in the timing (and scheduling) of the quantum stream the durations of the operations in the classical stream can thus not be ignored. There can be a very long dependence chain from measurement results through the full program (by loops etc) through classical variables, what ever, to reach a condition on a gate. So at least the dependences of classical code matter to scheduling the quantum code. This also means that the classical code must be scheduled together with the quantum code. However, this still is peculiar:

So there isn't a quantum scheduling that it is independent from classical scheduling. But from the point of view that the classical code is just supportive to the quantum operation, we could set constraints here:

The cycle assignment by the quantum scheduler can be seen as imposing deadlines to the classical scheduler. Those cycles could be (and are probably) transferred from the gates to the microcodes implementing those gates.