{"id":20779732,"url":"https://github.com/openqasm/qe-compiler","last_synced_at":"2025-04-09T09:11:22.760Z","repository":{"id":215123734,"uuid":"541706473","full_name":"openqasm/qe-compiler","owner":"openqasm","description":"An MLIR based compiler dynamic circuit compiler for real-time control systems supporting OpenQASM 3","archived":false,"fork":false,"pushed_at":"2024-11-06T22:21:42.000Z","size":1608,"stargazers_count":52,"open_issues_count":27,"forks_count":16,"subscribers_count":19,"default_branch":"main","last_synced_at":"2025-04-02T08:08:31.984Z","etag":null,"topics":["mlir","openqasm","quantum-computing"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openqasm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-26T17:31:34.000Z","updated_at":"2025-02-22T14:01:06.000Z","dependencies_parsed_at":"2024-05-28T20:28:10.799Z","dependency_job_id":"b3b5ee93-dba9-493c-bc41-df66c7b72eab","html_url":"https://github.com/openqasm/qe-compiler","commit_stats":{"total_commits":241,"total_committers":21,"mean_commits":"11.476190476190476","dds":0.7551867219917012,"last_synced_commit":"2be58329623bdb8c01401dff06e40ba5aa22cc1e"},"previous_names":["openqasm/qe-compiler"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openqasm%2Fqe-compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openqasm%2Fqe-compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openqasm%2Fqe-compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openqasm%2Fqe-compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openqasm","download_url":"https://codeload.github.com/openqasm/qe-compiler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248008630,"owners_count":21032556,"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":["mlir","openqasm","quantum-computing"],"created_at":"2024-11-17T13:29:25.334Z","updated_at":"2025-04-09T09:11:22.739Z","avatar_url":"https://github.com/openqasm.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# qe-compiler: An MLIR-based quantum compiler for quantum engines\n\nThe qe-compiler is an [MLIR](https://mlir.llvm.org/)-based compiler with support for OpenQASM 3. The compiler is designed to compile quantum programs to quantum hardware as part of the overall Quantum Engine execution workflow. The Quantum Engine is a system comprised of low-level software components enabling the execution of quantum programs in quantum hardware.\n\nThis repo contains the compiler front-end to convert OpenQASM 3 source files into a collection of four MLIR dialects called QUIR (QUantum Intermediate Representation), OQ3 (OpenQASM 3), Pulse (OpenPulse), and QCS (Quantum Computing System). This set of dialects allows OpenQASM programs to be converted into a form suitable to manipulate with LLVM. This repo also contains tools and compiler passes that are agnostic of details of any control system vendor. For instance, it contains localization passes to split source programs into the qubit or channel-specific groupings required by a target quantum control system.\n\nThis repo does not contain a complete compiler. Rather, it is a framework for building compilers. To produce a complete compiler, one needs to implement a qe-compiler **target**. This repo comes with a [\"mock\" target](https://github.com/Qiskit/qss-compiler/tree/main/targets/systems/mock) to assist developers in understanding how to develop such targets.\n\n## Contents\n- [qe-compiler: An MLIR-based quantum compiler for quantum engines](#qe-compiler-an-mlir-based-quantum-compiler-for-quantum-engines)\n  - [Contents](#contents)\n  - [Notice](#notice)\n  - [Building](#building)\n    - [Python library](#python-library)\n    - [Platforms](#platforms)\n      - [Windows](#windows)\n    - [Static Code Checks](#static-code-checks)\n  - [Example Use](#example-use)\n  - [Contribution Guidelines](#contribution-guidelines)\n    - [CI and Release Cycle](#ci-and-release-cycle)\n  - [License](#license)\n\n## Notice\n\nWe are in the process of [changing the name of this project](https://github.com/Qiskit/qss-compiler/issues/210) from `qss-compiler` to `qe-compiler`. At present, only the repository name and this README have been updated.\n\nThis open-source version of the qe-compiler is currently lacking documentation. We will add getting started guides and other resources in the near future.\n\n## Building\nWe use [Conan](https://docs.conan.io/en/1.59/index.html) to build the compiler and handle dependencies.\n\nTo build:\n\n1. `git clone git@github.com:Qiskit/qe-compiler.git \u0026\u0026 cd qe-compiler`\n2. Install Python dependencies: `pip install -r requirements-dev.txt`\n3. Export local Conan recipe dependencies to Conan: `./conan_deps.sh`\n4. `mkdir build \u0026\u0026 cd build`\n5. If installing Conan for the first time, create a new profile `conan profile new default --detect`\n6. Install Conan dependencies: `conan install .. --build=outdated -pr:h default -pr:b default`\n7. Invoke the build with Conan: `conan build ..`. This will build the compiler.\n8. To run tests: `conan build .. --test`\n\nAlternatively instead of steps 6/7, you can build directly with CMake (also from within the build folder):\n1. Configure - `cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=\"Release\" ..`\n2. Build - `ninja`\n3. Check tests - `ninja check-tests`\n\n### Python library\nThe `qss-compiler` Python library will be installed by default to the resolved environment Python when\ninstalling with conan. To disable add the option `conan build .. -o pythonlib=False`.\n\n### Platforms\n#### Windows\nBuilding and running the compiler is supported with [WSL](https://learn.microsoft.com/en-us/windows/wsl/install).\n\n### Static Code Checks\nThe easiest, fastest, and most automated way to integrate the formatting into your workflow\nis via [pre-commit](https://pre-commit.com). Note that this tool requires an internet connection\nto initially setup because the formatting tools needs to be downloaded. These should be installed\nand setup prior to any development work so that they are not forgotten\nabout.\n\nThe setup is straight forward:\n\n```bash\npip install pre-commit\npre-commit install\n```\n\nFor more details on usage see the [contribution guide](CONTRIBUTING.md#static-code-checks).\n\n## Example Use\n\nYou can inspect the options available when invoking the `qe-compiler` by passing the `-h` flag. There are **many** options. A basic invocation that will work without implementing a target will convert an OpenQASM source file, `example.qasm` to the MLIR dialect set described above with:\n`qss-compiler --emit=mlir example.qasm`\n\n## Contribution Guidelines\n\nIf you'd like to contribute to the `qe-compiler`, please take a look at our\n[contribution guidelines](CONTRIBUTING.md).\n\n### CI and Release Cycle\n\nPlease find this information in our [contribution guidelines](CONTRIBUTING.md#ci-and-release-cycle).\n\n## License\nThe qe-compiler is [licensed](LICENSE.txt) under the Apache License v2 with LLVM Exceptions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenqasm%2Fqe-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenqasm%2Fqe-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenqasm%2Fqe-compiler/lists"}