qat.frontend.converters.purr module
- class HardwareModelMapper(legacy_model, model)
Bases:
objectHelper class to deal with mapping of PuRR to Pydantic hardware models.
It offers utilities to validate the physical properties of the hardware models to ensure compatibility, and to convert PuRR pulse channels into QAT IR pulse channels
- get_pulse_channel_id(pulse_channel)
Gets the id of the pulse channel to use in the IR, resolving it to the physical model if possible.
- property physical_channel_map: dict[str, str]
Creates a mapping of physical channel full ids from the legacy model to the pydantic model, to allow for validation of pulse channel properties.
- pulse_channel_mapping_exists(pulse_channel)
- validate_physical_properties()
Validates the physical properties of the hardware model in the IR against the model provided to ensure compatibility.
- class PurrConverter(model)
Bases:
objectA converter for PuRR InstructionBuilders.
The purpose of this converter is to allow us to accept the PuRR InstructionBuilder API as an input to the compiler, allowing backwards compatibility. It walks the list of instructions, compiling them to QAT IR.
It takes care of the following:
Validation of the physical properties of the hardware model in the IR against the model provided to ensure compatibility.
Conversion of PuRR pulse channels into QAT IR pulse channels, reconciling with those that are created already from the pydantic hardware model. This will also update any divergent logical properties, which might appear from device assigns.
Conversion of PuRR IR into Pydantic IR.
Warning
Repeat instructions with a passive reset time or repetition period are not fully supported, and these values will be ignored. Please set the passive reset time using the compiler config, instead.
- convert(builder)
Walks the list of instructions in the PuRR InstructionBuilder, converting them to QAT IR.
- Parameters:
builder¶ (
InstructionBuilder) – The quantum program as a legacy (PuRR) instruction builder.- Return type: