qat.experimental.dialect.q1_sequence package

class AcqTableIndex(value)

Bases: Q1Imm

Index into a sequencer’s acquisition table: [0, 31].

Up to 32 acquisition entries per sequencer; acquire* instructions reference them via acq_idx.

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

The attribute name should be a static field in the attribute classes.

class AcquisitionAttr(*parameters)

Bases: AcquisitionAttr

An acquisition entry in a Qblox sequence’s acquisitions dictionary.

Parameters:
  • acquisition_name – Acquisition name.

  • index – Acquisition index. Range [0, 31].

  • num_bins – Number of acquisition bins. Range [0, 7_000_000].

acquisition_name: StringAttr = <xdsl.irdl.attributes._ParameterDef object>
classmethod get_irdl_definition()

Get the IRDL attribute definition.

index: AcqTableIndex = <xdsl.irdl.attributes._ParameterDef object>
name: ClassVar[str] = 'q1_sequence.acquisition'

The attribute name should be a static field in the attribute classes.

num_bins: BinCountImm = <xdsl.irdl.attributes._ParameterDef object>
class AcquisitionPathConnectionAttr(input_id, path)

Bases: AcquisitionPathConnectionAttr

Physical input connected to one Qblox acquisition path.

Parameters:
  • input_id (IntAttr | int) – Physical input selected by the acquisition path.

  • path (SignalPathAttr | SignalPath) – Acquisition path receiving the input.

classmethod get_irdl_definition()

Get the IRDL attribute definition.

input_id: IntAttr = <xdsl.irdl.attributes._ParameterDef object>
name: ClassVar[str] = 'q1_sequence.acquisition_path_connection'

The attribute name should be a static field in the attribute classes.

path: SignalPathAttr = <xdsl.irdl.attributes._ParameterDef object>
verify()

Check that the attribute parameters satisfy the expected invariants. Raise a VerifyException otherwise.

Return type:

None

class BinCountImm(value)

Bases: Q1Imm

Number of acquisition bins: [0, 7_000_000].

The hardware budget is per-module, not per-acquisition: 3 M bins total for QRM / QRM-RF and 7 M total for QRC. We allow the worst-case max here; cross-acquisition aggregation is checked elsewhere.

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

The attribute name should be a static field in the attribute classes.

class ConnectionAttr(direction, port_ids)

Bases: ConnectionAttr

One connection string accepted by the Qblox sequencer connection API.

A connection names one I/O port for real mode or an I and a Q port for complex mode, in every direction. Which combinations a module kind accepts is verified against the target description rather than here.

Parameters:
  • direction (DirectionKindAttr | DirectionKind) – Whether the connection carries output, input, or bidirectional data.

  • port_ids (ArrayAttr[IntAttr] | Iterable[IntAttr | int]) – Ordered I/O ports connected to the sequencer I/Q paths.

property connection: str

Return the connection string accepted by connect_sequencer.

direction: DirectionKindAttr = <xdsl.irdl.attributes._ParameterDef object>
classmethod get_irdl_definition()

Get the IRDL attribute definition.

property input_ids: tuple[int, ...]

Return the physical inputs this connection acquires from.

An ioX_Y connection acquires on every listed lane; see connection_input_ids().

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

The attribute name should be a static field in the attribute classes.

property output_ids: tuple[int, ...]

Return the physical outputs this connection drives.

An ioX_Y connection drives every listed lane; see connection_output_ids().

port_ids: ArrayAttr[IntAttr] = <xdsl.irdl.attributes._ParameterDef object>
verify()

Check that the attribute parameters satisfy the expected invariants. Raise a VerifyException otherwise.

Return type:

None

class DirectionKindAttr(data)

Bases: EnumAttribute[DirectionKind], SpacedOpaqueSyntaxAttribute

Direction prefix accepted by the Qblox sequencer connection API.

enum_type

alias of DirectionKind

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

The attribute name should be a static field in the attribute classes.

class OutputPathConnectionAttr(output_id, path=None)

Bases: OutputPathConnectionAttr

One physical output connected to a sequencer output path.

Parameters:
  • output_id (IntAttr | int) – Physical output configured by the outN field.

  • path (Union[SignalPathAttr, SignalPath, None]) – Qblox sequencer path carried by the connection.

classmethod get_irdl_definition()

Get the IRDL attribute definition.

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

The attribute name should be a static field in the attribute classes.

output_id: IntAttr = <xdsl.irdl.attributes._ParameterDef object>
path: SignalPathAttr | NoneAttr = <xdsl.irdl.attributes._ParameterDef object>
verify()

Check that the attribute parameters satisfy the expected invariants. Raise a VerifyException otherwise.

Return type:

None

class Q1SequenceTarget

Bases: Target

emit(ctx, module, output)

Emits a Q1 sequence module as JSON.

Parameters:
  • ctx (Context) – xDSL context for the emission target.

  • module (ModuleOp) – Module containing SequenceOps.

  • output (IO[str]) – Text stream receiving the JSON output.

Return type:

None

