qat.backend.passes.validation module
- class FrequencyValidation(model)
Bases:
ValidationPass
This validation pass checks two things:
Frequency shifts do not move the frequency of a pulse channel outside of its allowed range.
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 anInstructionBuilder
.
- 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.
- class NCOFrequencyVariability
Bases:
ValidationPass
- run(ir, *args, **kwargs)
- Parameters:
ir¶ (
InstructionBuilder
) – The list of instructions stored in anInstructionBuilder
.
- 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 anInstructionBuilder
.
- 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 anInstructionBuilder
.
- 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 anInstructionBuilder
.
- 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 anInstructionBuilder
.
- 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 anInstructionBuilder
.