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.5.0-cp312-cp312-macosx_13_0_arm64.whl (51.8 MB view details)

Uploaded CPython 3.12 macOS 13.0+ ARM64

PennyLane_Catalyst-0.5.0-cp312-cp312-macosx_12_0_x86_64.whl (58.3 MB view details)

Uploaded CPython 3.12 macOS 12.0+ x86-64

PennyLane_Catalyst-0.5.0-cp311-cp311-macosx_13_0_arm64.whl (51.8 MB view details)

Uploaded CPython 3.11 macOS 13.0+ ARM64

PennyLane_Catalyst-0.5.0-cp311-cp311-macosx_12_0_x86_64.whl (58.3 MB view details)

Uploaded CPython 3.11 macOS 12.0+ x86-64

PennyLane_Catalyst-0.5.0-cp310-cp310-macosx_13_0_arm64.whl (51.8 MB view details)

Uploaded CPython 3.10 macOS 13.0+ ARM64

PennyLane_Catalyst-0.5.0-cp310-cp310-macosx_12_0_x86_64.whl (58.3 MB view details)

Uploaded CPython 3.10 macOS 12.0+ x86-64

PennyLane_Catalyst-0.5.0-cp39-cp39-macosx_13_0_arm64.whl (51.8 MB view details)

Uploaded CPython 3.9 macOS 13.0+ ARM64

PennyLane_Catalyst-0.5.0-cp39-cp39-macosx_12_0_x86_64.whl (58.3 MB view details)

Uploaded CPython 3.9 macOS 12.0+ x86-64

File details

Details for the file PennyLane_Catalyst-0.5.0-cp312-cp312-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.5.0-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4604c1e2cc2ab16e33303f0de91afc3b0b4aab991cdd7900356e508d7bc0e329
MD5 7c8a6eb80b8993eaa8f52a68a8464cbf
BLAKE2b-256 6ff8ec3677b2fbf30bd7a54ab0b7d8fc9ce72b1df8d438b6ffb7fb9a69225d10

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.5.0-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 51641a0cd7c6b967cae1849cb5f1b0c2a37b6f2b98ea1cbd495ce0376aaba379
MD5 cf7b5fa54a00d3369e25d21960f9e6d8
BLAKE2b-256 abd7fb9680e6364421102a7f3cff5e0661cc07b7cca7213b1d903925fc7e7476

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.5.0-cp312-cp312-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 00c7919e8b24e019ea756ea3837eecf1f1c1206341759b23b8afe98e9a90bb32
MD5 5598cf5c9a85143889c8cc33d64dda28
BLAKE2b-256 fad893afdac7088daa7f7f2fb34fe8b57777e644dc948903538c5ae15e01ae38

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.5.0-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9ba935fd8ce30b6c3c0136ee975f838a2498916f228ea8d54dbb8ac4a23571ea
MD5 db925edb82b6fd5c79068cfe8d23b9df
BLAKE2b-256 0550dd8e53e33da04954c5990feb2dcf57c0153c8b508f8c7dade4bceed37da9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.5.0-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 230b1a91fcdc376327b5f1189f110305aa1bb65e0e865710e12abd0a7ac0a7f6
MD5 1ec9f68cc73b71461f3f55c3258a28fb
BLAKE2b-256 258cfeaeb1f42afda64a38d3b1d1d2a44ee65d7e432b1dd7f362e625ca171dc3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.5.0-cp311-cp311-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 73e315d2d7e82b488186d8adb3d333eb52e97a2bb4ab649edadd71b83bfab510
MD5 ac760f064d5b7e1f692dff33008af4ec
BLAKE2b-256 310d2d908039faa3469420246f5b836666a4f7ad8e63910e9638d868722017d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.5.0-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b3c887190bbdc3d68f69a2283b8727d405dbecd32b6be20051ce8d4e3e93b60f
MD5 6f4ba7be2621261576b5c54793868d13
BLAKE2b-256 570da1232c8b2d18d7bbb03496e2a6ee1459d4194de36e25b37ff8597eb079df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.5.0-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 4f362793c147675238d0af27afd7a45b0a08b3056fe9fefb0191109185e2633a
MD5 ac28fe232b6fe08ba55520a17524da33
BLAKE2b-256 9ba1418802a1489ab199569b8a0760068cc9279c01fd5e7aab00dc40a85ba9f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.5.0-cp310-cp310-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 e7ac9e4c49beba6670668cb6ddcd7444fb845c6b044f0e71191453861e1945ff
MD5 0050f49166f47390c982849d5e01441b
BLAKE2b-256 2b5aac79c025bc153b63465b317151ca62b74dc331288583c7692c54eb9765b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.5.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 35090ae9faeb1236e555be358ba86ba99942036c1dbcd00c5aabc96c3b053de0
MD5 eb6b41b1eea617bce52eb8544dd3c576
BLAKE2b-256 10ab82e4f37dee0a0d94620318fe67831794d311c16ff393d0fee86f16ebe473

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.5.0-cp39-cp39-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 90aab443d6e0093ed8c287d880b3f04573e94344a7401bc9c7f83fea7d61bcf0
MD5 882d396260f9fb5537af59d89c596c81
BLAKE2b-256 d4da78a5456ed8379f9ee4330ec13bb24165af15d67836b3f6f36ae79b648952

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.5.0-cp39-cp39-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 ebce2fd57e1104aefa9366f2e453fb13bb835ccf01d4453134d104acd60762c3
MD5 07d8901c428b8ddd56952255f679b2b4
BLAKE2b-256 1a37df1cb001d68c3f10ae59d438cc9647335fe3b37512cbe814b110f2238b64

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