qat.backend.passes.validation module

class FrequencyValidation(model)

Bases: ValidationPass

This validation pass checks two things:

  1. Frequency shifts do not move the frequency of a pulse channel outside of its allowed range.

  2. Frequency shifts do not occur on pulse channels that have a fixed IF, or share a physical channel with a pulse channel that has a fixed IF.

Instantiate the pass with a hardware model.

Parameters:

model (QuantumHardwareModel) – The hardware model.

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

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

static validate_frequency_ranges(targets, freqshifts)

Validates that a pulse channel remains within its allowed frequency range.

Parameters:
  • targets (List[PulseChannel]) – List of pulse channels to validate.

  • freqshifts (List[FrequencyShift]) – List of frequency shift instructions.

validate_no_freqshifts_on_fixed_if(targets)

Validates that frequency shifts do not occur on pulse channels with fixed IFs.

Parameters:

targets (List[PulseChannel]) – List of pulse channels to validate.

class HardwareConfigValidity(hardware_model)

Bases: ValidationPass

Validates the CompilerConfig against the hardware model.

Instantiate the pass with a hardware model.

Parameters:

hardware_model (QuantumHardwareModel) – The hardware model.

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

compiler_config (CompilerConfig) – The config containing compilation settings provided as a keyword argument.

class NCOFrequencyVariability

Bases: ValidationPass

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

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

class NoAcquireWeightsValidation

Bases: ValidationPass

Some target machines do not support Acquire instructions that contain weights. This pass can be used to validate that this is the case.

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

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

class NoMultipleAcquiresValidation

Bases: ValidationPass

Some target machines do not support multiple Acquire instructions on the same channel. This validation pass should be used to verify this.

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

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

class PydHardwareConfigValidity(hardware_model)

Bases: ValidationPass

Validates the CompilerConfig against the hardware model.

Instantiate the pass with a hardware model.

Parameters:

hardware_model (PhysicalHardwareModel) – The hardware model.

run(ir, *args, compiler_config, **kwargs)
class PydReturnSanitisationValidation

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.

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.