Skip to content

laboneq.openqasm3

Experimental

The current implementation of OpenQASM support is considered experimental. Its interface may change in future releases of LabOne Q.

laboneq.openqasm3.gate_store

GateStore()

gate_map: Dict[str, str] = {} instance-attribute

gates: Dict[Tuple[str, Tuple[str, ...]], Callable[..., Section]] = {} instance-attribute

ports = {} instance-attribute

waveforms: Dict[str, Callable] = {} instance-attribute

lookup_gate(name, qubits, args=(), kwargs=None)

lookup_waveform(name)

map_gate(qasm_name, labone_q_name)

Define mapping from qasm gate name to LabOne Q gate name.

register_gate(name, qubit_name, pulse, signal, phase=None, id=None)

Register a pulse as a single-qubit gate.

register_gate_section(name, qubit_names, section_factory)

Register a LabOne Q section factory as a gate.

register_port(qasm_port, signal_line)

register_waveform(name, pulse)

laboneq.openqasm3.openqasm3_importer

exp_from_qasm(program, qubits, gate_store, inputs=None, externs=None, count=1, averaging_mode=AveragingMode.CYCLIC, acquisition_type=AcquisitionType.INTEGRATION, reset_oscillator_phase=False)

Create an experiment from an OpenQASM program.


program:
    OpenQASM program
qubits:
    Map from OpenQASM qubit names to LabOne Q DSL Qubit objects
gate_store:
    Map from OpenQASM gate names to LabOne Q DSL Gate objects
inputs:
    Inputs to the OpenQASM program.
externs:
    Extern functions for the OpenQASM program.
count:
    The number of acquire iterations.
averaging_mode:
    The mode of how to average the acquired data.
acquisition_type:
    The type of acquisition to perform.
reset_oscillator_phase:
    When true, reset all oscillators at the start of every
    acquistion loop iteration.