Skip to main content

QRMI: Quantum Resource Management Interface

[!IMPORTANT] New Deprecations(Since 0.13.0)

The IBM Direct Access API has been renamed to the IBM Quantum System API.

As part of this change, the resource names and the prefixes of environment variables used by QRMI have been updated accordingly.

Items Deprecated names New names
Resource type text direct-access ibm-quantum-system
Resource type(C) QRMI_RESOURCE_TYPE_IBM_DIRECT_ACCESS QRMI_RESOURCE_TYPE_IBM_QUANTUM_SYSTEM
Resource type(Python) ResourceType.IBMDirectAccess ResourceType.IBMQuantumSystem
Resource type(Rust) ResourceType::IBMDirectAccess ResourceType::IBMQuantumSystem
QuantumResource trait implementator(Rust) qrmi::ibm::IBMDirectAccess qrmi::ibm::IBMQuantumSystem
Environment variable prefixes QRMI_IBM_DA_ QRMI_IBM_QS_

A transition period will be in effect until July 2, 2026. During this period, both the legacy and the new resource names and environment variable prefixes are supported to ensure backward compatibility. After the transition period ends, support for the legacy names will be removed, and users are expected to migrate fully to the new naming scheme.

This is repository with Quantum Resource Management Interface (QRMI) implementation.

QRMI ⚛️ is a vendor agnostic library to control state, run tasks and monitor behavior of quantum computational resources (qubits, QPUs, entire quantum systems, etc.).

QRMI acts like a thin middleware layer that abstracts away complexities of controling quantum resources by exposing set of simple APIs to acquire/release hardware, run tasks and monitor state of quantum resources.

QRMI is written in Rust 🦀 with Python 🐍 and C ©️ APIs exposed for ease of integration to pretty much any computational envrionment.

📒 Contents


Examples

All full examples are available in examples folder.

C

This example demonstrates QRMI using the Quantum System API for IBM Quantum machines.

#include "qrmi.h"

int main(int argc, char *argv[]) {
    ...

    QrmiQuantumResource *qrmi = qrmi_resource_new(argv[1], QRMI_RESOURCE_TYPE_IBM_QUANTUM_SYSTEM);
    ...

    QrmiReturnCode rc = qrmi_resource_metadata(qrmi, &metadata);
    ...

    QrmiResourceMetadata *metadata = NULL;
    rc = qrmi_resource_acquire(qrmi, &acquisition_token);
    ...

    QrmiPayload payload;
    payload.tag = QRMI_PAYLOAD_QISKIT_PRIMITIVE;
    payload.QISKIT_PRIMITIVE.input = (char *)input;
    payload.QISKIT_PRIMITIVE.program_id = argv[3];
    ...

    char *job_id = NULL;
    rc = qrmi_resource_task_start(qrmi, &payload, &job_id);
    ...

    QrmiTaskStatus status;
    rc = qrmi_resource_task_status(qrmi, job_id, &status);
    ...

    qrmi_resource_task_stop(qrmi, job_id);
    qrmi_string_free(job_id);
    qrmi_resource_free(qrmi);

    return EXIT_SUCCESS;

error:
    qrmi_resource_free(qrmi);
    return EXIT_FAILURE;
}

Full example is available here.

See example of QRMI C working with IBM Qiskit Runtime Service or Pasqal Cloud.

All examples for QRMI C are available in this folder.

Python

This example demonstrates QRMI using the Quantum System API for IBM Quantum machines.

from qrmi import QuantumResource, ResourceType, Payload, TaskStatus

# create resource handler
qrmi = QuantumResource("ibm_rensselaer", ResourceType.IBMQuantumSystem)

# acquire resource
lock = qrmi.acquire()

# run task
payload = Payload.QiskitPrimitive(input=primitive_input, program_id=args.program_id)
job_id = qrmi.task_start(payload)

print(qrmi.task_result(job_id).value)

qrmi.task_stop(job_id)

# release resource
qrmi.release(lock)

Full example is available here.

Python QRMI can be used to implement Qiskit primitives (Sampler and Estimator). See example of Qiskit primitives here for IBM backends or for Pasqal machines.

See example of QRMI working with Pasqal Pulser.

Pasqal Cloud Examples

QRMI Pasqal Cloud supports both Qiskit, Pulser and CUDA-Q analog programs.

See the Pasqal Cloud examples in this repository:

Rust

This example demonstrates QRMI using the Quantum System API for IBM Quantum machines.

use qrmi::{ibm::IBMQuantumSystem, models::Payload, models::TaskStatus, QuantumResource};
...

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    ...
    let mut qrmi = IBMQuantumSystem::new(&args.backend);

    let lock = qrmi.acquire().await?;
    ...

    let target = qrmi.target().await;
    ...

    let payload = Payload::QiskitPrimitive {
        input: contents,
        program_id: args.program_id,
    };

    let job_id = qrmi.task_start(payload).await?;
    println!("Job ID: {}", job_id);
    let one_sec = time::Duration::from_millis(1000);
    loop {
        let status = qrmi.task_status(&job_id).await?;
        println!("{:?}", status);
        if matches!(status, TaskStatus::Completed) {
            println!("{}", qrmi.task_result(&job_id).await?.value);
            break;
        } else if matches!(status, TaskStatus::Failed | TaskStatus::Cancelled) {
            break;
        }
        thread::sleep(one_sec);
    }
    let _ = qrmi.task_stop(&job_id).await;

    let _ = qrmi.release(&lock).await;
    Ok(())
}

