jaqalpaq.scheduler package

jaqalpaq.scheduler.schedule_circuit(circ)

Takes every jaqalpaq.core.BlockStatement that has been flagged unscheduled, and replaces it with a block that is functionally identical (contains the same gates, without reordering any non-commuting operations); complies with the restrictions of the QSCOUT hardware and low-level software stack; and reorders gates to act in parallel where possible.

Currently the restrictions on parallelization are:

  • Two-qubit gates cannot occur in parallel with any other operation.

  • State preparation and measurement cannot occur in parallel with any other operation.

  • No qubit can be involved in multiple simultaneous gates.

  • Macro-defined gates cannot occur in parallel with any other operation.

  • Loop statements cannot occur in parallel with any other operation.

These restrictions are not enforced by Jaqal itself, and other submodules may generate code that does not comply with them if instructed to by the user, but they will not execute on the current version of the QSCOUT hardware, and so this scheduler does not introduce them.

Additionally, sequential blocks cannot be nested directly in other sequential blocks; when the process of scheduling creates such a nesting, it will automatically replace the inner block with every gate it contains.

Parameters

circ (Circuit) – The circuit to parallelize.

Returns

The rescheduled circuit. This may share some data with the original circuit, which should not be modified.