MQT Core’s QDMI Driver Implementation¶
Objective¶
A QDMI Driver manages the communication between QDMI devices, such as
MQT Core’s NA QDMI Device or
MQT Core’s DDSIM QDMI Device, and QDMI clients, see the
QDMI specification.
It is responsible for loading the device, forwarding requests from the client to
the device, and sending back the results. MQT Core’s QDMI Driver,
qdmi::Driver, comes with several preloaded devices when the
bundled devices are enabled. Other devices can be loaded dynamically at runtime
via qdmi::Driver::registerDevice and
qdmi::Driver::open. Built-in and external devices can also be
registered through
versioned QDMI device configuration.
Building the Bundled Devices¶
Standalone MQT Core builds include the DDSIM, superconducting, and neutral-atom
QDMI device libraries by default. When MQT Core is embedded in another CMake
project using FetchContent or add_subdirectory, these device
libraries are disabled by default so the consumer does not build implementations
it may not use. They can be selected independently before making MQT Core
available:
BUILD_MQT_CORE_QDMI_DDSIM_DEVICEBUILD_MQT_CORE_QDMI_NA_DEVICEBUILD_MQT_CORE_QDMI_SC_DEVICE
For example, an embedded simulator consumer can enable only the DDSIM device, while CUDA-Q can enable the DDSIM and superconducting devices used by its integration tests.
The QDMI driver and QDMI libraries are available independently. Device-free builds can register external device libraries through QDMI device configuration. Building MQT Core’s C++ tests requires all three bundled devices so that the complete device integration is tested.
Python Bindings¶
The QDMI interface is the low-level contract implemented by a QDMI device. The
MQT Core QDMI driver loads device libraries and implements the QDMI client
interface. The C++ QDMI library adds owning wrappers for QDMI devices, sites,
operations, and jobs. The Python module exposes these QDMI entities through
mqt.core.qdmi. Its mqt.core.qdmi.driver submodule provides
device discovery, registration, and opening.
Usage¶
The following example opens each registered device by its stable ID.
1from mqt.core.qdmi.driver import open_device, registered_device_ids
2
3for device_id in registered_device_ids():
4 device = open_device(device_id)
5 print(device.name())
MQT Core DDSIM QDMI Device