Skip to main content
qbraid-qir-header

CI GitHub Pages PyPI Downloads PyPI version PyPI version License Discord

qBraid-SDK extension providing support for QIR conversions.

Motivation

qir

This project aims to make QIR representations accessible via the qBraid-SDK transpiler, and by doing so, open the door to language-specific conversions from any and all high-level quantum languages supported by qbraid. See QIR Alliance: why do we need it?.

Installation

qBraid-QIR requires Python 3.10 or greater, and can be installed with pip as follows:

pip install qbraid-qir

Optional dependencies

qBraid-QIR offers integrations that require extra (optional) dependencies, which can be installed as follows:

For OpenQASM 3 to QIR conversions, install the qasm3 extra:

pip install 'qbraid-qir[qasm3]'

For Cirq to QIR conversions, install the cirq extra:

pip install 'qbraid-qir[cirq]'

For Qiskit to QIR conversions, install the qiskit extra:

pip install 'qbraid-qir[qiskit]'

For QIR to SQUIN conversions, install the squin extra:

pip install 'qbraid-qir[squin]'

Install from source

You can also install from source by cloning this repository and running a pip install command in the root directory of the repository:

git clone https://github.com/qBraid/qbraid-qir.git
cd qbraid-qir
pip install .

To include optional dependencies when installing from source, use the same "extras_require" format, e.g.

pip install '.[qasm3,cirq,squin]'

Check version

You can view the version of qbraid-qir you have installed within a Python shell as follows:

import qbraid_qir

qbraid_qir.__version__

Resources

Usage examples

OpenQASM 3 conversions

from qbraid_qir import qasm3_to_qir

program = """
OPENQASM 3;
include "stdgates.inc";

qubit[2] q;
bit[2] c;

h q[0];
cx q[0], q[1];

measure q[0] -> c[0];
measure q[1] -> c[1];
"""

module = qasm3_to_qir(program, name="my-program")

ir = str(module)

Cirq conversions

import cirq
from qbraid_qir import cirq_to_qir

q0, q1 = cirq.LineQubit.range(2)

circuit = cirq.Circuit(
  cirq.H(q0),
  cirq.CNOT(q0, q1),
  cirq.measure(q0, q1)
)

module = cirq_to_qir(circuit, name="my-circuit")

ir = str(module)

Qiskit conversions

from qiskit import QuantumCircuit
from qbraid_qir import qiskit_to_qir

circuit = QuantumCircuit(2, 2)
circuit.h(0)
circuit.cx(0, 1)
circuit.measure([0, 1], [0, 1])

module = qiskit_to_qir(circuit, name="bell")

ir = str(module)

SQUIN conversions

from pyqir import BasicQisBuilder, SimpleModule
from qbraid_qir.squin import load

module = SimpleModule("bell", num_qubits=2, num_results=2)
qis = BasicQisBuilder(module.builder)

qis.h(module.qubits[0])
qis.cx(module.qubits[0], module.qubits[1])

squin_kernel = load(module.ir())

squin_kernel.print()

Architecture diagram

qBraid-SDK transpiler hub-and-spokes architecture with qbraid-qir integration (left) mapped to language specific conversion step in QIR abstraction layers (right).

architecture

Contributing

Citation

If you use qBraid-QIR in your research, we kindly request that you cite it appropriately. The BibTeX entry below is aligned with the latest stable release. For the most up-to-date citation details, please refer to CITATION.cff.

@software{Gupta_qBraid-QIR_Python_package_2026,
  author = {Gupta, Harshit and Hill, Ryan James},
  license = {Apache-2.0},
  month = feb,
  title = {{qBraid-QIR: Python package for QIR conversions, integrations, and utilities.}},
  url = {https://github.com/qBraid/qbraid-qir},
  version = {0.5.1},
  year = {2026}
}

Acknowledgements

This project was conceived in cooperation with the Quantum Open Source Foundation (QOSF).

License

Apache-2.0 License

Metadata

Release files for qbraid-qir 0.6.1

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

Source distribution (sdist)

Source distribution for qbraid-qir 0.6.1
File Size Uploaded
qbraid_qir-0.6.1.tar.gz 205.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for qbraid-qir 0.6.1
File Interpreter ABI Platform
qbraid_qir-0.6.1-py3-none-any.whl Python 3 none any Details

Total release size: 264.7 kB

Release files / qbraid_qir-0.6.1.tar.gz

Download URL qbraid_qir-0.6.1.tar.gz
Size 205.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e8f0496fe09606a69aebacda4b89829db3ca7a354b45af6b5366e450e0c9c21d
BLAKE2b-256 checksum
How to use checksums
ea33d78e8c61124200a08024bd39e85f1660623edcab583b5d6127e3c77fad90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 27, 2026.

Transparency log

Release files / qbraid_qir-0.6.1-py3-none-any.whl

Download URL qbraid_qir-0.6.1-py3-none-any.whl
Size 59.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8866ad3277fddd2061c4e409acd2c31929717c87c58f4a3b182cb5f6d4b4b972
BLAKE2b-256 checksum
How to use checksums
7a29186442e687d1cce097bf5fa3d730c3c17824063ca1f5a68ed22a6cb46533
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 27, 2026.

Transparency log
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