A JIT compiler for hybrid quantum programs in PennyLane
Project description
Catalyst is an experimental package that enables just-in-time (JIT) compilation of hybrid quantum-classical programs.
Catalyst is currently under heavy development — if you have suggestions on the API or use-cases you'd like to be covered, please open an GitHub issue or reach out. We'd love to hear about how you're using the library, collaborate on development, or integrate additional devices and frontends.
Key Features
-
Compile the entire quantum-classical workflow, including any optimization loops.
-
Use Catalyst alongside PennyLane directly from Python. Simply decorate quantum code and hybrid functions with
@qjit
, leading to significant performance improvements over standard Python execution. -
Access advanced control flow that supports both quantum and classical instructions.
-
Infrastructure for both quantum and classical compilation, allowing you to compile quantum circuits that contain control flow.
-
Built to be end-to-end differentiable.
-
Support for PennyLane-Lightning high performance simulators, and Amazon Braket devices. Additional hardware support, including QPUs, to come.
Overview
Catalyst currently consists of the following components:
-
The core Catalyst compiler is built using MLIR, with the addition of a quantum dialect used to represent quantum instructions. This allows for a high-level intermediate representation of the classical and quantum components of the program, resulting in advantages during optimization. Once optimized, the compiler lowers the representation down to LLVM + QIR, and a machine binary is produced.
-
The runtime is a C++ runtime with multiple-device support based on QIR that enables the execution of Catalyst-compiled quantum programs. A complete list of all backend devices along with the quantum instruction set supported by these runtime implementations can be found by visiting the runtime documentation.
In addition, we also provide a Python frontend for PennyLane and JAX:
-
A Python library that provides a
@qjit
decorator to just-in-time compile PennyLane hybrid quantum-classical programs. In addition, the frontend package provides Python functions for defining Catalyst-compatible control flow structures, gradient, and mid-circuit measurement.
Installation
Catalyst is officially supported on Linux (aarch64/arm64, x86_64) and macOS (aarch64/arm64, x86_64) platforms,
and pre-built binaries are being distributed via the Python Package Index (PyPI) for Python versions 3.9 and
higher. To install it, simply run the following pip
command:
pip install pennylane-catalyst
Pre-built packages for Windows are not yet available, and comptability with Windows is untested and cannot be guaranteed. If you are using one of these platforms, please try out our Docker and Dev Container images described in the documentation or click this button:
If you wish to contribute to Catalyst or develop against our runtime or compiler, instructions for building from source are also available.
Trying Catalyst with PennyLane
To get started using the Catalyst JIT compiler from Python, check out our quick start guide, as well as our various examples and tutorials in our documentation.
For an introduction to quantum computing and quantum machine learning, you can also visit the PennyLane website for tutorials, videos, and demonstrations.
Roadmap
-
Frontend: As we continue to build out Catalyst, the PennyLane frontend will likely be upstreamed into PennyLane proper, providing native JIT functionality built-in to PennyLane. The Catalyst compiler and runtime will remain part of the Catalyst project. If you are interested in working on additional frontends for Catalyst, please get in touch.
-
Compiler: We will continue to build out the compiler stack, and add quantum compilation routines. This includes an API for providing or writing Catalyst-compatible compilation routines. In addition, we will be improving the autodifferentiation support, and adding support for classical autodiff, additional quantum gradients, and quantum-aware optimization methods.
-
Runtime: We will be adding support for more devices, including quantum hardware devices. In addition, we will be building out support for hetereogeneous execution. If you are interested in working on connecting a quantum device with Catalyst, please get in touch.
To get the details right, we need your help — please send us your use cases by starting a conversation, or trying Catalyst out.
Contributing to Catalyst
We welcome contributions — simply fork the Catalyst repository, and then make a pull request containing your contribution.
We also encourage bug reports, suggestions for new features and enhancements.
Support
- Source Code: https://github.com/PennyLaneAI/catalyst
- Issue Tracker: https://github.com/PennyLaneAI/catalyst/issues
If you are having issues, please let us know by posting the issue on our GitHub issue tracker.
We also have a PennyLane discussion forum—come join the community and chat with the PennyLane team.
Note that we are committed to providing a friendly, safe, and welcoming environment for all. Please read and respect the Code of Conduct.
Authors
Catalyst is the work of many contributors.
If you are doing research using Catalyst, please cite our paper:
@article{
Ittah2024,
doi = {10.21105/joss.06720},
url = {https://doi.org/10.21105/joss.06720},
year = {2024},
publisher = {The Open Journal},
volume = {9},
number = {99},
pages = {6720},
author = {David Ittah and Ali Asadi and Erick Ochoa Lopez and Sergei Mironov and Samuel Banning and Romain Moyard and Mai Jacob Peng and Josh Izaac},
title = {Catalyst: a Python JIT compiler for auto-differentiable hybrid quantum programs},
journal = {Journal of Open Source Software}
}
License
Catalyst is free and open source, released under the Apache License, Version 2.0.
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 Distributions
Built Distributions
File details
Details for the file PennyLane_Catalyst-0.8.1-cp312-cp312-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: PennyLane_Catalyst-0.8.1-cp312-cp312-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 65.9 MB
- Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e8344d6a2ffb30d7c3fafbe839dcd1fa6a822de44a5928dda1a871a81a19976 |
|
MD5 | 8eac5a606deca1947b5727dd4c028284 |
|
BLAKE2b-256 | 61213b2e50a3cb07185ad4a4668e394a31d90d4e41a631e93369a22b12a7fafc |
File details
Details for the file PennyLane_Catalyst-0.8.1-cp312-cp312-manylinux_2_28_aarch64.whl
.
File metadata
- Download URL: PennyLane_Catalyst-0.8.1-cp312-cp312-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 65.0 MB
- Tags: CPython 3.12, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f60773ac0320d0645e895bc6554d0d49a8db0e6e64e9f2d4c01659778ef859d4 |
|
MD5 | bfa8fb2698564cb81c9aa8928370ba6f |
|
BLAKE2b-256 | 2efe2cb8d663697b18d482dec175794dec955dc3995f4f9410e1395c6f41c8cb |
File details
Details for the file PennyLane_Catalyst-0.8.1-cp312-cp312-macosx_13_0_arm64.whl
.
File metadata
- Download URL: PennyLane_Catalyst-0.8.1-cp312-cp312-macosx_13_0_arm64.whl
- Upload date:
- Size: 54.4 MB
- Tags: CPython 3.12, macOS 13.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce52ab39a2f40fc398c447181047ebb74d8c3c3f057534670278c8e9867f8c19 |
|
MD5 | 999aeefcd77a75a3b2efd49fe0d7dd04 |
|
BLAKE2b-256 | 08fbbebdc8c0e7e0e6820e6a9ef07c6ed57947ec7a5fbee343aba77ed57589ec |
File details
Details for the file PennyLane_Catalyst-0.8.1-cp312-cp312-macosx_12_0_x86_64.whl
.
File metadata
- Download URL: PennyLane_Catalyst-0.8.1-cp312-cp312-macosx_12_0_x86_64.whl
- Upload date:
- Size: 61.6 MB
- Tags: CPython 3.12, macOS 12.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a8f66a58e0af5d9db130bb2976165da3743245767657c7bc240fcc598c390bd |
|
MD5 | cf355ee244a8842873271c87c3e0c126 |
|
BLAKE2b-256 | 833fb7844ba5e2c703ba80d036805e5d1057fc79c57eb5bc6c5c4e83c32df8e8 |
File details
Details for the file PennyLane_Catalyst-0.8.1-cp311-cp311-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: PennyLane_Catalyst-0.8.1-cp311-cp311-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 65.9 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9907a1c0bb49aff8e166427383da22d005ab46069e556af2aee011b741f5721d |
|
MD5 | a00b0023e9ba42c27f365d4b23af59b7 |
|
BLAKE2b-256 | 5148f6beec8f61f1878a25c119996631173d5a2dfa2114b344798f2126c34046 |
File details
Details for the file PennyLane_Catalyst-0.8.1-cp311-cp311-manylinux_2_28_aarch64.whl
.
File metadata
- Download URL: PennyLane_Catalyst-0.8.1-cp311-cp311-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 65.0 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a4105a3e4776034cffb9a301d7196fc43d6b732406397f0fb56a82ad7049601 |
|
MD5 | ac58193709a3f5610bd0f426f1255a30 |
|
BLAKE2b-256 | 9d5dd202e3997b0d1ff4fe6f2ce2b13930533243d56660b95ec738b457f9805c |
File details
Details for the file PennyLane_Catalyst-0.8.1-cp311-cp311-macosx_13_0_arm64.whl
.
File metadata
- Download URL: PennyLane_Catalyst-0.8.1-cp311-cp311-macosx_13_0_arm64.whl
- Upload date:
- Size: 54.4 MB
- Tags: CPython 3.11, macOS 13.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb12202d952c99c93bae676ae34e0972a042723b24083e61cd4449e307420e4e |
|
MD5 | 7902bfdfbf37df62a30c17aabfc310f3 |
|
BLAKE2b-256 | 67937ca924294beb98ab75f3ea1366c4a88c4c37c59436e096b3e1e6e759600f |
File details
Details for the file PennyLane_Catalyst-0.8.1-cp311-cp311-macosx_12_0_x86_64.whl
.
File metadata
- Download URL: PennyLane_Catalyst-0.8.1-cp311-cp311-macosx_12_0_x86_64.whl
- Upload date:
- Size: 61.6 MB
- Tags: CPython 3.11, macOS 12.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1ba10b5e06cd71ccc73966adc724f51e2bdb2592aed0ab324e85ab705492171 |
|
MD5 | d36c3d104861e6c34a682ce6c2486a46 |
|
BLAKE2b-256 | 98a9e23e9c1b5d26bfe05a5d8c62c418f23ea64a5e1be210a1debada6d745fcd |
File details
Details for the file PennyLane_Catalyst-0.8.1-cp310-cp310-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: PennyLane_Catalyst-0.8.1-cp310-cp310-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 65.9 MB
- Tags: CPython 3.10, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5228d186f8aed0aba2c19619ed5ed0a16c999b7ab03cdf349bf873786274f57e |
|
MD5 | 310abed690f217cb61378ec844450154 |
|
BLAKE2b-256 | a638bf24fe1f1e5ae8a1188207a922739f732f5d9ff090f63a8b6ba38d775e17 |
File details
Details for the file PennyLane_Catalyst-0.8.1-cp310-cp310-manylinux_2_28_aarch64.whl
.
File metadata
- Download URL: PennyLane_Catalyst-0.8.1-cp310-cp310-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 65.0 MB
- Tags: CPython 3.10, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a546bfcbfdb70ca901545644741778100cdc4373e35454f28a7764191647e989 |
|
MD5 | ab15948ec8595d95f9dd7ad141b11df9 |
|
BLAKE2b-256 | 4f3938c997faeb553ebd37423f6f581bdd345a283f9708afc5e66f94b7211fd5 |
File details
Details for the file PennyLane_Catalyst-0.8.1-cp310-cp310-macosx_13_0_arm64.whl
.
File metadata
- Download URL: PennyLane_Catalyst-0.8.1-cp310-cp310-macosx_13_0_arm64.whl
- Upload date:
- Size: 54.4 MB
- Tags: CPython 3.10, macOS 13.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ebb57f0561bc26ddc1dd71e7497e8c3214010a42dea24fa07ae446172f16d12 |
|
MD5 | 99c8eb8de9c52ecebc5370b176a42f38 |
|
BLAKE2b-256 | b8056481cb33133724ded6253be0b4835a10e5dcd10590cb689577ecea550ec1 |
File details
Details for the file PennyLane_Catalyst-0.8.1-cp310-cp310-macosx_12_0_x86_64.whl
.
File metadata
- Download URL: PennyLane_Catalyst-0.8.1-cp310-cp310-macosx_12_0_x86_64.whl
- Upload date:
- Size: 61.5 MB
- Tags: CPython 3.10, macOS 12.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7c4c2dc7214d038cafc104078efbbb5e9cc9a60a0ede8c20046e24b78b987de |
|
MD5 | 7a3e7e4cf44b393dd2aeff127f05b37a |
|
BLAKE2b-256 | 96fcf5955513daee632c8399331b5f4701ed288e957357d113ba91f21b3a7cbd |
File details
Details for the file PennyLane_Catalyst-0.8.1-cp39-cp39-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: PennyLane_Catalyst-0.8.1-cp39-cp39-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 65.9 MB
- Tags: CPython 3.9, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1c479d9cd1a5308099fffa83444437fe5a46dcf708e82abffc951ce7d1324ad |
|
MD5 | 45c91310343683a60686bcb33037235b |
|
BLAKE2b-256 | 0b9cd420c170b197e3abdc6325136e4c73ea146c8cea5406ff0f32f0517f4506 |
File details
Details for the file PennyLane_Catalyst-0.8.1-cp39-cp39-manylinux_2_28_aarch64.whl
.
File metadata
- Download URL: PennyLane_Catalyst-0.8.1-cp39-cp39-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 65.0 MB
- Tags: CPython 3.9, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96895a6a495060cb0cfb83f11155b6ef7b000ae0a8ac98bb3260896f80507565 |
|
MD5 | 6d4c75a5b41c846ec8949b6bbf13ae3a |
|
BLAKE2b-256 | d1e20222ae434c2fb9d4b4c7f9ff1943f46522da194962ae537b5686f8ffda7d |
File details
Details for the file PennyLane_Catalyst-0.8.1-cp39-cp39-macosx_13_0_arm64.whl
.
File metadata
- Download URL: PennyLane_Catalyst-0.8.1-cp39-cp39-macosx_13_0_arm64.whl
- Upload date:
- Size: 54.4 MB
- Tags: CPython 3.9, macOS 13.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91eb15e9976c300a730e870d8d509e03a75421cc57c0a2bef2783e865ce42cef |
|
MD5 | aa5eb3d6db64f4ee08144165798b033c |
|
BLAKE2b-256 | 671a1e46a972d32cededb46e959a338a8b08a3a3d99c810495cccd19942f2b90 |
File details
Details for the file PennyLane_Catalyst-0.8.1-cp39-cp39-macosx_12_0_x86_64.whl
.
File metadata
- Download URL: PennyLane_Catalyst-0.8.1-cp39-cp39-macosx_12_0_x86_64.whl
- Upload date:
- Size: 61.5 MB
- Tags: CPython 3.9, macOS 12.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f34a5fee406c3f4aea30ad970bb24463ed78a780b1bad043a848f65b8e30b540 |
|
MD5 | 844e75c90f360244b7b61a4a99505877 |
|
BLAKE2b-256 | 40aa15ee4597626d4b801052075bc23d5cc312616cddf8e5506b646657136653 |