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

Uploaded CPython 3.11 macOS 13.0+ ARM64

PennyLane_Catalyst-0.4.1-cp311-cp311-macosx_12_0_x86_64.whl (56.6 MB view details)

Uploaded CPython 3.11 macOS 12.0+ x86-64

PennyLane_Catalyst-0.4.1-cp310-cp310-macosx_13_0_arm64.whl (50.1 MB view details)

Uploaded CPython 3.10 macOS 13.0+ ARM64

PennyLane_Catalyst-0.4.1-cp310-cp310-macosx_12_0_x86_64.whl (56.5 MB view details)

Uploaded CPython 3.10 macOS 12.0+ x86-64

PennyLane_Catalyst-0.4.1-cp39-cp39-macosx_13_0_arm64.whl (50.1 MB view details)

Uploaded CPython 3.9 macOS 13.0+ ARM64

PennyLane_Catalyst-0.4.1-cp39-cp39-macosx_12_0_x86_64.whl (56.5 MB view details)

Uploaded CPython 3.9 macOS 12.0+ x86-64

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.4.1-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c248304644a436f3a145243b6ed7f975039a7d0d65403ec932456c31c5d47a1d
MD5 7993677012d4127345c916c56fc27040
BLAKE2b-256 dbed6dfe4ead0ccd0c3448d9f774938610dbc8dba0502d08177a59e17e30efb5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.4.1-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 4140228d026d4b629ccc4f53252f53cb2cb57917b2adcac2119754654de178db
MD5 741a3b3f7b2ec9cbb3859f345a2bf3d9
BLAKE2b-256 5dd22f4c2fef0c6d2e2336e100e21499447291b10d86577c649d1e20c531c5f8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.4.1-cp311-cp311-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 51d9703ce7abaf4032b6aafd29340439baff98c0887315e5af91aa5462c8f845
MD5 5f3b13e9b4d200b498368585e6079dfc
BLAKE2b-256 375761788fd1199acc10a4f9c3795af2d70b02775ff85a913d76f2225dadab8d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.4.1-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d76459b7f2509473500bf103606fc25214eefe66d1cf5db616144100f1a18b93
MD5 1e24ddab095a325e992ef56847b92cec
BLAKE2b-256 ec0ddfcd419704e86d81cb386909cb63d77b148d6e9e8b9a1e6a96d38bae7b7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.4.1-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 a84147a68ea2da599f83d6134e1766ddcc13a8f7f10f639e07b7c1b3a32d2724
MD5 62947130d50b0473b481222755b5788c
BLAKE2b-256 f8c4cd91c96286bb073fb9c17142ba840ce501a144f797cf8a236c2c8a75e8f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.4.1-cp310-cp310-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 8768589057e68aa2184d963916f407d5fa29765e267df41aebe724583ad5eca2
MD5 8b3b1a21e943f52fdf947a8ef63a3cbd
BLAKE2b-256 8a044d4bb346bb7bdb5a5f7f2b4538109b19a082d90cafee76782a41d1d89b71

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.4.1-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 adea6c722d042520e82764d776da370787e7fbaf19527b905834b3f3e14a4dbb
MD5 5f9b0b7fcd6f0ddb7cb12c6b8285c7e5
BLAKE2b-256 4533be7e7a106bbe8cc87f6cc1e46a564e3bd3cb057253822fb5c5872be21d56

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.4.1-cp39-cp39-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 1b14596faeccfe6e69ab86a90e47d848c6dd09daae90c6859da140f603ad2a60
MD5 6ebd6a646fa2c09f2b36f38f42040023
BLAKE2b-256 ca0a6f5305bc8e0805bc6bbee15a423ceb888e07c07822502d8112121e5bf23d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.4.1-cp39-cp39-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 2284b0fabc7510daa9e2084fb80b109d1be060f6373f2666eeea4332b565e431
MD5 a42be09fba916e85af6391da4880ded4
BLAKE2b-256 fc4742c98fe7fc91e34029a7debbe5cb7e8e4e68646170eca36971b1dfd010d7

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