mqt.core.plugins.qiskit.backend

QDMI Qiskit Backend.

Provides a Qiskit BackendV2-compatible interface to QDMI devices via FoMaC.

Module Contents

class QDMIBackend(device: Device, provider: QDMIProvider | None = None)[source]

Bases: qiskit.providers.BackendV2

A Qiskit BackendV2 adapter for QDMI devices via FoMaC.

This backend provides program submission to QDMI devices. It automatically introspects device capabilities and constructs a Target object with supported operations.

Backends should be obtained through QDMIProvider rather than instantiated directly.

Parameters:
  • device – FoMaC device to wrap.

  • provider – The provider instance that created this backend.

Examples

Get a backend through the provider:

>>> from mqt.core.plugins.qiskit import QDMIProvider
>>> provider = QDMIProvider()
>>> backend = provider.get_backend("MQT Core DDSIM QDMI Device")
static is_convertible(device: Device) bool[source]

Returns whether a device can be represented in Qiskit’s Target model.

property target: Target

The Target describing the capabilities of the backend.

property provider: Any | None

The provider that created the backend.

property max_circuits: int | None

The maximum number of circuits that can be run in a single job.

property options: Options

The backend options.

run(run_input: QuantumCircuit | Sequence[QuantumCircuit], parameter_values: Sequence[ParametersType] | None = None, **options: Any) QDMIJob[source]

Execute one or more QuantumCircuit instances on the backend.

Parameters:
  • run_input – A single quantum circuit or a sequence of quantum circuits to execute.

  • parameter_values – Optional parameter values to bind to the circuits. If provided, must be a sequence with one entry per circuit. Each entry can be either a dictionary mapping parameters to values, or a sequence of values in the order of circuit.parameters.

  • **options – Execution options (e.g., shots).

Returns:

Job handle for the execution. For multiple circuits, the job aggregates results from all circuits.

Raises:

Examples

Run a single circuit with parameter values:

>>> from qiskit.circuit import Parameter, QuantumCircuit
>>> theta = Parameter("theta")
>>> qc = QuantumCircuit(1)
>>> qc.ry(theta, 0)
>>> qc.measure_all()
>>> job = backend.run(qc, parameter_values=[{theta: 1.5708}])

Run multiple circuits with different parameter values:

>>> qc1 = QuantumCircuit(1)
>>> qc1.ry(theta, 0)
>>> qc1.measure_all()
>>> qc2 = QuantumCircuit(1)
>>> qc2.ry(theta, 0)
>>> qc2.measure_all()
>>> job = backend.run([qc1, qc2], parameter_values=[{theta: 0.5}, {theta: 1.5}])