name: ClassVar[str] = 'q1_sequence'
class SequenceOp(channel_id, program, port_id=None, waveforms=None, weights=None, acquisitions=None, instrument_id=None, slot_idx=None, seq_idx=None, sequencer_config=None, module_config=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. instrument_id, slot_idx and seq_idx identify the physical allocation. sequencer_config owns the digital configuration and connections, while module_config owns the authoritative analogue configuration of the physical module.

Parameters:
  • channel_id (str | StringAttr) – Stable identifier for the emitted sequencer program.

  • program (Sequence[Operation] | Region) – Q1 instruction operations or a region containing one or more blocks.

  • port_id (Union[str, StringAttr, None]) – Canonical port identifier (e.g. "Q0/drive"). Defaults to channel_id for an unbound sequence.

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

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

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

  • instrument_id (Union[str, StringAttr, None]) – Physical Cluster instrument, absent until hardware binding.

  • slot_idx (Union[int, SlotIndexAttr, None]) – Physical Cluster slot, absent until hardware binding.

  • seq_idx (Union[int, SequencerIndexAttr, None]) – Physical sequencer index, absent until hardware binding.

  • sequencer_config (Optional[SequencerConfigAttr]) – Per-sequencer configuration and connections, absent until resolved.

  • module_config (Optional[ModuleConfigAttr]) – Analogue module configuration, absent until hardware binding.

acquisitions

Accessor for an operation property.

body

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

channel_id

Accessor for an operation attribute.

classmethod get_irdl_definition()

Get the IRDL operation definition.

instrument_id

Accessor for an optional operation property.

module_config

Accessor for an optional operation property.

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

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

port_id

Accessor for an operation attribute.

seq_idx

Accessor for an optional operation property.

sequencer_config

Accessor for an optional operation property.

slot_idx

Accessor for an optional operation property.

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_()

Verify structural and physical sequence invariants.

Structural verification requires non-empty sequence and port identifiers, complete allocation identity, terminated body blocks, and unique names and indices in each data table. Bound sequences additionally validate module location, module lanes, sequencer index and capability, connection routing, mixer configuration, and agreement between sequence allocation and module or sequencer configuration.

waveforms

Accessor for an operation property.

weights

Accessor for an operation property.

class SignalPathAttr(data)

Bases: EnumAttribute[SignalPath], SpacedOpaqueSyntaxAttribute

Sequencer I/Q signal path selected by a connection.

enum_type

alias of SignalPath

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

The attribute name should be a static field in the attribute classes.

class WaveformAttr(*parameters)

Bases: WaveformAttr

A waveform entry in a Qblox sequence’s waveforms dictionary.

Parameters:
  • waveform_name – Waveform name.

  • index – Index referenced by play operations. Range [0, 1023].

  • data – Float32 samples, each sample in [-1.0, 1.0] represents DAC range.

data: DenseIntOrFPElementsAttr[Float32Type] = <xdsl.irdl.attributes._ParameterDef object>
classmethod get_irdl_definition()

Get the IRDL attribute definition.

index: WaveformTableIndex = <xdsl.irdl.attributes._ParameterDef object>
name: ClassVar[str] = 'q1_sequence.waveform'

The attribute name should be a static field in the attribute classes.

verify()

Check that the attribute parameters satisfy the expected invariants. Raise a VerifyException otherwise.

Return type:

None

waveform_name: StringAttr = <xdsl.irdl.attributes._ParameterDef object>
class WaveformTableIndex(value)

Bases: Q1Imm

Index into a sequencer’s waveform table: [0, 1023].

A Q1 sequencer can hold up to 1024 waveform entries shared across both output paths; play.wave0 / play.wave1 reference them by index.

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

The attribute name should be a static field in the attribute classes.

class WeightAttr(*parameters)

Bases: WeightAttr

A weight entry in a Qblox sequence’s weights dictionary.

Each coefficient multiplies one demodulated ADC sample before summation. A sequencer accepts at most 32 weight arrays and 16 384 samples.

Parameters:
  • weight_name – Weight name.

  • index – Index referenced by acquire_weighted. Range [0, 31].

  • data – Float32 coefficients, each in [-1.0, 1.0].

data: DenseIntOrFPElementsAttr[Float32Type] = <xdsl.irdl.attributes._ParameterDef object>
classmethod get_irdl_definition()

Get the IRDL attribute definition.

index: WeightTableIndex = <xdsl.irdl.attributes._ParameterDef object>
name: ClassVar[str] = 'q1_sequence.weight'

The attribute name should be a static field in the attribute classes.

verify()

Check that the attribute parameters satisfy the expected invariants. Raise a VerifyException otherwise.

Return type:

None

weight_name: StringAttr = <xdsl.irdl.attributes._ParameterDef object>
class WeightTableIndex(value)

Bases: Q1Imm

Index into a sequencer’s weight table: [0, 31].

Up to 32 integration-weight arrays are stored per sequencer; the acquire_weighted instruction selects one via its 6-bit weight_idx{0,1} fields (encoded as UI6Imm), of which only the low 5 bits address an entry on current hardware.

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

The attribute name should be a static field in the attribute classes.

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.

Subpackages

Submodules