Skip to main content
QAT

QAT (Quantum Assembly Toolkit/Toolchain) is a low-level quantum compiler and runtime which facilitates executing quantum IRs such as QASM, OpenPulse and QIR against QPU drivers. It facilitates the execution of largely-optimised code, converted into abstract pulse-level and hardware-level instructions, which are then transformed and delivered to an appropriate driver.

For the official QAT documentation, please see QAT.


Installation

QAT can be installed from PyPI via: pip install qat-compiler


Building from Source

We use poetry for dependency management and run on Python 3.10+. Once both of these are installed run this in the root folder to install all the dependencies that you need: poetry install


Notebooks

We use jupytext https://jupytext.readthedocs.io/en/latest/ to store notebooks in both ‘percent’ format .py scripts (in notebooks/scripts) and .ipynb jupyter notebooks (in notebooks/ipynb).

For developers, the notebooks should be synced automatically by pre-commit (which you need to install, see above) and verified automatically in the GitHub pipeline. They will also be synced automatically on save in jupyterlab. Unfortunately VS code does not sync them automatically on save. They can be manually synced with poetry run jupytext-sync.

Notebooks within the notebooks/ipynb folder will be tested as part of our CI to ensure they’re functional and up-to-date. To run them locally, please use poetry run pytest notebooks/ipynb --nbmake.

Roadmap

We’re currently working on a some significant refactors, we’ll be sharing more on this and our future plans soon.


Contributing

To take the first steps towards contributing to QAT, visit our contribution documents, which provides details about our process. We also encourage new contributors to familiarise themselves with the code of conduct and to adhere to these expectations.


Where to get help

For support, please reach out in the Discussions tab of this repository or file an issue.


Licence

This code in this repository is licensed under the BSD 3-Clause Licence. Please see LICENSE for more information.


Feedback

Please let us know your feedback and any suggestions by reaching out in Discussions. Additionally, to report any concerns or code of conduct violations please use this form.


Benchmarking

The performance of QAT can be measured using our pre-defined benchmarks: poetry run pytest --benchmark-only. To compare to main, checkout the main branch and run poetry run pytest benchmarks/run.py --benchmark-only --benchmark-save="<benchmark-name>". Then checkout back to the branch you are working and run poetry run pytest benchmarks/run.py --benchmark-only --benchmark-save="<benchmark-name>" --benchmark-compare --benchmark-compare-fail=min:50%. If the test fails, it might indicate a performance regression: use the comparison table that is outputted to verify. The performance of pull requests to main will be automatically tested. See the pytest-benchmark documentation for more information on how to use it.


Documentation

Our documentation at QAT is automatically built and deployed as part of our CI pipeline. If making changes to the documentation, you can build it locally by running poetry run build-docs, and navigating to docs/build/.


FAQ

Why is this in Python?

Mixture of reasons. Primary one is that v1.0 was an early prototype and since the majority of the quantum community know Python it was the fastest way to build a system which the most people could contribute to building. The API’s would always stick around anyway, but as time goes on the majority of its internals has been, is being, or will be moved to Rust/C++.

Where do I get started?

Our tests are a good place to start as they will show you the various ways to run QAT. Running and then stepping through how it functions is the best way to learn.

We have what’s known as an echo model and engine which is used to test QATs functionality when not attached to a QPU. You’ll see these used almost exclusively in the tests, but you can also use this model to see how QAT functions on larger and more novel architectures.

High-level architectural documents are incoming and will help explain its various concepts at a glance, but right now aren’t complete.

What OS’s does QAT run on?

Windows and Linux are its primary development environments. Most of its code is OS-agnostic but we can’t guarantee it won’t have bugs on untried ones. Dependencies are usually where you’ll have problems, not the core QAT code itself.

If you need to make changes to get your OS running feel free to PR them to get them included.

I don’t see anything related to OQC’s hardware here!

Certain parts of how we run our QPU have to stay propriety and for our initial release we did not have time to properly unpick this from things we can happily release. We want to release as much as possible and as you’re reading this are likely busy doing just that.

Do you have your own simulator?

We have a real-time chip simulator that is used to help test potential changes and their ramifications to hardware. It focuses on accuracy and testing small-scale changes so should not be considered a general simulator. 3/4 qubit simulations is its maximum without runtime being prohibitive.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qat_compiler-3.5.0.tar.gz (638.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qat_compiler-3.5.0-py3-none-any.whl (843.3 kB view details)

Uploaded Python 3

File details

Details for the file qat_compiler-3.5.0.tar.gz.

File metadata

  • Download URL: qat_compiler-3.5.0.tar.gz
  • Upload date:
  • Size: 638.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for qat_compiler-3.5.0.tar.gz
Algorithm Hash digest
SHA256 b195f6369929845f0ae469c2c272dbb2ed6787b3bca1a95ff731190dacd3e66b
MD5 d45d1d797bc92bce962d3bf6358c3183
BLAKE2b-256 6fe3b828f22f6e509292f211d84f0197931537de2ea6fc65a588b7ae5c9b3764

See more details on using hashes here.

Provenance

The following attestation bundles were made for qat_compiler-3.5.0.tar.gz:

Publisher: package-publish.yml on oqc-tech/qat-verification

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qat_compiler-3.5.0-py3-none-any.whl.

File metadata

  • Download URL: qat_compiler-3.5.0-py3-none-any.whl
  • Upload date:
  • Size: 843.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for qat_compiler-3.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9fe00fb2b830c8df98030192e1d13c561140aa21876206ac7524ff500591275d
MD5 317365bb4ca8bd6f11997829e6490491
BLAKE2b-256 e21400cb6df79148ebab8a1810cf3fe2d7c996ed866b81896bbc5f4eff2ee204

See more details on using hashes here.

Provenance

The following attestation bundles were made for qat_compiler-3.5.0-py3-none-any.whl:

Publisher: package-publish.yml on oqc-tech/qat-verification

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page