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

Uploaded CPython 3.12 macOS 13.0+ ARM64

PennyLane_Catalyst-0.6.0-cp312-cp312-macosx_12_0_x86_64.whl (58.7 MB view details)

Uploaded CPython 3.12 macOS 12.0+ x86-64

PennyLane_Catalyst-0.6.0-cp311-cp311-macosx_13_0_arm64.whl (52.3 MB view details)

Uploaded CPython 3.11 macOS 13.0+ ARM64

PennyLane_Catalyst-0.6.0-cp311-cp311-macosx_12_0_x86_64.whl (58.7 MB view details)

Uploaded CPython 3.11 macOS 12.0+ x86-64

PennyLane_Catalyst-0.6.0-cp310-cp310-macosx_13_0_arm64.whl (52.3 MB view details)

Uploaded CPython 3.10 macOS 13.0+ ARM64

PennyLane_Catalyst-0.6.0-cp310-cp310-macosx_12_0_x86_64.whl (58.6 MB view details)

Uploaded CPython 3.10 macOS 12.0+ x86-64

PennyLane_Catalyst-0.6.0-cp39-cp39-macosx_13_0_arm64.whl (52.3 MB view details)

Uploaded CPython 3.9 macOS 13.0+ ARM64

PennyLane_Catalyst-0.6.0-cp39-cp39-macosx_12_0_x86_64.whl (58.6 MB view details)

Uploaded CPython 3.9 macOS 12.0+ x86-64

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.6.0-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4bcc51572cf2ce61745a14ad5a3f8d0ab221462846bd58f9da2b7469a6c860c6
MD5 51afa55bba0f8e27ef0cf2fcf28ddcd3
BLAKE2b-256 75ca2125d8fb024524ab21d0fe470fc1b50fc115e0fc0fca0e037f7ebd8d6e0f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.6.0-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 c084ad073cac489d82cc1d2839f381697ebce5654f2f416c66a193b8799fb427
MD5 f7f22942fa11148ff8c53872a7d07bad
BLAKE2b-256 6d32878e9b8547018c9b87ba321558bf855936e5e459607ce3fbc9f00fa43ed5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.6.0-cp312-cp312-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 9a7f80f5b376d975265d659fffa66c7ecd7640c5be84588e78b8ce8995cc3132
MD5 b831cbc72a9d43ece23e39c4f6c26d3f
BLAKE2b-256 8ec0430bcc80fb8779a3febf10fcd8f6def244f7bfc73ff43dd57502cc42ce4c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.6.0-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c5147dc43003c70b62c00ba3076c62a45eda6ac79affac1c7933c53d735aac9b
MD5 1a33996ed5e5a677a357257f9f159f75
BLAKE2b-256 e3d1fde16f9fbdb6fdd78dfa5a1d44b41bb92f81c53fdaa52f85172c51e6bf4f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.6.0-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 4105c555825f02ae21bc2ed42d5b17e61ed6647ddd27ca7dfc6e90ee9369562a
MD5 713ed8bbfe0efa66e0147074cdf31161
BLAKE2b-256 27f7c0e5899a5570565c07d751f1a4efda7cdaf6e85ebee01098fb997a22b6ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.6.0-cp311-cp311-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 aebcc4c7de14483d57b88bd38cc7458ef7b4c07bbe20d30a173cfbf648907226
MD5 26c60645b50a6b567c72058853219c49
BLAKE2b-256 b5424577bec9fa5a91ad879ce150fc126fa29ffef0d37f953772c4b004c0a3c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.6.0-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c1d8f406eb80a7861eed5f878a17023648f10b781bf798d88c582d0351336402
MD5 1f78c7e9baa1da0d19c8b8d8b5df17eb
BLAKE2b-256 cc36b8efedf2b6cae6bbdde3466eaf794157589e3911db9ad668dd9c6eb56b11

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.6.0-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 9732c96c262df4ec7a53eb17b6af7bbe0b3e4dd1b058a1ada43a084fb311d118
MD5 a46af8e79673c283a3cc3ae69bbc4ff4
BLAKE2b-256 c66ffd53927adb5b3948bd378815cb84a553125d216c28103f0696fd084649ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.6.0-cp310-cp310-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 898c0b5f54cf946284f21aa9631b77b014ac20afda9c796028e6796525dfa578
MD5 22995b5207aa74cca25e64ae8b4c4531
BLAKE2b-256 35470215c23c301e94139494d3906219118cbd512f30fc2e93cc3be122a19e20

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.6.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f181829cc61deea0d7db92eb9ee9cdbd3c7848e0eddbad069dca5b6ff8c7ef07
MD5 29765a2c7e7ec05d427ab5cdaf80932f
BLAKE2b-256 c7ddf3b5b5c1e6d584b78486b19d4cb509d226c9b2585c198b230092fb29e012

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.6.0-cp39-cp39-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 9c2d9a4aaec376dd9adf997f73279ad72dc3b26199113b63e1f53583b23295db
MD5 b7553c5857f1443f9798ab8b0d7d3189
BLAKE2b-256 9c1ecda43bce5c7b88bba8e4c344aae8090267a519dedbb9b1078305ae4eaacc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PennyLane_Catalyst-0.6.0-cp39-cp39-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 18aa552b169ed8ec0f743fd0b8e71ed44dd4a77b6a169d403979e2d67bb5d21c
MD5 3f1cbd4690700864d6a27e258ff62c7f
BLAKE2b-256 9e9e847cc68a002311ebc3c080c3234e6fc1cbcb89cf77863f58e4135b1f1ee2

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