qBraid-SDK extension providing support for QIR conversions
Project description
qBraid-SDK extension providing support for QIR conversions.
Motivation
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?.
Getting started
Installation
qBraid-QIR requires Python 3.8 or greater, and can be installed with pip as follows:
pip install qbraid-qir
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 .
Check version
You can view the version of qbraid-qir you have installed within a Python shell as follows:
In [1]: import qbraid_qir
In [2]: qbraid_qir.__version__
Resources
Usage Example
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)
Add QIR node to qBraid conversion graph
from qbraid_qir.cirq import cirq_to_qir
from qbraid.transpiler import Conversion, ConversionGraph
graph = ConversionGraph()
conversion = Conversion("cirq", "qir", cirq_to_qir)
graph.add_conversion(conversion)
graph.plot()
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).
Contributing
- Interested in contributing code, or making a PR? See CONTRIBUTING.md
- For feature requests and bug reports: Submit an issue
- For discussions, and specific questions about the qBraid-SDK, qBraid-QIR, or other topics, join our discord community
- For questions that are more suited for a forum, post to
Quantum Computing Stack Exchange
with the
qbraid
tag. - By participating, you are expected to uphold our code of conduct.
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{Kushnir_qBraid-QIR_Python_package_2024,
author = {Kushnir, Samuel and Jain, Rohan and Parakh, Priyansh and Hill, Ryan James},
license = {GPL-3.0},
month = jan,
title = {{qBraid-QIR: Python package for generating QIR programs from Cirq.}},
url = {https://github.com/qBraid/qbraid-qir},
version = {0.1.0},
year = {2024}
}
Acknowledgements
This project was conceived in cooperation with the Quantum Open Source Foundation (QOSF).
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file qbraid-qir-0.1.1.tar.gz
.
File metadata
- Download URL: qbraid-qir-0.1.1.tar.gz
- Upload date:
- Size: 308.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 519890208120c2fa5560f19c169c05d29a8dcf50e836630fd80a30341e1ba33f |
|
MD5 | 10315d80ea1fe39de215eff341f9708e |
|
BLAKE2b-256 | 0f01c10fe0d8cc80027fcb7e62f577bd344d04ab9160b267f17cda38138ab9fb |
File details
Details for the file qbraid_qir-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: qbraid_qir-0.1.1-py3-none-any.whl
- Upload date:
- Size: 38.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd0b2af47d9062aad904c5a5a4011acc9375b9350c0978b1cdc2611e3bc5808b |
|
MD5 | e4570baebc21e3e68e739306f51e56f9 |
|
BLAKE2b-256 | 2ef2108052e637c0ce09beccb4298ae1387105a381896e7e3c9a70294fe6bca4 |