qat.runtime.executables module

class AcquireData(**data)

Bases: BaseModel

Contains acquisition information for a measurement / readout that is needed at runtime.

Parameters:
  • length (NonNegativeInt) – A readout is performed for some given time which translates to a number of discrete samples.

  • position (NonNegativeInt) – The sample which a readout starts.

  • mode (AcquireMode) – The acqusition mode used by the hardware to carry out the readout.

  • output_variable (str) – The name of the variable to save the result to.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

length: Annotated[int]
mode: AcquireMode
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

output_variable: str
position: Annotated[int]
class ChannelData(**data)

Bases: BaseModel

Base class for “channel data”. This can be used for exectuables which target devices that seperate instructions over multiple “channels”.

It is expected to contain any target-specific information, along with a property that retrieves all acquistion data for that channel.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

acquires: list[AcquireData] | AcquireData
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ChannelExecutable(**data)

Bases: Executable

A base Executable object used for compiled programs that target hardware with many “channels”, e.g., live hardware. Defines the acquire property to fetch acquisitions from the channel data.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

property acquires: list[AcquireData]

Retrieves all acquires from each channel.

channel_data: dict[str, ChannelData]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class Executable(**data)

Bases: BaseModel

Executables are instruction packages that will be sent to a target (either physical control hardware or a simulator).

This class serves as a base model that can be inherited to define a complete instruction package tailored to a particular target.

Parameters:
  • channel_data (dict[str, ChannelData]) – Stores the data required by the control hardware for each pulse channel.

  • shots (PositiveInt) – The number of times the program is executed.

  • compiled_shots (PositiveInt) – When the required number of shots exceeds the allowed amount by the target machine, shots can be batched into groups. This states how many shots to do in each batch.

  • post_processing (dict[str, List[PostProcessing]]) – Contains the post-processing information for each acquisition.

  • results_processing (dict[str, InlineResultsProcessing]) – Contains the information for how results should be formatted.

  • assigns (list[Assign]) – Assigns results to given variables.

  • returns (list[str]) – Which acqusitions/variables should be returned.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

abstract property acquires: list[AcquireData]

Retrieves all acquires for the program.

This abstract property should be specified for an executable that is coupled to a specific backend and target device. It is expected that this returns a list of all acquisitions for the program, which will be required by the Runtime.

assigns: list[Assign]
compiled_shots: Annotated[int]
classmethod deserialize(blob)

Instantiates a executable from a JSON blob.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

post_processing: dict[str, list[PostProcessing]]
results_processing: dict[str, InlineResultsProcessing]
returns: set[str]
serialize(indent=4)

Serializes the executable as a JSON blob.

Return type:

str

shots: Annotated[int]