qat.model.hardware_model module
- class LogicalHardwareModel(**data)
Bases:
NoExtraFieldsModelModels a hardware with a given connectivity.
- Parameters:
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.
- calibration_id: str
- logical_connectivity: FrozenDict[QubitId, FrozenSet[QubitId]]
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'ser_json_inf_nan': 'constants', 'use_enum_values': False, 'validate_assignment': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- version: SemanticVersion
- version_compatibility()
- class PhysicalHardwareModel(*, version: ~pydantic_extra_types.semantic_version.SemanticVersion = Version(major=0, minor=0, patch=1, prerelease=None, build=None), logical_connectivity: ~qat.utils.pydantic.FrozenDict[Annotated[int, AfterValidator], FrozenSet[Annotated[int, AfterValidator]]] | None = None, calibration_id: str = <factory>, qubits: ~qat.utils.pydantic.FrozenDict[Annotated[int, AfterValidator], Qubit], physical_connectivity: ~qat.utils.pydantic.FrozenDict[Annotated[int, AfterValidator], FrozenSet[Annotated[int, AfterValidator]]], logical_connectivity_quality: ~qat.utils.pydantic.FrozenDict[Annotated[tuple[Annotated[int, AfterValidator], Annotated[int, AfterValidator]], BeforeValidator], Annotated[float, AfterValidator]], error_mitigation: ~qat.model.error_mitigation.ErrorMitigation = ErrorMitigation(readout_mitigation=None))
Bases:
LogicalHardwareModelClass for calibrating our QPU hardware.
- Parameters:
qubits¶ – The superconducting qubits on the chip.
physical_connectivity¶ – The graph of physical connections between the qubits, representing all available couplings (possibly sparse) and supporting bidirectional and unidirectional connections.
logical_connectivity¶ – The graph of logical connections supported by the compiler. Logical connections are the connections that 2Q gates are supported on.
logical_connectivity_quality¶ – Quality of the connections between the qubits.
error_mitigation¶ – Error mitigation strategy for this hardware model.
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.
- classmethod default_logical_connectivity(data)
- device_for_pulse_channel_id(id_)
- error_mitigation: ErrorMitigation
- index_of_qubit(qubit)
Returns the index of the given qubit in the hardware model.
- Return type:
int
- property is_calibrated: bool
- logical_connectivity: FrozenDict[QubitId, FrozenSet[QubitId]] | None
- logical_connectivity_quality: FrozenDict[QubitCoupling, CalibratableUnitInterval]
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'ser_json_inf_nan': 'constants', 'use_enum_values': False, 'validate_assignment': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- property number_of_qubits: int
- physical_channel_for_pulse_channel_id(id_)
- property physical_channel_map: dict
- physical_channel_with_id(id_)
- physical_connectivity: FrozenDict[QubitId, FrozenSet[QubitId]]
- pulse_channel_with_id(id_)
- property quantum_devices: list[Qubit, Resonator]
Returns all quantum (an)harmonic oscillator devices in this hardware model as a list.
- qubit_for_physical_channel_id(id_)
Returns the qubit associated with the given physical channel id.
- Return type:
Qubit|None
- qubit_for_resonator(resonator)
Returns the qubit associated with the given resonator.
- Return type:
Qubit|None
- qubit_quality(physical_qubit_index)
- qubits: FrozenDict[QubitId, Qubit]
- validate_connectivity_quality()
Validates that the logical connectivity quality is provided for all edges in the logical connectivity, and the graphs have the same edges.
- validate_error_mitigation()
Raises if the error mitigation has an error mitigation strategy for qubits that are not in the hardware model, and warns if qubits are missing.
Warnings are preferred over errors here for missing qubits, which take an assumed success rate of 0.0 as per the qubit_quality method. Additionally, poor performing qubits might not appear in the logical connectivity, and are thus not characterised.
- validate_logical_connectivity()
Validates that logical connectivity is a subgraph of physical connectivity.
Pulse channels are checked as part of physical channel connectivity, and thus do not need to be checked here.
- validate_physical_channel_naming()
Validates that physical channel indices are unique across all devices in the hardware model.
- validate_physical_connectivity()
Validates that physical connectivity graph matches the cross-resonance pulse channels used in couplings.
- PydLogicalHardwareModel
alias of
LogicalHardwareModel
- PydPhysicalHardwareModel
alias of
PhysicalHardwareModel