qat.middleend.passes.validation module

class DynamicFrequencyValidation(model, target_data)

Bases: ValidationPass

Validates the setting or shifting frequencies does not move the intermediate frequency of a pulse channel outside the allowed limits.

Instantiate the pass with a hardware model.

Parameters:
run(ir, *args, **kwargs)
Parameters:

ir (InstructionBuilder) – The list of instructions stored in an InstructionBuilder.

class FrequencySetupValidation(model, target_data)

Bases: ValidationPass

Validates the baseband frequencies and intermediate frequencies of pulse channels against the target data.

Instantiate the pass with a hardware model.

Parameters:
run(ir, res_mgr, *args, **kwargs)
Parameters:
  • ir (InstructionBuilder) – The list of instructions stored in an InstructionBuilder.

  • res_mgr (ResultManager) – The result manager containing the results of the analysis.

class HardwareConfigValidity(hardware_model, max_shots=None)

Bases: ValidationPass

Validates the CompilerConfig against the hardware model.

Instantiate the pass with a hardware model.

Parameters:
  • hardware_model (PhysicalHardwareModel) – The hardware model.

  • max_shots (Optional[int]) – The maximum number of shots allowed for a single task. If None, uses the default from the QatConfig.

run(ir, *args, compiler_config, **kwargs)
class NoMidCircuitMeasurementValidation(model, no_mid_circuit_measurement=None, *args, **kwargs)

Bases: ValidationPass

Validates that there are no mid-circuit measurements by checking that no qubit has an acquire instruction that is later followed by a pulse instruction.

Parameters:
  • model (PhysicalHardwareModel) – The hardware model.

  • no_mid_circuit_measurement (Optional[bool]) – Whether mid-circuit measurements are allowed. If None, uses the default from the QatConfig.

run(ir, *args, **kwargs)
Parameters:

ir (InstructionBuilder) – The intermediate representation (IR) InstructionBuilder.

PydDynamicFrequencyValidation

alias of DynamicFrequencyValidation

PydFrequencySetupValidation

alias of FrequencySetupValidation

PydHardwareConfigValidity

alias of HardwareConfigValidity

PydNoMidCircuitMeasurementValidation

alias of NoMidCircuitMeasurementValidation

PydReadoutValidation

alias of ReadoutValidation

PydRepeatSanitisationValidation

alias of RepeatSanitisationValidation

PydReturnSanitisationValidation

alias of ReturnSanitisationValidation

class ReadoutValidation

Bases: ValidationPass

Validates that the post-processing instructions do not have an invalid sequence.

Extracted from qat.purr.backends.live.LiveDeviceEngine.validate().

run(ir, *args, **kwargs)
Parameters:

ir (InstructionBuilder) – The list of instructions stored in an InstructionBuilder.

class RepeatSanitisationValidation

Bases: ValidationPass

Checks if the builder has a Repeat instruction and warns if none exists.

run(ir, *args, **kwargs)
Parameters:

ir (InstructionBuilder) – The list of instructions stored in an InstructionBuilder.

class ReturnSanitisationValidation

Bases: ValidationPass

Validates that the IR has a Return instruction.

run(ir, *args, **kwargs)
Parameters:

ir (InstructionBuilder) – The list of instructions stored in an InstructionBuilder.