QMProvider

class QMProvider(state_folder_path: str | None = None, quam_cls: Type[Quam] | None = None)[source][source]

Bases: object

Provider for Quantum Machines hardware using a local QuAM state.

QMProvider is hardware-agnostic: users supply their own QuamRoot subclass (via quam_cls) and their own QMBackend subclass (via backend_cls) to match their specific hardware. This avoids a hard dependency on any particular architecture (e.g. flux-tunable transmons) and lets any QuAM-compatible machine be used with the Qiskit stack.

If quam_cls is omitted the provider falls back to FluxTunableQuam from quam-builder for backward compatibility, but users are encouraged to provide their own class.

Example:

from qiskit_qm_provider import QMProvider
from my_lab.quam import MyCustomQuam
from my_lab.backend import MyBackend

provider = QMProvider(
    state_folder_path="/path/to/quam/state",
    quam_cls=MyCustomQuam,
)
backend = provider.get_backend(backend_cls=MyBackend)
get_machine() Quam[source][source]

Load and return the latest QuAM state.

get_backend(machine: Quam | None = None, backend_cls: Type[QMBackend] | None = None, **backend_options) QMBackend[source][source]

Create a QMBackend (or subclass) from a QuAM machine.

Users should pass backend_cls to select the backend implementation that matches their hardware. When omitted the base QMBackend is used, which provides the full circuit-to-QUA pipeline but no hardware-specific channel mapping or initialization macro.

Parameters:
  • machine – A pre-loaded QuamRoot instance. If None, the provider loads one via get_machine().

  • backend_cls – The QMBackend subclass to instantiate. Common choices include FluxTunableTransmonBackend (for flux-tunable transmon setups) or a user-defined subclass. Defaults to QMBackend.

  • **backend_options – Forwarded to the backend constructor. Typical keys: qmm, name, shots, compiler_options, simulate, memory, skip_reset, meas_level, meas_return.

Returns:

A QMBackend instance (or the requested subclass).