Full example is available here.

See example of QRMI Rust working with IBM Qiskit Runtime Service or Pasqal Cloud.

All examples for QRMI C are available in this folder.

QRMI usage in Slurm plugin for quantum resources

One of example of usage of QRMI in compute infrastrcture project is Slurm plugin for quantum resources. QRMI is used in Slurm plugin to control quantum resources during lifetime of Slurm job.

See implementation and documentation of Slurm plugin for quantum resources here.


Pre-commit detect-secrets

detect-secrets is an open-source, developer-friendly tool designed to scan codebases for mistakenly committed secrets—such as API keys, passwords, and private tokens—before they leak. To keep our credentials secure, we recommend that all developers integrate this into their workflow using the following instructions.

  • Prerequisites: Before you begin, ensure you have a Python virtual environment (venv) active. You will need to install pre-commit, which manages the hooks that run detect-secrets automatically.
pip install pre-commit
pre-commit install

Please find .pre-commit-config.yaml for the initial setup.
Following command was used to generate .secrets.baseline and to maximize the detection coverage.

detect-secrets scan --force-use-all-plugins > .secrets.baseline

Handling False Positives
If the pre-commit hook identifies a secret that you have verified is not sensitive (a false positive), please use the following command to audit and update the baseline file. Once updated, include the modified .secrets.baseline in your Pull Request to ensure the pre-commit passes in the future.

pip install detect-secrets
detect-secrets scan --baseline .secrets.baseline
detect-secrets audit .secrets.baseline

Manual Execution and Overrides
To manually trigger a scan of all files in the repository for a local sanity check, execute the following command:

pre-commit run --all-files

Bypassing the Hook (Not Recommended)
While not recommended, if you must force a commit without running the pre-commit checks (e.g., during an emergency fix), you may use the --no-verify flag:

git commit -m "Your message" --no-verify

How to Give Feedback

We encourage your feedback! You can share your thoughts with us by:


How to Cite This Work

If you use the “Quantum Spank plugin” or "QRMI" in your research or projects, please consider citing the associated overview paper Quantum resources in resource management systems. This helps support the continued development and visibility of the repository. The BibTeX citation handle can be found in the CITATION.bib file.

Note that the overview paper is a work in progress, and we expect multiple versions to be released as the project evolves.


Contribution Guidelines

For information on how to contribute to this project, please take a look at our contribution guidelines.


References and Acknowledgements

  1. Quantum spank plugins for Slurm https://github.com/qiskit-community/spank-plugins
  2. Slurm documentation https://slurm.schedmd.com/
  3. Qiskit https://www.ibm.com/quantum/qiskit
  4. IBM Quantum https://www.ibm.com/quantum
  5. Pasqal https://pasqal.com
  6. STFC The Hartree Centre, https://www.hartree.stfc.ac.uk. This work was supported by the Hartree National Centre for Digital Innovation (HNCDI) programme.
  7. Rensselaer Polytechnic Institute, Center for Computational Innovation, http://cci.rpi.edu/

Metadata

Release files for myqrmi 0.13.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for myqrmi 0.13.9
File Size Uploaded Provenance Actions
myqrmi-0.13.9.tar.gz 255.1 kB With provenance Details for myqrmi-0.13.9.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for myqrmi 0.13.9
File Interpreter ABI Platform Actions
myqrmi-0.13.9-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details for myqrmi-0.13.9-cp311-abi3-manylinux_2_28_x86_64.whl
myqrmi-0.13.9-cp311-abi3-manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.28+ ARM64 Details for myqrmi-0.13.9-cp311-abi3-manylinux_2_28_aarch64.whl

Total release size: 17.5 MB

Release files / myqrmi-0.13.9.tar.gz

Download URL myqrmi-0.13.9.tar.gz
Size 255.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b691665b477106303b45e55c07a47766be2014f5bbb3734918cb0287a17f9dfc
BLAKE2b-256 checksum
How to use checksums
99e974008786c17612cccaed75b42fb4ff95202fc2af94b4fe4a0e092cda5dfc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 14, 2026.

Transparency log

Release files / myqrmi-0.13.9-cp311-abi3-manylinux_2_28_x86_64.whl

Download URL myqrmi-0.13.9-cp311-abi3-manylinux_2_28_x86_64.whl
Size 8.7 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
4f7209bfc9328a683639cc13e57572050f947e25bd644e55a7d08ffa4c2fbf60
BLAKE2b-256 checksum
How to use checksums
08fbcc520066120cebf725be0a62bf3b558375fe9c5bd6d9bfc0265a90cce25f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 14, 2026.

Transparency log

Release files / myqrmi-0.13.9-cp311-abi3-manylinux_2_28_aarch64.whl

Download URL myqrmi-0.13.9-cp311-abi3-manylinux_2_28_aarch64.whl
Size 8.6 MB
Tags CPython 3.11 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
ace853a1f770f02b59396e6660e3d2bd5d072b0fcb9801a3ff8e31c164f0eb38
BLAKE2b-256 checksum
How to use checksums
6a4ace63cff449a7b1ce806f1572729d85feea11cf23ee6cab659517c1a1ba7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 14, 2026.

Transparency log

Security for myqrmi 0.13.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 3 files in this release have been uploaded with provenance metadata.

Select from 3 files

Attestation for myqrmi-0.13.9.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 14, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page