qat.model.builder module

Helpers for constructing lightweight physical hardware models for tests.

This module exposes PhysicalHardwareModelBuilder, a convenience class used in tests and examples to create small, uncalibrated physical hardware models with sensible defaults. It is not used by production code but is handy when unit tests need a model instance.

class PhysicalHardwareModelBuilder(physical_connectivity, logical_connectivity=None, logical_connectivity_quality=None, seed=None)

Bases: object

A builder class that builds a physical hardware model based on the given connectivity.

Parameters:
  • physical_connectivity (dict[int, FrozenSet[int]]) – The connectivities of the physical qubits on the QPU (undirected graph).

  • logical_connectivity (Optional[dict[int, FrozenSet[int]]]) – The connectivities (directed graph) of the qubits used for compilation, which can be a subgraph of physical_connectivity.

  • logical_connectivity_quality (Optional[FrozenDict[tuple[Annotated[int, AfterValidator], Annotated[int, AfterValidator]], Annotated[float, AfterValidator]]]) – Quality of the connections between the qubits.

property model: PhysicalHardwareModel
model_dump()