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

Uploaded CPython 3.11 macOS 13.0+ ARM64

PennyLane_Catalyst-0.4.0-cp311-cp311-macosx_12_0_x86_64.whl (57.0 MB view details)

Uploaded CPython 3.11 macOS 12.0+ x86-64

PennyLane_Catalyst-0.4.0-cp310-cp310-macosx_13_0_arm64.whl (52.0 MB view details)

Uploaded CPython 3.10 macOS 13.0+ ARM64

PennyLane_Catalyst-0.4.0-cp310-cp310-macosx_12_0_x86_64.whl (57.0 MB view details)

Uploaded CPython 3.10 macOS 12.0+ x86-64

PennyLane_Catalyst-0.4.0-cp39-cp39-macosx_13_0_arm64.whl (52.0 MB view details)

Uploaded CPython 3.9 macOS 13.0+ ARM64

PennyLane_Catalyst-0.4.0-cp39-cp39-macosx_12_0_x86_64.whl (57.0 MB view details)

Uploaded CPython 3.9 macOS 12.0+ x86-64

File details

Details for the file PennyLane_Catalyst-0.4.0-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.4.0-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6ccfc98ea3196d81023f9cffbcd4778df83ec680ff5032c9700ae6bb0a184ff0
MD5 9902d7ce392e01c4dd6582d88c928827
BLAKE2b-256 6874bd652efe589c9bdf9a1e7dfc69cc20b5c239d8d0e53a3bd472228c8e3ec3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.4.0-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 7394bd6750d59f41ff049f032f344e965c1df8ba0ed15450387597dfeb30ab1f
MD5 1ddb46aa286394215e3942ea1a1dd768
BLAKE2b-256 da1907f557bf129e90d480d42fbab69eec246eca3b469abcee5d175dd824d11c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.4.0-cp311-cp311-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 59909620bc0c433f11c010513104bcf1ba56c2623b41bbda7688f081b2501105
MD5 508540c0a010b00d9afae1247ff5bbfa
BLAKE2b-256 a81acdcd62aa99ad95b7feda8263981a8a74f9bfd8c6a484aaa30f427b1fa7c4

See more details on using hashes here.

File details

Details for the file PennyLane_Catalyst-0.4.0-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.4.0-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a9e5393fb2715ba256f0beb2a574a170fd09a8a1bc871d4e36a7ac287ca1000a
MD5 2aa18646c2c9ccddfe3c72f4d0430076
BLAKE2b-256 e4801490007b971dc2641317321dc738eeab733dac12c484d706cfb669699499

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.4.0-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 eaeafbdca27768d6c1c7a5120d88bcf0795dc271f421082d0c91cdf3bdae877e
MD5 9c58db1f8bd3f010a865e69b68c04e7c
BLAKE2b-256 61f562600fe59e5c0aed4d3c279809493a537b96190a888b2f17f72a0d5aa1d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.4.0-cp310-cp310-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 a49f7d53eed2b0729d39881d93a65bc69d5308f3373944e5fdbf2815180c1be7
MD5 b45645cda870156fcf4feeaafc278e6a
BLAKE2b-256 d1636bc3c52acb62dd60d451daea657204e05b1b7019517242d282a0ca3e6ec5

See more details on using hashes here.

File details

Details for the file PennyLane_Catalyst-0.4.0-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.4.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 562e93f937d7384b6e0b6f785d9930e277345c6be303776efb6c17f2e5b47487
MD5 fa522a45aa9e9b247e7a847fe5e2ab77
BLAKE2b-256 ba2ce791d25d92f5c84d12c877df56eb4b1378160f3982a54a2f50df5dcf0357

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.4.0-cp39-cp39-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 e71afc9fa0c9d0786a302f54a211cb9add27035add0c8aaa4c9e9e3e9eab2320
MD5 f3bb9625b7c03efa6b7b575920828264
BLAKE2b-256 132f80da76ac8238a1cf28f6bb757e705889240b1f81df0cd824d1dedd3a04da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.4.0-cp39-cp39-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 7ad79cce3b14ecd4b1fad19204859907436548e4e3928132c24bb1f293e679d1
MD5 f0bf13b31a5401f8ea859d5d3fbc9a1f
BLAKE2b-256 9e0e299b598ac210e11277aded70324bcbe0308cda926b4b34216bd3bb41f0cd

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