qat.backend.base module

class AllocatingBackend(model, pipeline=None)

Bases: CustomBackend[Program], Generic[Program], ABC

A backend that’s responsible for allocating FPGA card and sequencers AOT.

Parameters:

model (QuantumHardwareModel) – The hardware model that holds calibrated information on the qubits on the QPU.

allocate(target)

For a given target, allocate an FPGA card and a sequencer.

Return type:

tuple[int, int]

class BaseBackend(model)

Bases: Generic[Program], ABC

Base class for a backend that takes an intermediate representation (IR) QatIR and lowers it to machine code that can be executed on a given target.

Parameters:

model (None | QuantumHardwareModel) – The hardware model that holds calibrated information on the qubits on the QPU.

abstract emit(ir, res_mgr=None, met_mgr=None, **kwargs)

Converts an IR QatIR to machine instructions of a given target architecture.

How targets convert the IR is at their discretion but they mostly follow macro-expansion techniques where target instructions are selected for each instruction in the IR.

Return type:

Executable

class CustomBackend(model, pipeline=None)

Bases: BaseBackend[Program], Generic[Program], ABC

Backends may need to run pre-codegen passes on the IR QatIR as emitted from the middle end. These passes are specified via a custom pipeline.

Parameters:

model (QuantumHardwareModel) – The hardware model that holds calibrated information on the qubits on the QPU.