Skip to main contentIBM Quantum Documentation
You are viewing the API reference for an old version of Qiskit SDK. Switch to latest version



GitHub(opens in a new tab)

Convert schedule block instruction into DAG.

ScheduleBlock can be represented as a DAG as needed. For example, equality of two programs are efficiently checked on DAG representation.

with as sched1:
    with pulse.align_left():, pulse.DriveChannel(0))
        pulse.shift_phase(1.57, pulse.DriveChannel(2)), pulse.DriveChannel(1))
with as sched2:
    with pulse.align_left():
        pulse.shift_phase(1.57, pulse.DriveChannel(2)), pulse.DriveChannel(1)), pulse.DriveChannel(0))

Here the sched1 `` and ``sched2 are different implementations of the same program, but it is difficult to confirm on the list representation.

Another example is instruction optimization.

with as sched:
    with pulse.align_left():
        pulse.shift_phase(1.57, pulse.DriveChannel(1)), pulse.DriveChannel(0))
        pulse.shift_phase(-1.57, pulse.DriveChannel(1))

In above program two shift_phase instructions can be cancelled out because they are consecutive on the same drive channel. This can be easily found on the DAG representation.


block ("ScheduleBlock") – A schedule block to be converted.

Return type



Instructions in DAG representation.


PulseError – When the context is invalid subclass.

Was this page helpful?
Report a bug or request content on GitHub.