qat.middleend.passes.validation module

class InstructionValidation(engine, *args, **kwargs)

Bases: ValidationPass

Validates instructions against the hardware.

Extracted from qat.purr.compiler.execution.QuantumExecutionEngine.validate.

Parameters:

engine (QuantumExecutionEngine) – The engine contains information about the hardware, such as instruction limits.

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

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

class PydNoMidCircuitMeasurementValidation(model, *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.

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

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

class ReadoutValidation(hardware, *args, **kwargs)

Bases: ValidationPass

Validates that there are no mid-circuit measurements, and that the post-processing instructions do not have an invalid sequence.

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

Parameters:

hardware (QuantumHardwareModel) – The hardware model is needed to check for mid-circuit measurments.

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

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