<img width="full" alt="qbraid-qir-header" src="https://github.com/qBraid/qbraid-qir/assets/46977852/39f921ae-c4bf-442a-b059-6b21abd2ae50">
<p align='center'>
<a href='https://github.com/qBraid/qbraid-qir/actions/workflows/main.yml'>
<img src='https://github.com/qBraid/qbraid-qir/actions/workflows/main.yml/badge.svg' alt='CI'>
</a>
<a href="https://codecov.io/gh/qBraid/qbraid-qir" >
<img src="https://codecov.io/gh/qBraid/qbraid-qir/graph/badge.svg?token=GUQ3EN8DGI"/>
</a>
<a href='https://docs.qbraid.com/projects/qir/en/latest/?badge=latest'>
<img src='https://readthedocs.com/projects/qbraid-qbraid-qir/badge/?version=latest&token=7656ee72b7a66dec6d78dda911ce808676dca55c3e86702d5e97191badfdf19c' alt='Documentation Status'/>
</a>
<a href="https://pypi.org/project/qbraid-qir/">
<img src="https://img.shields.io/pypi/v/qbraid-qir.svg?color=blue" alt="PyPI version"/>
</a>
<a href="https://pypi.org/project/qbraid-qir/">
<img src="https://img.shields.io/pypi/pyversions/qbraid-qir.svg?color=blue" alt="PyPI version"/>
</a>
<a href='https://www.gnu.org/licenses/gpl-3.0.html'>
<img src='https://img.shields.io/github/license/qBraid/qbraid.svg' alt='License'/>
</a>
<a href='https://discord.gg/TPBU2sa8Et'>
<img src='https://img.shields.io/discord/771898982564626445.svg?color=pink' alt='Discord'/>
</a>
</p>
qBraid-SDK extension providing support for QIR conversions.
[<img src="https://qbraid-static.s3.amazonaws.com/logos/Launch_on_qBraid_white.png" width="150">](https://account.qbraid.com?gitHubUrl=https://github.com/qBraid/qbraid-qir.git)
## Motivation
<img align="right" width="100" alt="qir" src="docs/_static/pkg-logos/qir.png">
This project aims to make [QIR](https://www.qir-alliance.org/) representations accessible via the qBraid-SDK [transpiler](#architecture-diagram), and by doing so, open the door to language-specific conversions from any and all high-level quantum languages [supported](https://docs.qbraid.com/en/latest/sdk/overview.html#supported-frontends) by `qbraid`. See QIR Alliance: [why do we need it?](https://www.qir-alliance.org/qir-book/concepts/why-do-we-need.html).
## Getting started
### Installation
qBraid-QIR requires Python 3.8 or greater, and can be installed with pip as follows:
```shell
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:
```shell
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:
```python
In [1]: import qbraid_qir
In [2]: qbraid_qir.__version__
```
### Resources
- [User Guide](https://docs.qbraid.com/projects/qir/)
- [API Reference](https://docs.qbraid.com/projects/qir/en/latest/api/qbraid_qir.html)
- [Example Notebooks](examples)
- [Test Containers](test-containers)
### Usage Example
```python
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
```python
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](https://docs.qbraid.com/en/latest/sdk/transpiler.html#architecture) with qbraid-qir integration (left) mapped to language specific conversion step in QIR abstraction [layers](https://www.qir-alliance.org/qir-book/concepts/why-do-we-need.html) (right).
<img width="full" alt="architecture" src="https://github.com/qBraid/qbraid-qir/assets/46977852/36644614-2715-4f08-8a8c-8a2e61aebf38">
## Contributing
- Interested in contributing code, or making a PR? See
[CONTRIBUTING.md](CONTRIBUTING.md)
- For feature requests and bug reports:
[Submit an issue](https://github.com/qBraid/qbraid-qir/issues)
- For discussions, and specific questions about the qBraid-SDK, qBraid-QIR, or
other topics, [join our discord community](https://discord.gg/TPBU2sa8Et)
- For questions that are more suited for a forum, post to
[Quantum Computing Stack Exchange](https://quantumcomputing.stackexchange.com/)
with the [`qbraid`](https://quantumcomputing.stackexchange.com/questions/tagged/qbraid) tag.
- By participating, you are expected to uphold our [code of conduct](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](CITATION.cff).
```tex
@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](https://qosf.org/)).
<a href="https://qosf.org/"><img src="docs/_static/pkg-logos/qosf.png" width="100px" style="vertical-align: middle;" /></a>
## License
[GNU General Public License v3.0](LICENSE)
Raw data
{
"_id": null,
"home_page": "https://docs.qbraid.com/projects/qir/en/latest/",
"name": "qbraid-qir",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "qbraid,quantum,qir,llvm,cirq",
"author": "qBraid Development Team",
"author_email": "contact@qbraid.com",
"download_url": "https://files.pythonhosted.org/packages/0f/01/c10fe0d8cc80027fcb7e62f577bd344d04ab9160b267f17cda38138ab9fb/qbraid-qir-0.1.1.tar.gz",
"platform": null,
"description": "<img width=\"full\" alt=\"qbraid-qir-header\" src=\"https://github.com/qBraid/qbraid-qir/assets/46977852/39f921ae-c4bf-442a-b059-6b21abd2ae50\">\n\n<p align='center'>\n <a href='https://github.com/qBraid/qbraid-qir/actions/workflows/main.yml'>\n <img src='https://github.com/qBraid/qbraid-qir/actions/workflows/main.yml/badge.svg' alt='CI'>\n </a>\n <a href=\"https://codecov.io/gh/qBraid/qbraid-qir\" >\n <img src=\"https://codecov.io/gh/qBraid/qbraid-qir/graph/badge.svg?token=GUQ3EN8DGI\"/>\n </a>\n <a href='https://docs.qbraid.com/projects/qir/en/latest/?badge=latest'>\n <img src='https://readthedocs.com/projects/qbraid-qbraid-qir/badge/?version=latest&token=7656ee72b7a66dec6d78dda911ce808676dca55c3e86702d5e97191badfdf19c' alt='Documentation Status'/>\n </a>\n <a href=\"https://pypi.org/project/qbraid-qir/\">\n <img src=\"https://img.shields.io/pypi/v/qbraid-qir.svg?color=blue\" alt=\"PyPI version\"/>\n </a>\n <a href=\"https://pypi.org/project/qbraid-qir/\">\n <img src=\"https://img.shields.io/pypi/pyversions/qbraid-qir.svg?color=blue\" alt=\"PyPI version\"/>\n </a>\n <a href='https://www.gnu.org/licenses/gpl-3.0.html'>\n <img src='https://img.shields.io/github/license/qBraid/qbraid.svg' alt='License'/>\n </a>\n <a href='https://discord.gg/TPBU2sa8Et'>\n <img src='https://img.shields.io/discord/771898982564626445.svg?color=pink' alt='Discord'/>\n </a>\n</p>\n\nqBraid-SDK extension providing support for QIR conversions.\n\n[<img src=\"https://qbraid-static.s3.amazonaws.com/logos/Launch_on_qBraid_white.png\" width=\"150\">](https://account.qbraid.com?gitHubUrl=https://github.com/qBraid/qbraid-qir.git)\n\n## Motivation\n\n<img align=\"right\" width=\"100\" alt=\"qir\" src=\"docs/_static/pkg-logos/qir.png\">\n\nThis project aims to make [QIR](https://www.qir-alliance.org/) representations accessible via the qBraid-SDK [transpiler](#architecture-diagram), and by doing so, open the door to language-specific conversions from any and all high-level quantum languages [supported](https://docs.qbraid.com/en/latest/sdk/overview.html#supported-frontends) by `qbraid`. See QIR Alliance: [why do we need it?](https://www.qir-alliance.org/qir-book/concepts/why-do-we-need.html).\n\n## Getting started\n\n### Installation\n\nqBraid-QIR requires Python 3.8 or greater, and can be installed with pip as follows:\n\n```shell\npip install qbraid-qir\n```\n\nYou can also install from source by cloning this repository and running a pip install command\nin the root directory of the repository:\n\n```shell\ngit clone https://github.com/qBraid/qbraid-qir.git\ncd qbraid-qir\npip install .\n```\n\n### Check version\n\nYou can view the version of qbraid-qir you have installed within a Python shell as follows:\n\n```python\nIn [1]: import qbraid_qir\n\nIn [2]: qbraid_qir.__version__\n```\n\n### Resources\n\n- [User Guide](https://docs.qbraid.com/projects/qir/)\n- [API Reference](https://docs.qbraid.com/projects/qir/en/latest/api/qbraid_qir.html)\n- [Example Notebooks](examples)\n- [Test Containers](test-containers)\n\n### Usage Example\n\n```python\nimport cirq\nfrom qbraid_qir import cirq_to_qir\n\nq0, q1 = cirq.LineQubit.range(2)\n\ncircuit = cirq.Circuit(\n cirq.H(q0),\n cirq.CNOT(q0, q1),\n cirq.measure(q0, q1)\n)\n\nmodule = cirq_to_qir(circuit, name=\"my-circuit\")\n\nir = str(module)\n```\n\n### Add QIR node to qBraid conversion graph\n\n```python\nfrom qbraid_qir.cirq import cirq_to_qir\nfrom qbraid.transpiler import Conversion, ConversionGraph\n\ngraph = ConversionGraph()\n\nconversion = Conversion(\"cirq\", \"qir\", cirq_to_qir)\n\ngraph.add_conversion(conversion)\n\ngraph.plot()\n```\n\n## Architecture diagram\n\nqBraid-SDK transpiler hub-and-spokes [architecture](https://docs.qbraid.com/en/latest/sdk/transpiler.html#architecture) with qbraid-qir integration (left) mapped to language specific conversion step in QIR abstraction [layers](https://www.qir-alliance.org/qir-book/concepts/why-do-we-need.html) (right).\n\n<img width=\"full\" alt=\"architecture\" src=\"https://github.com/qBraid/qbraid-qir/assets/46977852/36644614-2715-4f08-8a8c-8a2e61aebf38\">\n\n## Contributing\n\n- Interested in contributing code, or making a PR? See\n [CONTRIBUTING.md](CONTRIBUTING.md)\n- For feature requests and bug reports:\n [Submit an issue](https://github.com/qBraid/qbraid-qir/issues)\n- For discussions, and specific questions about the qBraid-SDK, qBraid-QIR, or\n other topics, [join our discord community](https://discord.gg/TPBU2sa8Et)\n- For questions that are more suited for a forum, post to\n [Quantum Computing Stack Exchange](https://quantumcomputing.stackexchange.com/)\n with the [`qbraid`](https://quantumcomputing.stackexchange.com/questions/tagged/qbraid) tag.\n- By participating, you are expected to uphold our [code of conduct](CODE_OF_CONDUCT).\n\n## Citation\n\nIf you use qBraid-QIR in your research, we kindly request that you cite it appropriately.\nThe BibTeX entry below is aligned with the latest stable release. For the most up-to-date\ncitation details, please refer to [CITATION.cff](CITATION.cff).\n\n```tex\n@software{Kushnir_qBraid-QIR_Python_package_2024,\nauthor = {Kushnir, Samuel and Jain, Rohan and Parakh, Priyansh and Hill, Ryan James},\nlicense = {GPL-3.0},\nmonth = jan,\ntitle = {{qBraid-QIR: Python package for generating QIR programs from Cirq.}},\nurl = {https://github.com/qBraid/qbraid-qir},\nversion = {0.1.0},\nyear = {2024}\n}\n```\n\n## Acknowledgements\n\nThis project was conceived in cooperation with the Quantum Open Source Foundation ([QOSF](https://qosf.org/)).\n\n<a href=\"https://qosf.org/\"><img src=\"docs/_static/pkg-logos/qosf.png\" width=\"100px\" style=\"vertical-align: middle;\" /></a>\n\n## License\n\n[GNU General Public License v3.0](LICENSE)\n",
"bugtrack_url": null,
"license": "GPL v3.0",
"summary": "qBraid-SDK extension providing support for QIR conversions",
"version": "0.1.1",
"project_urls": {
"Bug Tracker": "https://github.com/qBraid/qbraid-qir/issues",
"Discord": "https://discord.gg/TPBU2sa8Et",
"Documentation": "https://docs.qbraid.com/projects/qir/en/latest/",
"Homepage": "https://docs.qbraid.com/projects/qir/en/latest/",
"Source Code": "https://github.com/qBraid/qbraid-qir"
},
"split_keywords": [
"qbraid",
"quantum",
"qir",
"llvm",
"cirq"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2ef2108052e637c0ce09beccb4298ae1387105a381896e7e3c9a70294fe6bca4",
"md5": "e4570baebc21e3e68e739306f51e56f9",
"sha256": "cd0b2af47d9062aad904c5a5a4011acc9375b9350c0978b1cdc2611e3bc5808b"
},
"downloads": -1,
"filename": "qbraid_qir-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e4570baebc21e3e68e739306f51e56f9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 38789,
"upload_time": "2024-03-04T20:44:33",
"upload_time_iso_8601": "2024-03-04T20:44:33.384903Z",
"url": "https://files.pythonhosted.org/packages/2e/f2/108052e637c0ce09beccb4298ae1387105a381896e7e3c9a70294fe6bca4/qbraid_qir-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0f01c10fe0d8cc80027fcb7e62f577bd344d04ab9160b267f17cda38138ab9fb",
"md5": "10315d80ea1fe39de215eff341f9708e",
"sha256": "519890208120c2fa5560f19c169c05d29a8dcf50e836630fd80a30341e1ba33f"
},
"downloads": -1,
"filename": "qbraid-qir-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "10315d80ea1fe39de215eff341f9708e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 308042,
"upload_time": "2024-03-04T20:44:35",
"upload_time_iso_8601": "2024-03-04T20:44:35.043193Z",
"url": "https://files.pythonhosted.org/packages/0f/01/c10fe0d8cc80027fcb7e62f577bd344d04ab9160b267f17cda38138ab9fb/qbraid-qir-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-04 20:44:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "qBraid",
"github_project": "qbraid-qir",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "qbraid-qir"
}