qat.backend.qblox.codegen module

class AbstractContext(alloc_mgr=None)

Bases: ABC

clear()
create_package(target)
delay(inst)
device_update(du_inst)
property duration
property durations
id()
is_empty()

Masks away yet-to-be-supported second-state, cancellation, and cross cancellation targets This is temporary and criteria will change with more features coming in

ledger(duration, pulse=None)
property phase
reset_phase()
shift_frequency(inst, target)
shift_phase(inst)
static synchronize(inst, contexts)

Favours static time padding whenever possible, or else uses SYNC. TODO - Default to SYNC when Qblox supports finer grained SYNC groups

wait_imm(duration)

Waits for duration nanoseconds expressed as an immediate.

duration must be positive

wait_reg(duration)

A mere wait RX in general has undefined runtime behaviour.

This is a useful helper to dynamically wait for a duration nanoseconds expressed as a register. iter_reg is a short-lived register only used as an interator. Customer is responsible for (de)allocation.

waveform(waveform, target)
class AllocationManager(_reg_pool=<factory>, _lbl_counters=<factory>, registers=<factory>, labels=<factory>)

Bases: object

label_gen(name)
labels: Dict[str, str]
reg_alloc(name)
Return type:

str

reg_borrow(name)

Short-lived register allocation

reg_free(register)
Return type:

None

registers: Dict[str, str]
class NewQbloxContext(alloc_mgr, scoping_result, rw_result, iter_bounds)

Bases: AbstractContext

static enter_repeat(inst, contexts)
static enter_sweep(inst, contexts)
static exit_repeat(inst, contexts)
static exit_sweep(inst, contexts)
measure_acquire(measure, acquire, target)
class NewQbloxEmitter

Bases: InvokerMixin

build_pass_pipeline(*args, **kwargs)
emit_packages(ir, res_mgr, met_mgr, ignore_empty=True)
Return type:

List[QbloxPackage]

class PreCodegenPass

Bases: AnalysisPass

run(ir, res_mgr, *args, **kwargs)

Precedes assembly codegen. Performs a naive register allocation through a manager object. Computes useful information in the form of attributes.

class PreCodegenResult(alloc_mgrs=<factory>)

Bases: object

alloc_mgrs: Dict[PulseChannel, AllocationManager]
class QbloxBackend(model)

Bases: BaseBackend, InvokerMixin

Parameters:

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

class QbloxCFGWalker(contexts)

Bases: DfsTraversal

enter(block)
exit(block)
class QbloxContext(repeat)

Bases: AbstractContext

measure_acquire(measure, acquire, post_procs, target)
class QbloxEmitter

Bases: InvokerMixin

build_pass_pipeline(*args, **kwargs)
emit_packages(ir, res_mgr, met_mgr, ignore_empty=True)
Return type:

Dict[int, List[QbloxPackage]]

class QbloxPackage(target=None, sequence=None, sequencer_config=<factory>, timeline=None)

Bases: object

sequence: Sequence = None
sequencer_config: SequencerConfig
target: PulseChannel = None
timeline: ndarray = None