Instruction

class Instruction(operands, duration, channels, name=None)[source]

The smallest schedulable unit: a single instruction. It has a fixed duration and specified channels.

Instruction initializer.

Parameters
  • operands (Tuple) – The argument list.

  • duration (Union[Command, int]) – Length of time taken by the instruction in terms of dt. Deprecated: the first argument used to be the Command.

  • channels (Tuple[Channel]) – Tuple of pulse channels that this instruction operates on.

  • name (Optional[str]) – Optional display name for this instruction.

Raises

PulseError – If duration is negative.

Attributes

Instruction.channels

Returns channels that this schedule uses.

Instruction.command

The associated command.

Instruction.duration

Duration of this instruction.

Instruction.id

Unique identifier for this instruction.

Instruction.instructions

Iterable for getting instructions from Schedule tree.

Instruction.name

Name of this instruction.

Instruction.operands

Return instruction operands.

Instruction.start_time

Relative begin time of this instruction.

Instruction.stop_time

Relative end time of this instruction.

Instruction.timeslots

Occupied time slots by this instruction.

Methods

Instruction.append(schedule[, name])

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

Instruction.ch_duration(*channels)

Return duration of the supplied channels in this Instruction.

Instruction.ch_start_time(*channels)

Return minimum start time for supplied channels.

Instruction.ch_stop_time(*channels)

Return maximum start time for supplied channels.

Instruction.draw([dt, style, filename, …])

Plot the instruction.

Instruction.flatten()

Return itself as already single instruction.

Instruction.insert(start_time, schedule[, name])

Return a new Schedule with schedule inserted within self at start_time.

Instruction.shift(time[, name])

Return a new schedule shifted forward by time.

Instruction.union(*schedules[, name])

Return a new schedule which is the union of self and schedule.