- class Schedule(*schedules, name=None, metadata=None)¶
A quantum program schedule with exact time constraints for its instructions, operating over all input signal channels and supporting special syntaxes for building.
Pulse program representation for the original Qiskit Pulse model . Instructions are not allowed to overlap in time on the same channel. This overlap constraint is immediately evaluated when a new instruction is added to the
It is necessary to specify the absolute start time and duration for each instruction so as to deterministically fix its execution time.
Scheduleprogram supports some syntax sugar for easier programming.
Appending an instruction to the end of a channel
sched = Schedule() sched += Play(Gaussian(160, 0.1, 40), DriveChannel(0))
Appending an instruction shifted in time by a given amount
sched = Schedule() sched += Play(Gaussian(160, 0.1, 40), DriveChannel(0)) << 30
Merge two schedules
sched1 = Schedule() sched1 += Play(Gaussian(160, 0.1, 40), DriveChannel(0)) sched2 = Schedule() sched2 += Play(Gaussian(160, 0.1, 40), DriveChannel(1)) sched2 = sched1 | sched2
PulseErroris immediately raised when the overlap constraint is violated.
In the schedule representation, we cannot parametrize the duration of instructions. Thus we need to create a new schedule object for each duration. To parametrize an instruction’s duration, the
ScheduleBlockrepresentation may be used instead.
Create an empty schedule.
*schedules (Union[ScheduleComponent, Tuple[int, ScheduleComponent]]) – Child Schedules of this parent Schedule. May either be passed as the list of schedules, or a list of
name (Optional[str]) – Name of this schedule. Defaults to an autogenerated string if not provided.
metadata (Optional[dict]) – Arbitrary key value metadata to associate with the schedule. This gets stored as free-form data in a dict in the
metadataattribute. It will not be directly used in the schedule.
TypeError – if metadata is not a dict.
Return a new schedule with
scheduleinserted at the maximum time over all channels shared between
Assign the parameters in this schedule according to the input.
Return the time of the end of the last instruction over the supplied channels.
Return the time of the start of the first instruction over the supplied channels.
Return maximum start time over supplied channels.
Plot the schedule.
Schedulewith only the instructions from this Schedule failing at least one of the provided filters. This method is the complement of py:meth:~self.filter, so that::.
Return a new
Schedulewith only the instructions from this
Schedulewhich pass though the provided filters; i.e. an instruction will be retained iff every function in
True, the instruction occurs on a channel type contained in
channels, the instruction type is contained in
instruction_types, and the period over which the instruction operates is fully contained in one specified in
Get parameter object bound to this schedule by string name.
Create new schedule object with metadata of another schedule object.
Return a new schedule with
Return True iff the instruction is parameterized.
oldinstruction replaced with a
Return a schedule shifted forward by
Returns channels that this schedule uses.
Return the child schedule components of this
Schedulein the order they were added to the schedule.
Nested schedules are returned as-is. If you want to collect only instructions, use py:meth:~Schedule.instructions instead.
A tuple, where each element is a two-tuple containing the initial scheduled time of each
NamedValueand the component itself.
Duration of this schedule.
- instances_counter = count(0)¶
Get the time-ordered instructions from self.
The user provided metadata associated with the schedule.
dictof metadata for the schedule. The metadata contents do not affect the semantics of the program but are used to influence the execution of the schedule. It is expected to be passed between all transforms of the schedule and that providers will associate any schedule metadata with the results it returns from the execution of that schedule.
Name of this Schedule
Parameters which determine the schedule behavior.
- prefix = 'sched'¶
Starting time of this schedule.
Stopping time of this schedule.
Time keeping attribute.