{"id":19630556,"url":"https://github.com/crazy4pi314/universe-qir-demo","last_synced_at":"2025-06-26T21:34:30.087Z","repository":{"id":77526062,"uuid":"545155324","full_name":"crazy4pi314/universe-qir-demo","owner":"crazy4pi314","description":"Demo showing how to build an example toolchain for quantum technology, show at GitHub Universe in 2022","archived":false,"fork":false,"pushed_at":"2022-11-10T16:32:54.000Z","size":17943,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-28T06:36:18.031Z","etag":null,"topics":["jupyter-notebook","python","quantum-computing","quantum-programming-language","rust"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crazy4pi314.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-10-03T22:01:50.000Z","updated_at":"2023-02-21T18:03:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"bd357dd2-833d-4f3f-a3f4-ec5772a97fac","html_url":"https://github.com/crazy4pi314/universe-qir-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/crazy4pi314/universe-qir-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazy4pi314%2Funiverse-qir-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazy4pi314%2Funiverse-qir-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazy4pi314%2Funiverse-qir-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazy4pi314%2Funiverse-qir-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crazy4pi314","download_url":"https://codeload.github.com/crazy4pi314/universe-qir-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazy4pi314%2Funiverse-qir-demo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260026098,"owners_count":22947765,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jupyter-notebook","python","quantum-computing","quantum-programming-language","rust"],"created_at":"2024-11-11T12:04:24.028Z","updated_at":"2025-06-15T18:05:17.503Z","avatar_url":"https://github.com/crazy4pi314.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Universe CMT014 | [Open source quantum development with Codespaces](https://githubuniverse.com/events/detail/virtual-schedule/00191b20-fdaa-4930-9)\n\n[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true\u0026ref=main\u0026repo=545155324)\n\n![GitHub](https://img.shields.io/github/license/crazy4pi314/universe-qir-demo) ![Discord](https://img.shields.io/discord/764231928676089909)\n\u003eSee the [schedule](https://githubuniverse.com/events/detail/virtual-schedule/00191b20-fdaa-4930-9), [demo](https://github.com/crazy4pi314/universe-qir-demo) and [recording](https://githubuniverse.com/events/detail/virtual-schedule/00191b20-fdaa-4930-9) (with [free registration](https://register.githubuniverse.com/) for Universe).\n\nBuilding a new open source community can be challenging, especially when it involves cutting edge technology like quantum computers. The **QIR Alliance** is developing open source specifications and tooling to help connect the quantum hardware into our traditional computation stack **built on top of LLVM**. Enriching popular classical developer tools from Python to C++ with access to quantum accelerators, the QIR Alliance enables everyone to contribute to the development of quantum computing, including middleware integrators, hardware providers, domain experts, students, and educators. Join us, and see how the QIR Alliance uses **Codespaces** to make it easy for all to use and contribute to the open source quantum ecosystem.\n\n## Try the demo! 💖\n\nThis repo contains an end-to-end demo of a quantum development stack that connects quantum programs written in Python to compiler and optimization tools and finally to a simulator (Rust) or hardware to run the quantum program.\nThe demo can run in your browser with [Codespaces](https://github.com/features/codespaces), or if you prefer, you can run it locally by cloning the repo and starting the included [Dev Container](https://containers.dev/).\nThe code is in the `demo.ipynb` [Jupyter notebook](https://jupyter.org/), which runs both the Python and command line tools needed for the demo.\nMany of the showcased open source tools are maintained by the [QIR Alliance](https://www.qir-alliance.org/), a Linux Foundation project that is developing both a specification for describing quantum programs and the tools needed to interoperate with the spec.\n\nThe quantum computing stack can be thought of like this figure below:\n![Quantum Development stack](stack.png)\nAll of these layers are connected by *QIR*, a low-level intermediate representation like LLVM that is designed to be easy to translate quantum programs between languages and hardware providers.\nYou can read the [specification for QIR](https://github.com/qir-alliance/qir-spec) on the qir-spec repo, which is still in active development.\n\nTo write the quantum program, we use the [QuTiP](https://qutip.org/) Python package, which is one of the most popular quantum OSS tools for writing and simulating quantum systems.\nThe sample quantum program provided demonstrates moving information from one place in the device to another, very similar to the C Move operation.\n\nNow we need to get to the compiler and optimization layer.\nTo do this we can use a Rust tool with Python bindings called [PyQIR](https://github.com/qir-alliance/pyqir) to convert the QuTiP program into a QIR program.\nPyQIR is a QIR Alliance project, and can be used as a stand-alone [Rust crate](https://github.com/qir-alliance/pyqir/tree/main/qirlib) that interfaces QIR and LLVM APIs so you can write quantum Rust programs out of the box.\n\nIn the compiler layer we use the QIR Alliance tool [qat](https://github.com/qir-alliance/qat) that allows us to run LLVM optimization passes on the QIR program.\nThis is really cool to see because it means that we can use the same tools that we use for classical code (LLVM passes) to optimize quantum code right out of the box.\nQat also supports optimizations specific to quantum code, and the ability to target QIR program to different simulator and hardware capabilities.\nThis is important because the quantum hardware and simulators all have very different architectures, and it's critical to be able to verify that the code will run on the expected target.\n\nFinally, we need to run the quantum program.\nThis demo has two execution options: a Rust simulator ([qir-runner](https://github.com/microsoft/qir-runner)) and an [Azure Quantum](https://azure.microsoft.com/en-us/products/quantum/#overview) hardware provider, [Rigetti](https://www.rigetti.com/).\n\n\u003e The video recording of the demo uses a simulator target from Rigetti for queue times, but you can also run on Rigetti's hardware by [changing the `target` variable](https://pypi.org/project/azure-quantum/) in the `azure.quantum.Job.from_input_data` function in the demo notebook.\n\nIf you have any questions or feedback, please feel free to [open an issue](https://github.com/crazy4pi314/universe-qir-demo/issues), ping me on [Mastodon](https://mathstodon.xyz/@crazy4pi314) or  Discord (crazy4pi314 (she/her)#1592) or [join a QIR community call](https://discord.gg/unitary-fund-764231928676089909) and chat with the users and maintainers of QIR tools.\n\n## Cool QIR Projects to explore\n\n- [GitHub Codespaces](https://github.com/features/codespaces)\n- [Jupyter Notebooks](https://jupyter.org/)\n- [QIR Spec](https://github.com/qir-alliance/qir-spec) and the [QIR Alliance](https://www.qir-alliance.org/)\n- [qutip/qutip](https://qutip.org/)\n- [qir-alliance/pyqir](https://github.com/qir-alliance/pyqir)\n- [qir-alliance/qat](https://github.com/qir-alliance/qat)\n- [microsoft/qir-runner](https://github.com/microsoft/qir-runner)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazy4pi314%2Funiverse-qir-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrazy4pi314%2Funiverse-qir-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazy4pi314%2Funiverse-qir-demo/lists"}