qat.core.pipeline module

class HardwareLoaders(hardware_loaders={})

Bases: object

clear_cache()
classmethod from_descriptions(hardware_loader_descriptions)
load(loader_name, default=None, allow_cache=True)

Loads a hardware model, using the internal cache unless allow_cache=False.

class Pipeline(**data)

Bases: BaseModel

Pipeline that compiles high-level language specific, but target-agnostic, input (QASM, QIR, …) to target-specific instructions that are executed on our hardware. :param _sphinx_paramlinks_qat.core.pipeline.Pipeline.frontend: Compiles a high-level language-specific, but target-agnostic,

input QatInput to a target-agnostic intermediate representation (IR) QatIR.

Parameters:
  • middleend – Takes an intermediate representation (IR) QatIR and alters it based on optimisation and/or validation passes within this pipeline.

  • backend – Converts an intermediate representation (IR) to code for a given target machine.

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.

backend: BaseBackend
classmethod consistent_model(model, info)

Validates that the hardware model supplied to the Pipeline matches the hardware model embedded in other fields.

classmethod from_description(desc)
frontend: BaseFrontend
middleend: BaseMiddleend
model: QuantumHardwareModel
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'frozen': True}

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

name: str
runtime: BaseRuntime
class PipelineSet(pipelines=[])

Bases: object

add(pipeline, default=False)

Adds a pipeline for subsequent use for compilation and execution

Parameters:
  • pipeline (Pipeline) – A pipeline instance to add, indexed by pipeline.name

  • default (bool, optional) – Set the added pipeline as the default, defaults to False

property default: str

Returns the name of the current default pipeline

classmethod from_descriptions(pipeline_descriptions, available_hardware)
get(pipeline)

Gets a stored pipeline by name (str) or passes through a pipeline instance

Parameters:

pipeline (Pipeline | str) – A pipeline instance or the string name of a stored pipeline

list()

Returns a list of available pipeline names

Return type:

list[str]

remove(pipeline)

Remove a pipeline

Parameters:

pipeline (Pipeline | str) – The name of a pipeline or a pipeline instance to remove

set_default(pipeline)