Skip to main content

A JIT compiler for hybrid quantum programs in PennyLane

Project description

Tests Coverage Documentation DOI PyPI Forum License Dev Container

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:

  • Catalyst Compiler.

    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.

  • Catalyst Runtime.

    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:

  • PennyLane JAX frontend.

    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:

Dev Container.

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

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


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

PennyLane_Catalyst-0.8.0-cp312-cp312-manylinux_2_28_x86_64.whl (65.8 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.28+ x86-64

PennyLane_Catalyst-0.8.0-cp312-cp312-manylinux_2_28_aarch64.whl (65.0 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.28+ ARM64

PennyLane_Catalyst-0.8.0-cp312-cp312-macosx_13_0_arm64.whl (54.4 MB view details)

Uploaded CPython 3.12 macOS 13.0+ ARM64

PennyLane_Catalyst-0.8.0-cp312-cp312-macosx_12_0_x86_64.whl (61.6 MB view details)

Uploaded CPython 3.12 macOS 12.0+ x86-64

PennyLane_Catalyst-0.8.0-cp311-cp311-manylinux_2_28_x86_64.whl (65.8 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.28+ x86-64

PennyLane_Catalyst-0.8.0-cp311-cp311-manylinux_2_28_aarch64.whl (65.0 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.28+ ARM64

PennyLane_Catalyst-0.8.0-cp311-cp311-macosx_13_0_arm64.whl (54.4 MB view details)

Uploaded CPython 3.11 macOS 13.0+ ARM64

PennyLane_Catalyst-0.8.0-cp311-cp311-macosx_12_0_x86_64.whl (61.6 MB view details)

Uploaded CPython 3.11 macOS 12.0+ x86-64

PennyLane_Catalyst-0.8.0-cp310-cp310-manylinux_2_28_x86_64.whl (65.8 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.28+ x86-64

PennyLane_Catalyst-0.8.0-cp310-cp310-manylinux_2_28_aarch64.whl (64.9 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.28+ ARM64

PennyLane_Catalyst-0.8.0-cp310-cp310-macosx_13_0_arm64.whl (54.4 MB view details)

Uploaded CPython 3.10 macOS 13.0+ ARM64

PennyLane_Catalyst-0.8.0-cp310-cp310-macosx_12_0_x86_64.whl (61.5 MB view details)

Uploaded CPython 3.10 macOS 12.0+ x86-64

PennyLane_Catalyst-0.8.0-cp39-cp39-manylinux_2_28_x86_64.whl (65.8 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

PennyLane_Catalyst-0.8.0-cp39-cp39-manylinux_2_28_aarch64.whl (64.9 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.28+ ARM64

PennyLane_Catalyst-0.8.0-cp39-cp39-macosx_13_0_arm64.whl (54.4 MB view details)

Uploaded CPython 3.9 macOS 13.0+ ARM64

PennyLane_Catalyst-0.8.0-cp39-cp39-macosx_12_0_x86_64.whl (61.5 MB view details)

Uploaded CPython 3.9 macOS 12.0+ x86-64

File details

Details for the file PennyLane_Catalyst-0.8.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.8.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fcce11aada6093c50b136ffa424cc13c0ed92221601d36ff7ec1fcac31a9071f
MD5 f5f5df68d226dca70330c0d070db3881
BLAKE2b-256 f82e8ba57e6f30d1fc083f6f26a640164bc340c836b686538f5ecda2899c667f

See more details on using hashes here.

File details

Details for the file PennyLane_Catalyst-0.8.0-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.8.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 fd876deaea63c0e00dbcba99431fdab59377dd48037979c75b4ce5bb3aaf2ddc
MD5 4c7ed7a672c4275253044edbe5f3bc7a
BLAKE2b-256 46b64edd1d58aee5864eb887024ce9c45e5a0e471b0d758a3ec784cf9b22caae

See more details on using hashes here.

File details

Details for the file PennyLane_Catalyst-0.8.0-cp312-cp312-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.8.0-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 993bc5c91e3347cc469c03d65d78cc8a974bf2cdeec5a093f6051bb90d1df1de
MD5 7e65582ed55dd4061a031675a7f9ee7e
BLAKE2b-256 897672ea594b57c7cd41e0280e5164d2735fae421a2121cb676f896dd898d156

See more details on using hashes here.

File details

Details for the file PennyLane_Catalyst-0.8.0-cp312-cp312-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.8.0-cp312-cp312-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 02bbc0f61de3b6b3646c5d6866d73ef1a9f604373ec57ad4edbeb9da56ed1c25
MD5 a150989728160848d4c27780a7ea342e
BLAKE2b-256 1ba8fcc3390039585eaafc893f40d46a89e8eae3863a908936181dcf2412c024

See more details on using hashes here.

File details

Details for the file PennyLane_Catalyst-0.8.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.8.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 73411f46fa159f7f9030e9df034bbfec16ec9867185e92c0a02afa8425b862a5
MD5 3867d3e61915f9bc30e1a4db62124822
BLAKE2b-256 222ec1e98770281ad20467a9d04c665c55b0c04ff422c7c3a0f69cd556527b8e

See more details on using hashes here.

File details

Details for the file PennyLane_Catalyst-0.8.0-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.8.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e89b04d80d95b433910c6fcd08907e804ec622785ffd68d7dda562d2308307a8
MD5 4530fecce857b4bd5a6442aefca144ed
BLAKE2b-256 47344c58a0d97d1c1f15b79eb7b129bf4d6c3b961391b5c8b5cc6904f5cc11ef

See more details on using hashes here.

File details

Details for the file PennyLane_Catalyst-0.8.0-cp311-cp311-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.8.0-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 a217dbc75f3183531d78193db0e5b322deae52cb4542609c68a715159111a226
MD5 a79d78402159d5407b70857585833634
BLAKE2b-256 045f0fec1a449e3c725c9992b9fac9de329dfb8f7696f653cd0f031d01dc02ab

See more details on using hashes here.

File details

Details for the file PennyLane_Catalyst-0.8.0-cp311-cp311-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.8.0-cp311-cp311-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 bac5405e7ce8e905fabbc1f330f496fb564de40ab6ae75d2be5e9e4114ec3aa4
MD5 16b55677fb28c75cc5f3c9c66773657c
BLAKE2b-256 93ac9b561d8655de8fa27be5fe98415db5cb6bd65c99d3bc7715852909e3ade1

See more details on using hashes here.

File details

Details for the file PennyLane_Catalyst-0.8.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.8.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ffa6fb79b1319fe932f5dae6ee44b1fafe734e658e7ed6b50f5f75b7fd93b64f
MD5 0865f04a0e84840d4c55f108fbb79f98
BLAKE2b-256 8a3b8007ced75d21dc3e3c92a6f67c9d6c2d5e3431f961052c2a6737561fa5f0

See more details on using hashes here.

File details

Details for the file PennyLane_Catalyst-0.8.0-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.8.0-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c0b063eaa4145bc7c59ba6ce2e31b726b52b342ea1a62c60c1a97ff5e0dd0e36
MD5 62e8f444206f1e94975ed4ee41acd7ba
BLAKE2b-256 0c660af599b7f14b1bed2452955794005336ca82ccd10c558b032eed8d6f48b0

See more details on using hashes here.

File details

Details for the file PennyLane_Catalyst-0.8.0-cp310-cp310-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.8.0-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 71896de952293f73c7f96a5cbf01e69b9ebf413b89235495a9de02e78b3a2864
MD5 59d75410e39c3061d3d2ea036ec3272a
BLAKE2b-256 7ff31d39811019d9e4eb723fcb14de45ca1508d11d6e7ea4d3b3de2417f58c62

See more details on using hashes here.

File details

Details for the file PennyLane_Catalyst-0.8.0-cp310-cp310-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.8.0-cp310-cp310-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 d15e99ab26245411994f9a21de79b8e51180312fc73c78f28743aeb29a952df3
MD5 6fac24fd2bff204dfb531c3b7cd4d3bf
BLAKE2b-256 7c84da83292c79a6aa7d750b5bf4a4bf0ea7f2335fe222b281a1183291335f0b

See more details on using hashes here.

File details

Details for the file PennyLane_Catalyst-0.8.0-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.8.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cdc16866b1e1474753081ec594c024df72a0d782ba79944dc8698f44213ed66b
MD5 3297520c3ee696f03da7219ec7d94b64
BLAKE2b-256 402c0507a79647a911f5e18acfe16a0a128103542b40a15e932708d279f12b2b

See more details on using hashes here.

File details

Details for the file PennyLane_Catalyst-0.8.0-cp39-cp39-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.8.0-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9d8dbbff8e8c91cdac48cacbb9c3d57fa6832011662ee3fc49dca3905ba511fc
MD5 fd8a4254e71c0cef83e848bfa2b8722b
BLAKE2b-256 0583ad203ccb889caa6447bf027a2ed798245f0d9be5aff159cb5dedcd1b6758

See more details on using hashes here.

File details

Details for the file PennyLane_Catalyst-0.8.0-cp39-cp39-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.8.0-cp39-cp39-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 97cad82ca9b4b8382803a79ab0223ad19de2a86e098920e092338caa19143dbd
MD5 2ba25cf883c2012e3a4d1a7b799f2c19
BLAKE2b-256 f4846618dcb32b1506a8f46a596208f58cf44e6c4e87588d6f52f0006146b462

See more details on using hashes here.

File details

Details for the file PennyLane_Catalyst-0.8.0-cp39-cp39-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.8.0-cp39-cp39-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 435911060badcf080d0cdbcba9fc5e7cd58cee57ffc940406acb5d59e4fb8687
MD5 603ec6778c691e5960a3f451b64dc3ef
BLAKE2b-256 dc03faca4120d52b039d4a76f4e51f9e9f8a0280e2c0369ecfa7858f3a75463c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page