Schedule#
- class iqm.pulse.playlist.schedule.Schedule(contents=None, *, duration=None)#
Bases:
object
Set of synchronously executed AWG/readout programs that start on a single trigger.
Consists of a number of channels, each containing a
Segment
ofInstruction
s for a specific controller. For each channel, maps the channel name to its Segment of Instructions.Mutable. To make an independent copy, use
copy()
.- Parameters:
contents (Mapping[str, Iterable[Instruction]] | None) – mapping from channel name to a list of Instructions for that channel
duration (int | None) – Optional precomputed duration (in samples). In cases where the duration is known and performance is critical, the duration can be given in the constructor, allowing one to skip computing it.
Module:
iqm.pulse.playlist.schedule
Attributes
The maximum duration of the Schedule's channels, in samples.
Methods
Add new empty channels to the schedule.
Append a single Instruction to a specific channel in the Schedule.
The channels occupied in
self
.Cleans up the schedule by removing things that do not affect the execution.
Make an independent copy of the schedule.
Schedule duration in seconds, taking into account the sample rates of the channels.
Append given Instruction to a specific channel in the Schedule.
Modifies the schedule in place by front-padding it with
Wait
instructions.Modifies the schedule in place by front-padding it with
Wait
instructions.Returns
True
ifself
has content in any of the given channels, otherwiseFalse
.Iterator over the schedule channel names and segments.
Pad channels in
self
to the maximum channel length found within withWait
instructions.Pad channels in
self
to the maximum channel length (seconds) found within with Wait instructions.Fixed-width character graphics representation of the Schedule.
Copy of the schedule with the order of the instructions in each channel reversed.
Copy of the schedule with the order of the instructions in each channel reversed.
Validate the contents of the schedule.
- property duration: int#
The maximum duration of the Schedule’s channels, in samples.
Computed only when needed and cached for performance.
- duration_in_seconds(channel_properties)#
Schedule duration in seconds, taking into account the sample rates of the channels.
- Parameters:
channel_properties (dict[str, ChannelProperties]) – channel properties.
- Returns:
schedule duration (in seconds)
- Return type:
- pprint(time_unit=16)#
Fixed-width character graphics representation of the Schedule.
Assumes the
Instruction.duration
s are in samples.
- items()#
Iterator over the schedule channel names and segments.
- copy()#
Make an independent copy of the schedule.
Mutating the original must not affect the copy, or vice versa. Instructions are immutable, so they need not be copied.
- Returns:
copy of the schedule
- Return type:
- add_channels(channel_names)#
Add new empty channels to the schedule.
If a given channel (identified by its controller name) already exist in the schedule, it is unchanged.
Modifies
self
.
- append(channel, instruction)#
Append a single Instruction to a specific channel in the Schedule.
- Parameters:
channel (str) – name of the channel to append the instruction to
instruction (Instruction) – instruction to append
- Return type:
None
- extend(channel, instructions)#
Append given Instruction to a specific channel in the Schedule.
- Parameters:
channel (str) – name of the channel to append the instructions to
instructions (Iterable[Instruction]) – instructions to append
- Return type:
None
- front_pad(to_duration)#
Modifies the schedule in place by front-padding it with
Wait
instructions.NOTE: this method cannot be used when there are variable sampling rates present in the schedule. In that case, use the method
front_pad_in_seconds
.
- front_pad_in_seconds(to_duration, channel_properties)#
Modifies the schedule in place by front-padding it with
Wait
instructions.The new duration is given in seconds, and this method works also with variable sample rates.
- Parameters:
channel_properties (dict[str, ChannelProperties]) – channel properties.
to_duration (float) –
- Returns:
self
, with the padding
- pad_to_hard_box()#
Pad channels in
self
to the maximum channel length found within withWait
instructions.The
Wait``s are appended to the end of the segments. NOTE: this method cannot be used when there are variable sampling rates present in the schedule. In that case, use the method ``pad_to_hard_box_in_seconds
.- Return type:
None
- pad_to_hard_box_in_seconds(channel_properties)#
Pad channels in
self
to the maximum channel length (seconds) found within with Wait instructions.The Waits are appended to the end of the segments. The segment durations are compared in seconds, so this method works in the case of variable sampling rates as well. The padding is added to a channel only if the difference between the channel’s duration and the maximum duration is larger than the smallest possible instruction duration for that channel.
- Parameters:
channel_properties (dict[str, ChannelProperties]) – channel properties (containing the sampling rates and granularities).
- Return type:
None
- reverse()#
Copy of the schedule with the order of the instructions in each channel reversed.
NOTE: this method cannot be used when there are variable sampling rates present in the schedule.
To preserve synchronization of the channels, the channels are first rear-padded with
Nothing
instructions.- Return type:
- reverse_hard_box()#
Copy of the schedule with the order of the instructions in each channel reversed.
No additional time-synchronisation logic is implemented, so this method will break the synchronisation if
self
is not a schedule with matching durations in all segments.- Return type:
- cleanup()#
Cleans up the schedule by removing things that do not affect the execution.
Removes
empty channels, and
channels that only have idling instructions.
Modifies
self
.- Return type:
- validate(path=())#
Validate the contents of the schedule.