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

Uploaded CPython 3.11 macOS 13.0+ ARM64

pennylane_catalyst-0.3.1-cp310-cp310-macosx_13_0_arm64.whl (51.3 MB view details)

Uploaded CPython 3.10 macOS 13.0+ ARM64

pennylane_catalyst-0.3.1-cp39-cp39-macosx_13_0_arm64.whl (51.3 MB view details)

Uploaded CPython 3.9 macOS 13.0+ ARM64

File details

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

File metadata

File hashes

Hashes for pennylane_catalyst-0.3.1-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 614bd8cda27c9f20af007d339e7e477ff287fdc890e5361a8ee145a1b78fd04f
MD5 4cc1c4dd367629754245f0db992c6fbe
BLAKE2b-256 f50000a265bb1ce00807dd392fdf1b57b4fed3679510a7de524839fd7101f286

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pennylane_catalyst-0.3.1-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 e2df8ce09ca11c47983790a0a18c19f62235059dca5be9e3a47f0ed135fa2bbc
MD5 d0518a16cf40a94623accf626cd7e882
BLAKE2b-256 437c5bc89a062373b34a9947ce99e374b3de7cdc1697483e13c2421e43744e44

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pennylane_catalyst-0.3.1-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 33f1c52c7bad87c71a647deb813e131670fa02af7a9b65afa8db0a726f495c08
MD5 59a85597b00a17acb9d744ee551be095
BLAKE2b-256 8427f37d40689fbec7ad48bb667bff3121bad3352513e913b99bc60bad6db83b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pennylane_catalyst-0.3.1-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 236ac52c6e7c8acc8d8f34dbf78c37aa1096206d83aba6e9c007376aa4cf35f6
MD5 30d6ee24353ae9db5359e350380ccec3
BLAKE2b-256 74f2f4c50290bed66d0e2b703cac67f4ebcacd49663a489c98f6f4f1436fc256

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pennylane_catalyst-0.3.1-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ea3f2e39cba7ef8c27a96b0c9c4d6ffdee99127538f3ffa1ea0d45d1ead1afdd
MD5 ef9b5eb22845e9de5dd199d882b54e5f
BLAKE2b-256 c079bafa4e9c3b37025653146ec6755266d33ee540a7c8cdee18f2407f9b4757

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pennylane_catalyst-0.3.1-cp39-cp39-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 f73531bfbd36d06f5ca68058135dc162e75509c1f1173215dfb02f3366cd5f15
MD5 7f8353bc0e46a40d241b7a09d3610951
BLAKE2b-256 5384e9a2626f7bad38adea4c4299de49aec52a7601e78da6820156f8e189b08f

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