ConditionalInstruction#

Module: iqm.pulse.playlist.instructions

class iqm.pulse.playlist.instructions.ConditionalInstruction(duration, condition, outcomes)#

Bases: Instruction

Choice between multiple Instructions, depending on a condition.

Attributes

condition

Can be evaluated to an integer >= 0 representing an outcome.

outcomes

Maps possible outcomes of the condition to the corresponding instructions.

duration

Time duration of the instruction.

id

Unique id for caching purposes, which can be used if the instruction is not hashable.

Methods

get_child_instructions

Returns all the child Instructions the Instruction contains.

validate

Validate the instruction attributes.

Parameters:
condition: str#

Can be evaluated to an integer >= 0 representing an outcome.

outcomes: tuple[Instruction, ...]#

Maps possible outcomes of the condition to the corresponding instructions.

validate()#

Validate the instruction attributes.

Raises:

ValueError – something about the instruction is not ok

Return type:

None

get_child_instructions()#

Returns all the child Instructions the Instruction contains.

Return type:

tuple[Instruction, …]

Inheritance

Inheritance diagram of iqm.pulse.playlist.instructions.ConditionalInstruction