Skip to main content

Implementation of a QDMI device for IQM Quantum Computers

Project description

IQM Logo

QDMI on IQM

Apache 2.0 License C++20 CMake

QDMI on IQM is IQM's official, production-ready implementation of the Quantum Device Management Interface (QDMI).

By providing this officially supported implementation, we empower HPC centers and middleware developers to embed IQM processors via a stable, vendor-agnostic standard. This avoids the need for fragile, bespoke adapter chains and allows users to keep their familiar tools while operators maintain manageable workflows.

The library seamlessly wraps backend orchestration—spanning persistent session control, calibration queries, and job semantics via the IQM Server API—to connect higher-level software and schedulers to both our cloud-hosted endpoints through IQM Resonance and our on-premise device deployments.

The underlying library is written in C++20, providing a reliable foundation for long-lived integration code. Pre-compiled binaries for major OS and architecture configurations are provided alongside an official Python wrapper for straightforward installation via uv and direct use in Python workflows.

Documentation

What is QDMI?

QDMI (Quantum Device Management Interface) is a vendor-neutral, standardized C API for interacting with quantum computing hardware. This library provides an implementation of the QDMI specification tailored to IQM quantum computers, allowing you to submit quantum circuits, query device properties, manage calibration, and retrieve results through a unified interface.

Why Use This Library?

  • Standardized Interface: Use the QDMI standard to interact with IQM hardware
  • Modern C++20: Leverage modern C++ features with a clean, type-safe implementation
  • Comprehensive Device Queries: Access qubit properties, gate fidelities, coherence times, and more
  • Multiple Program Formats: Submit circuits as QIR, IQM JSON; with additional support for calibration configurations

Quick Start

Prerequisites

  • C++ Compiler: Supporting C++20
  • CMake: Version 3.24 or higher
  • libcurl: For HTTP communication
  • Access: IQM quantum computer credentials (API key or tokens file)

Installation

# Install dependencies (Ubuntu/Debian)
$ sudo apt-get install cmake g++ libcurl4-openssl-dev

# Clone the repository
$ git clone https://github.com/iqm-finland/QDMI-on-IQM.git
$ cd QDMI-on-IQM

# Build the library
$ cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
$ cmake --build build --parallel

Example: Bell State Circuit

#include <iqm_qdmi/device.h>
#include <iostream>

int main() {
    IQM_QDMI_device_initialize();

    IQM_QDMI_Device_Session session;
    IQM_QDMI_device_session_alloc(&session);

    // Configure server and auth
    const char* url = "https://resonance.meetiqm.com";
    const char* token = "your-api-token";
    IQM_QDMI_device_session_set_parameter(session,
        QDMI_DEVICE_SESSION_PARAMETER_BASEURL, strlen(url) + 1, url);
    IQM_QDMI_device_session_set_parameter(session,
        QDMI_DEVICE_SESSION_PARAMETER_TOKEN, strlen(token) + 1, token);

    IQM_QDMI_device_session_init(session);

    // Submit Bell state circuit
    const char* circuit = R"({
        "name": "bell_state",
        "instructions": [
            {"name": "prx", "locus": ["QB1"], "args": {"angle_t": 0.5, "phase_t": 0.0}},
            {"name": "cz", "locus": ["QB1", "QB2"], "args": {}},
            {"name": "prx", "locus": ["QB2"], "args": {"angle_t": 0.5, "phase_t": 0.0}},
            {"name": "measure", "locus": ["QB1"], "args": {"key": "QB1"}},
            {"name": "measure", "locus": ["QB2"], "args": {"key": "QB2"}}
        ]
    })";

    IQM_QDMI_Device_Job job;
    IQM_QDMI_device_session_create_device_job(session, &job);

    QDMI_Program_Format format = QDMI_PROGRAM_FORMAT_IQMJSON;
    size_t shots = 100;
    IQM_QDMI_device_job_set_parameter(job, QDMI_DEVICE_JOB_PARAMETER_PROGRAMFORMAT, sizeof(format), &format);
    IQM_QDMI_device_job_set_parameter(job, QDMI_DEVICE_JOB_PARAMETER_PROGRAM, strlen(circuit) + 1, circuit);
    IQM_QDMI_device_job_set_parameter(job, QDMI_DEVICE_JOB_PARAMETER_SHOTSNUM, sizeof(shots), &shots);

    IQM_QDMI_device_job_submit(job);
    IQM_QDMI_device_job_wait(job, 0);

    QDMI_Job_Status status;
    IQM_QDMI_device_job_check(job, &status);
    if (status == QDMI_JOB_STATUS_DONE) {
        std::cout << "Job completed successfully!\n";
    }

    IQM_QDMI_device_session_free(session);
    IQM_QDMI_device_finalize();
    return 0;
}

