SegmentPointer#

class iqm.pulse.scheduler.SegmentPointer(source, idx, TOL, frac=0.0)#

Bases: object

Tool for working with Segments.

Serves as a time pointer inside the Segment.

Module: iqm.pulse.scheduler

Attributes

frac

time, in seconds, after the start of the current instruction

remainder

Remaining duration of the current instruction (in seconds).

source

contents of the Segment

idx

index of the current instruction

TOL

time durations equal or smaller than this tolerance are considered zero (in seconds)

Methods

cut_tail

Cut the source of the pointer at the current index.

fastforward

Move the pointer forward by duration seconds.

get

Current instruction.

next

Move to the beginning of the next instruction.

rewind

Move the pointer back by duration seconds.

tail

Instructions from the current index onwards.

Parameters:
source: list[Instruction]#

contents of the Segment

idx: int#

index of the current instruction

TOL: float#

time durations equal or smaller than this tolerance are considered zero (in seconds)

frac: float = 0.0#

time, in seconds, after the start of the current instruction

get()#

Current instruction.

Return type:

Instruction

property remainder: float#

Remaining duration of the current instruction (in seconds).

next()#

Move to the beginning of the next instruction.

Return type:

bool

cut_tail()#

Cut the source of the pointer at the current index.

Truncate source at idx, make self point to the cut tail part only. frac is not changed.

Note: modifies source.

Return type:

None

tail()#

Instructions from the current index onwards.

Return type:

Sequence[Instruction]

rewind(duration)#

Move the pointer back by duration seconds.

Parameters:

duration (float) –

Return type:

None

fastforward(duration)#

Move the pointer forward by duration seconds.

Parameters:

duration (float) –

Return type:

bool