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
99 stars 44 forks source link

wait in printed qasm/bundles has different meaning from wait in OpenQL API and cqasm #319

Closed jvansomeren closed 2 years ago

jvansomeren commented 4 years ago

wait 2 in compiler-written bundles means that for this and the next cycle there aren't gates to start execution of; any gates started in earlier cycles and with a duration past the current and next cycle execute in parallel to this and the next cycle; it instructs the backend to generate instructions to the controller to not fetch/issue gates for 2 cycles

wait 2 in the OpenQL API and in cqasm means that a barrier is inserted for all qubits, i.e. wait for the completion of the execution of all gates executing in all qubits, then wait 2 additional cycles, and then allow subsequent gates to start execution; it instructs the scheduler to schedule subsequent gates as described

It is the objective to be able to read (as cqasm) any sequence of gates written as bundles, and without further optimization write those as bundles again, scheduled identically, i.e. the input cqasm is the same language as the output cqasm.

It is proposed:

jvansomeren commented 2 years ago

Done in Jeroen's rewrite