For complete examples, see the Usage Guide.

How It Works

  1. Session Management: Initialize a session with an IQM server endpoint and authentication
  2. Device Discovery: Automatically fetches quantum devices and calibration data
  3. Circuit Submission: Submit quantum circuits in QIR or IQM JSON format
  4. Result Retrieval: Poll for job completion and retrieve measurement results
  5. Calibration Control: Optionally trigger calibrations and update to new calibration sets

The library interfaces with the IQM Server API to provide complete device management through the standardized QDMI interface.

Testing

# Build with tests
$ cmake -S . -B build -DBUILD_IQM_QDMI_TESTS=ON
$ cmake --build build
# Run all tests
$ ctest --test-dir build --output-on-failure

# Run only unit tests (no hardware required)
$ ctest --test-dir build/test/unit --output-on-failure

# Run integration tests (requires IQM access)
$ export IQM_BASE_URL="https://desired-iqm-server.com"
$ export RESONANCE_API_KEY="your-api-key"
$ ctest --test-dir build/test/integration --output-on-failure

Contributing

We welcome contributions! Whether you're fixing bugs, improving documentation, or proposing new features, your help is appreciated.

Please see our Contributing Guide for:

  • How to report bugs and request features
  • Development workflow and coding standards
  • Testing and documentation requirements
  • Pull request process

Getting Help

License

