Skip to main content

A JIT compiler for hybrid quantum programs in PennyLane

Project description

Tests Coverage Documentation 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 (x86_64) and macOS (aarch64) 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 GitHub repo.

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.3.2-cp311-cp311-macosx_13_0_arm64.whl (51.2 MB view details)

Uploaded CPython 3.11 macOS 13.0+ ARM64

pennylane_catalyst-0.3.2-cp311-cp311-macosx_12_0_x86_64.whl (56.2 MB view details)

Uploaded CPython 3.11 macOS 12.0+ x86-64

pennylane_catalyst-0.3.2-cp310-cp310-macosx_13_0_arm64.whl (51.2 MB view details)

Uploaded CPython 3.10 macOS 13.0+ ARM64

pennylane_catalyst-0.3.2-cp310-cp310-macosx_12_0_x86_64.whl (56.2 MB view details)

Uploaded CPython 3.10 macOS 12.0+ x86-64

pennylane_catalyst-0.3.2-cp39-cp39-macosx_13_0_arm64.whl (51.2 MB view details)

Uploaded CPython 3.9 macOS 13.0+ ARM64

pennylane_catalyst-0.3.2-cp39-cp39-macosx_12_0_x86_64.whl (56.2 MB view details)

Uploaded CPython 3.9 macOS 12.0+ x86-64

File details

Details for the file pennylane_catalyst-0.3.2-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pennylane_catalyst-0.3.2-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5513424d5c278c2850fddbef2d0f5f9a76118b856ef500a86515cc661e6ed5e3
MD5 754305d610d8d6d968f27fd4dcf19be2
BLAKE2b-256 5dbd0d09ffa0d289f1c64bedd383955cb4b5245f7df739d24a705bef32f5ca05

See more details on using hashes here.

File details

Details for the file pennylane_catalyst-0.3.2-cp311-cp311-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for pennylane_catalyst-0.3.2-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 777a3307b6f1a3ef0c02e55c7a38e55bb88d1cc1bb046c31b676a1a296ea6536
MD5 0d62cd70d12b77fd2c57f0d7fefcb54d
BLAKE2b-256 7351572f35a1f3b8b68227d92aedf2bb6e2e5bc1b2834fbd0aa240d298ff65c4

See more details on using hashes here.

File details

Details for the file pennylane_catalyst-0.3.2-cp311-cp311-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for pennylane_catalyst-0.3.2-cp311-cp311-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 8a9b94017853b7f0388949b2bb7af9450863765f9218e179a191fbcaaf9f8fbc
MD5 26e3220ae37c5e4af1d780b3261e78b0
BLAKE2b-256 5f906d9423115588ae36727d09ccbc7a6cf49201f3d9fe57f11f5281717608d4

See more details on using hashes here.

File details

Details for the file pennylane_catalyst-0.3.2-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pennylane_catalyst-0.3.2-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f876378a7380a03687339706eaafe8d9233f2f65af683ce0f412647093aa3f69
MD5 28cdcc2075b29d4e95ae81d1c8f23627
BLAKE2b-256 796c9027ae8fc1da0e7bce14bb2e6e893fb033f8c0a1dbebfbe190588cd4157b

See more details on using hashes here.

File details

Details for the file pennylane_catalyst-0.3.2-cp310-cp310-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for pennylane_catalyst-0.3.2-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 eb73db8776e21d277c1709515873a4d6a8b0214df5f27b5e7f94ec5f824b6539
MD5 a124c5ff925d0a99abd8eb9ea77c65d1
BLAKE2b-256 4089d16d683d66be81747780599f9537d790b43c2fa0f013a95ad79b1a8b6bfb

See more details on using hashes here.

File details

Details for the file pennylane_catalyst-0.3.2-cp310-cp310-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for pennylane_catalyst-0.3.2-cp310-cp310-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 7954ce239df32123260ad847a709f01c657e71ca30167660cfb59da5b0766fad
MD5 1f7712f38c557cf65d9fe40780817e76
BLAKE2b-256 062fc542a6bdcb3f8cdfa0241a116de9e8bc907554542c9b84dff2f2862bd446

See more details on using hashes here.

File details

Details for the file pennylane_catalyst-0.3.2-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pennylane_catalyst-0.3.2-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8fbe577f28583eac4ecd5d61844b0b67d260563f7aad7fcf6b28f2c31a4520d6
MD5 475ee2f06252bab5ac132808bcda442b
BLAKE2b-256 89aa59c14afe5b8ad6f4df1efdce7d4aa0e35a6375559cbe73c714de753555fd

See more details on using hashes here.

File details

Details for the file pennylane_catalyst-0.3.2-cp39-cp39-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for pennylane_catalyst-0.3.2-cp39-cp39-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 6a75d166a20a05e1e47559acafcdb17296d43ce658a3b620f7209fdd61c94178
MD5 ab86ea1758423c5b3cae010025a1c2fb
BLAKE2b-256 b53d0359a4d801eaa9e9f4db9846e7fc67308c20db59a432b8b32e8e10bc2908

See more details on using hashes here.

File details

Details for the file pennylane_catalyst-0.3.2-cp39-cp39-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for pennylane_catalyst-0.3.2-cp39-cp39-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 e20f0810dc49aba2479b203026ce64c4825b9198dde5f7fa7f2d6684d5a6ec18
MD5 a90a78582de25e8e117bcf860aafd393
BLAKE2b-256 a5c99cc3a91556f1dcd189be13de6077b139d3a4c6c22d23f01fc4d91de10429

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