About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
qiskit.pulse.transforms.block_to_dag
block_to_dag(block)
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 pulse.build() as sched1:
with pulse.align_left():
pulse.play(my_gaussian0, pulse.DriveChannel(0))
pulse.shift_phase(1.57, pulse.DriveChannel(2))
pulse.play(my_gaussian1, pulse.DriveChannel(1))
with pulse.build() as sched2:
with pulse.align_left():
pulse.shift_phase(1.57, pulse.DriveChannel(2))
pulse.play(my_gaussian1, pulse.DriveChannel(1))
pulse.play(my_gaussian0, 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 pulse.build() as sched:
with pulse.align_left():
pulse.shift_phase(1.57, pulse.DriveChannel(1))
pulse.play(my_gaussian0, 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.
Parameters
block ("ScheduleBlock") – A schedule block to be converted.
Return type
PyDAG
Returns
Instructions in DAG representation.
Raises
PulseError – When the context is invalid subclass.
Was this page helpful?
Report a bug or request content on GitHub.