Bengali
Languages
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

Schedule

class Schedule(*schedules, name=None, metadata=None)[source]

Bases: object

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 [1]. 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 Schedule object.

It is necessary to specify the absolute start time and duration for each instruction so as to deterministically fix its execution time.

The Schedule program 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
    

A PulseError is 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 ScheduleBlock representation may be used instead.

References

[1]: https://arxiv.org/abs/2004.06755

Create an empty schedule.

প্যারামিটার
  • *schedules -- Child Schedules of this parent Schedule. May either be passed as the list of schedules, or a list of (start_time, schedule) pairs.

  • 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 metadata attribute. It will not be directly used in the schedule.

রেইজেস

TypeError -- if metadata is not a dict.

Methods

append

Return a new schedule with schedule inserted at the maximum time over all channels shared between self and schedule.

assign_parameters

Assign the parameters in this schedule according to the input.

ch_duration

Return the time of the end of the last instruction over the supplied channels.

ch_start_time

Return the time of the start of the first instruction over the supplied channels.

ch_stop_time

Return maximum start time over supplied channels.

draw

Plot the schedule.

exclude

Return a Schedule with 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::.

filter

Return a new Schedule with only the instructions from this Schedule which pass though the provided filters; i.e. an instruction will be retained iff every function in filter_funcs returns 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 time_ranges or intervals.

get_parameters

Get parameter object bound to this schedule by string name.

initialize_from

Create new schedule object with metadata of another schedule object.

insert

Return a new schedule with schedule inserted into self at start_time.

is_parameterized

Return True iff the instruction is parameterized.

replace

Return a Schedule with the old instruction replaced with a new instruction.

shift

Return a schedule shifted forward by time.

Attributes

channels

Returns channels that this schedule uses.

রিটার্ন টাইপ

Tuple[Channel]

children

Return the child schedule components of this Schedule in the order they were added to the schedule.

Notes

Nested schedules are returned as-is. If you want to collect only instructions, use py:meth:~Schedule.instructions instead.

রিটার্ন টাইপ

Tuple[Tuple[int, Union[Schedule, Instruction]], ...]

রিটার্নস

A tuple, where each element is a two-tuple containing the initial scheduled time of each NamedValue and the component itself.

duration

Duration of this schedule.

রিটার্ন টাইপ

int

instances_counter = count(0)
instructions

Get the time-ordered instructions from self.

রিটার্ন টাইপ

Tuple[Tuple[int, Instruction]]

metadata

The user provided metadata associated with the schedule.

User provided dict of 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.

রিটার্ন টাইপ

Dict[str, Any]

name

Name of this Schedule

রিটার্ন টাইপ

str

parameters

Parameters which determine the schedule behavior.

রিটার্ন টাইপ

Set

prefix = 'sched'
start_time

Starting time of this schedule.

রিটার্ন টাইপ

int

stop_time

Stopping time of this schedule.

রিটার্ন টাইপ

int

timeslots

Time keeping attribute.

রিটার্ন টাইপ

Dict[Channel, List[Tuple[int, int]]]