qat.experimental.dialect.q1_sequence.ir.ops module

class SequenceOp(channel_id, program, waveforms=None, weights=None, acquisitions=None)

Bases: SequenceOp, IRDLOperation, Operation, _IRNode, ABC, object

A sequence op represents the payload for a single Sequencer/PPU in a Qblox instrument. The body region holds Q1 assembly ops across one or more blocks, each terminated by an IsTerminator op: q1_cf branches wire the control-flow graph and Stop* ops end terminating paths. In multi-block (CFG) form the region must be linearised to a single block before emission, since emit_sequence lowers via q1.emit_program which requires all ops to be AssemblyPrintable (q1_cf terminators are not). Data table attributes (waveforms, weights, acquisitions) are static lookup tables referenced by instruction indices.

Parameters:
  • sym_name – Channel/sequencer identifier (e.g. "Q0_drive").

  • body – Region of Q1 instruction ops, one or more blocks.

  • waveforms (Optional[ArrayAttr[WaveformAttr]]) – Waveform data table entries.

  • weights (Optional[ArrayAttr[WeightAttr]]) – Weight data table entries.

  • acquisitions (Optional[ArrayAttr[AcquisitionAttr]]) – Acquisition data table entries.

acquisitions

Accessor for an operation property.

attributes: dict[str, Attribute]

The attributes attached to the operation.

body

Access a non-variadic construct which appears before any variadic arguments.

property channel_id: StringAttr

Alias for sym_name, the channel identifier.

classmethod get_irdl_definition()

Get the IRDL operation definition.

location: LocationAttr

The source location attached to this operation.

name: ClassVar[str] = 'q1_sequence.sequence'

The operation name. Should be a static member of the class

properties: dict[str, Attribute]

The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.

sym_name

Accessor for an operation attribute.

traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>

Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.

verify_()

Verifies SequenceOp invariants.

  • channel_id must be non-empty.

  • Body must contain at least one block.

  • Each block in the body must end with an IsTerminator op.

  • Indices must be unique within each data table.

  • Names must be unique within each data table.

waveforms

Accessor for an operation property.

weights

Accessor for an operation property.

find_enclosing_sequence(op)

Walk the parent chain to find the enclosing SequenceOp.

Parameters:

op (Operation) – The operation from which to start the upward search.

Return type:

SequenceOp

Returns:

The nearest ancestor SequenceOp of op.

Raises:

ValueError – If no SequenceOp is found in the parent chain.