This project is licensed under the Apache License 2.0 with LLVM exceptions. See the LICENSE.md file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iqm_qdmi-1.0.1.tar.gz (147.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

iqm_qdmi-1.0.1-py310-none-win_arm64.whl (163.6 kB view details)

Uploaded Python 3.10Windows ARM64

iqm_qdmi-1.0.1-py310-none-win_amd64.whl (176.3 kB view details)

Uploaded Python 3.10Windows x86-64

iqm_qdmi-1.0.1-py310-none-musllinux_1_2_x86_64.whl (5.4 MB view details)

Uploaded Python 3.10musllinux: musl 1.2+ x86-64

iqm_qdmi-1.0.1-py310-none-musllinux_1_2_aarch64.whl (5.6 MB view details)

Uploaded Python 3.10musllinux: musl 1.2+ ARM64

iqm_qdmi-1.0.1-py310-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (4.4 MB view details)

Uploaded Python 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

iqm_qdmi-1.0.1-py310-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (4.3 MB view details)

Uploaded Python 3.10manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

iqm_qdmi-1.0.1-py310-none-macosx_11_0_x86_64.whl (174.6 kB view details)

Uploaded Python 3.10macOS 11.0+ x86-64

iqm_qdmi-1.0.1-py310-none-macosx_11_0_arm64.whl (165.9 kB view details)

Uploaded Python 3.10macOS 11.0+ ARM64

File details

Details for the file iqm_qdmi-1.0.1.tar.gz.

File metadata

  • Download URL: iqm_qdmi-1.0.1.tar.gz
  • Upload date:
  • Size: 147.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for iqm_qdmi-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e74dadc677b5e53aa661eb79435d27493fedf3afa9e9dd3199c6bb269fd33300
MD5 d26d857eb6c3816ab60238abb594d923
BLAKE2b-256 46e470d4a4de16175ea2efc83d54bce84e06e73194e4896fbb1837bfed3730b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for iqm_qdmi-1.0.1.tar.gz:

Publisher: CD.yml on iqm-finland/QDMI-on-IQM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file iqm_qdmi-1.0.1-py310-none-win_arm64.whl.

File metadata

  • Download URL: iqm_qdmi-1.0.1-py310-none-win_arm64.whl
  • Upload date:
  • Size: 163.6 kB
  • Tags: Python 3.10, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for iqm_qdmi-1.0.1-py310-none-win_arm64.whl
Algorithm Hash digest
SHA256 070bf60a3dd4a0dc801e805c02561d8ffcc923edf39818f553cb9970c9006ad7
MD5 2999b67b1c25b324c591f4c83123df2b
BLAKE2b-256 b423338a2b4ebd7fc061ce344d7d69b3c1ddbf4954d06a8ab7457cc5942e3ac8

See more details on using hashes here.

Provenance

The following attestation bundles were made for iqm_qdmi-1.0.1-py310-none-win_arm64.whl:

Publisher: CD.yml on iqm-finland/QDMI-on-IQM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file iqm_qdmi-1.0.1-py310-none-win_amd64.whl.

File metadata

  • Download URL: iqm_qdmi-1.0.1-py310-none-win_amd64.whl
  • Upload date:
  • Size: 176.3 kB
  • Tags: Python 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for iqm_qdmi-1.0.1-py310-none-win_amd64.whl
Algorithm Hash digest
SHA256 da2b36de773b51c3e342f96a66b5a9d375c29aa7169ee0470d4cf5eb9608220b
MD5 3e5c82a58539be0cd3529c59fe395a54
BLAKE2b-256 908d89c2ad41a6ae39b7e99341058cc98f6bc7e743ee7ea273e74fecaee808cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for iqm_qdmi-1.0.1-py310-none-win_amd64.whl:

Publisher: CD.yml on iqm-finland/QDMI-on-IQM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file iqm_qdmi-1.0.1-py310-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for iqm_qdmi-1.0.1-py310-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e7f280d622a0bd4d5e15b3cb7e4db02f60d2395b1830a3d4c1344de2c4f98ab1
MD5 074223c3787cce3e141864bc72aeaf5d
BLAKE2b-256 7076097f12f8d999daf880485fa2b9ba0deac721190e24e5d5e9399a67d96547

See more details on using hashes here.

Provenance

The following attestation bundles were made for iqm_qdmi-1.0.1-py310-none-musllinux_1_2_x86_64.whl:

Publisher: CD.yml on iqm-finland/QDMI-on-IQM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file iqm_qdmi-1.0.1-py310-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for iqm_qdmi-1.0.1-py310-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 c94cbb1ec0d48dc08e61f66f469f7964876422ebb29201d4aefe203fa2ba5852
MD5 c7f420d5fa397baf2f2d34cdeed8d06d
BLAKE2b-256 04f4ad19c44a178f31a3729918043f59cbb6bf76c480e792bf6bb24be41f0147

See more details on using hashes here.

Provenance

The following attestation bundles were made for iqm_qdmi-1.0.1-py310-none-musllinux_1_2_aarch64.whl:

Publisher: CD.yml on iqm-finland/QDMI-on-IQM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file iqm_qdmi-1.0.1-py310-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for iqm_qdmi-1.0.1-py310-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fcfb0d2ef623a2481a4c94c5c41300b98ab042cc34a76b4641720cb9a0577bb3
MD5 e7e8ca3a0d1a66ef8d4a34bb933a21bc
BLAKE2b-256 59518138c52bb17beec0398aae592fc848eca33eea898fc05ff92ce59770c3db

See more details on using hashes here.

Provenance

The following attestation bundles were made for iqm_qdmi-1.0.1-py310-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: CD.yml on iqm-finland/QDMI-on-IQM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file iqm_qdmi-1.0.1-py310-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for iqm_qdmi-1.0.1-py310-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9a697e8dedc0ee132c2f7fea2c5e27e5db4952e5fb80c5550c68c7cca0e3b7e7
MD5 ed5ac6d42480414f631ca7e82ca4844e
BLAKE2b-256 d6b23d7db2c2d6699cf8b04a845ffd9bc189ab1748e127c574ea8dd5f6e9a26e

See more details on using hashes here.

Provenance

The following attestation bundles were made for iqm_qdmi-1.0.1-py310-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl:

Publisher: CD.yml on iqm-finland/QDMI-on-IQM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file iqm_qdmi-1.0.1-py310-none-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for iqm_qdmi-1.0.1-py310-none-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 0078d6d4977fe73a53bd19469b1d4a58f7024018a965abf86da996915221ac1d
MD5 55af9d38b2f567563b67bd7ae5ce6075
BLAKE2b-256 5a46f724da54cb9215d57f4a7e93df53987233eb4c461cf5cf7e28172b76e970

See more details on using hashes here.

Provenance

The following attestation bundles were made for iqm_qdmi-1.0.1-py310-none-macosx_11_0_x86_64.whl:

Publisher: CD.yml on iqm-finland/QDMI-on-IQM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file iqm_qdmi-1.0.1-py310-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for iqm_qdmi-1.0.1-py310-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8ef59b0796326e1284b9af17960c81cf01c332951a2753c7f1d10cc3f6cfb48d
MD5 5a43ed0f7b06b8a3d624cc8400cfa1a8
BLAKE2b-256 f338e41c5104164c24284d38ac64c4ab1a327019724ffac351606243f83d613b

See more details on using hashes here.

Provenance

The following attestation bundles were made for iqm_qdmi-1.0.1-py310-none-macosx_11_0_arm64.whl:

Publisher: CD.yml on iqm-finland/QDMI-on-IQM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page