Catalyst

Catalyst: a Python JIT compiler for auto-differentiable hybrid quantum programs - Published in JOSS (2024)

https://github.com/pennylaneai/catalyst

Science Score: 100.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 7 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org
  • Committers with academic emails
    2 of 52 committers (3.8%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

autodiff automatic-differentiation jax jit llvm mlir pennylane python qir quantum quantum-compiler quantum-computing

Keywords from Contributors

matrix standardization graphs physics meshing combinatorics algorithm pde interpretability parallel
Last synced: 4 months ago · JSON representation ·

Repository

A JIT compiler for hybrid quantum programs in PennyLane

Basic Info
Statistics
  • Stars: 181
  • Watchers: 15
  • Forks: 55
  • Open Issues: 200
  • Releases: 22
Topics
autodiff automatic-differentiation jax jit llvm mlir pennylane python qir quantum quantum-compiler quantum-computing
Created almost 3 years ago · Last pushed 4 months ago
Metadata Files
Readme Contributing License Code of conduct Citation

README.md

Tests Coverage Documentation DOI PyPI Forum License

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:

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.

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:

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, aarch64) and macOS (arm64) platforms, and pre-built binaries are being distributed via the Python Package Index (PyPI) for Python versions 3.11 and higher. To install it, simply run the following pip command:

console pip install pennylane-catalyst

Catalyst no longer supports macOS with x86_64 architecture after 0.11.0. This includes Macs running on Intel processors. If you would like to use Catalyst on these systems, please install Catalyst version 0.11.0, PennyLane version 0.41.0, PennyLane-Lightning version 0.41.0, and Jax version 0.4.28:

console pip install pennylane-catalyst==0.11.0 pip install pennylane==0.41.0 pip install pennylane-lightning==0.41.0 pip install jax==0.4.28

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

  • Source Code: https://github.com/PennyLaneAI/catalyst
  • Issue Tracker: https://github.com/PennyLaneAI/catalyst/issues

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 paper:

bibtex @article{ Ittah2024, doi = {10.21105/joss.06720}, url = {https://doi.org/10.21105/joss.06720}, year = {2024}, publisher = {The Open Journal}, volume = {9}, number = {99}, pages = {6720}, author = {David Ittah and Ali Asadi and Erick Ochoa Lopez and Sergei Mironov and Samuel Banning and Romain Moyard and Mai Jacob Peng and Josh Izaac}, title = {Catalyst: a Python JIT compiler for auto-differentiable hybrid quantum programs}, journal = {Journal of Open Source Software} }

License

Catalyst is free and open source, released under the Apache License, Version 2.0.

Acknowledgements

Catalyst makes use of the following libraries and tools, which are under their own respective licenses:

Owner

  • Name: PennyLaneAI
  • Login: PennyLaneAI
  • Kind: organization

PennyLane is a cross-platform Python library for differentiable programming of quantum computers. Train a quantum computer the same way as a neural network.

JOSS Publication

Catalyst: a Python JIT compiler for auto-differentiable hybrid quantum programs
Published
July 09, 2024
Volume 9, Issue 99, Page 6720
Authors
David Ittah ORCID
Xanadu, Toronto, ON, M5G 2C8, Canada
Ali Asadi
Xanadu, Toronto, ON, M5G 2C8, Canada
Erick Ochoa Lopez
Xanadu, Toronto, ON, M5G 2C8, Canada
Sergei Mironov
Xanadu, Toronto, ON, M5G 2C8, Canada
Samuel Banning
Xanadu, Toronto, ON, M5G 2C8, Canada
Romain Moyard ORCID
Xanadu, Toronto, ON, M5G 2C8, Canada
Mai Jacob Peng ORCID
Xanadu, Toronto, ON, M5G 2C8, Canada
Josh Izaac ORCID
Xanadu, Toronto, ON, M5G 2C8, Canada
Editor
Daniel S. Katz ORCID
Tags
quantum computing machine learning automatic differentiation GPU high-performance computing JAX

Citation (CITATION.cff)

cff-version: "1.2.0"
authors:
- family-names: Ittah
  given-names: David
  orcid: "https://orcid.org/0000-0003-0975-6448"
- family-names: Asadi
  given-names: Ali
- family-names: Ochoa Lopez
  given-names: Erick
- family-names: Mironov
  given-names: Sergei
- family-names: Banning
  given-names: Samuel
- family-names: Moyard
  given-names: Romain
  orcid: "https://orcid.org/0000-0003-0837-6451"
- family-names: Peng
  given-names: Mai Jacob
  orcid: "https://orcid.org/0000-0002-2377-264X"
- family-names: Izaac
  given-names: Josh
  orcid: "https://orcid.org/0000-0003-2640-0734"
contact:
- family-names: Izaac
  given-names: Josh
  orcid: "https://orcid.org/0000-0003-2640-0734"
doi: 10.5281/zenodo.12696447
message: If you use this software, please cite our article in the
  Journal of Open Source Software.
preferred-citation:
  authors:
  - family-names: Ittah
    given-names: David
    orcid: "https://orcid.org/0000-0003-0975-6448"
  - family-names: Asadi
    given-names: Ali
  - family-names: Ochoa Lopez
    given-names: Erick
  - family-names: Mironov
    given-names: Sergei
  - family-names: Banning
    given-names: Samuel
  - family-names: Moyard
    given-names: Romain
    orcid: "https://orcid.org/0000-0003-0837-6451"
  - family-names: Peng
    given-names: Mai Jacob
    orcid: "https://orcid.org/0000-0002-2377-264X"
  - family-names: Izaac
    given-names: Josh
    orcid: "https://orcid.org/0000-0003-2640-0734"
  date-published: 2024-07-09
  doi: 10.21105/joss.06720
  issn: 2475-9066
  issue: 99
  journal: Journal of Open Source Software
  publisher:
    name: Open Journals
  start: 6720
  title: "Catalyst: a Python JIT compiler for auto-differentiable hybrid
    quantum programs"
  type: article
  url: "https://joss.theoj.org/papers/10.21105/joss.06720"
  volume: 9
title: "Catalyst: a Python JIT compiler for auto-differentiable hybrid
  quantum programs"

GitHub Events

Total
  • Create event: 553
  • Release event: 4
  • Issues event: 169
  • Watch event: 44
  • Delete event: 470
  • Member event: 3
  • Issue comment event: 1,703
  • Push event: 4,619
  • Pull request review event: 4,014
  • Pull request review comment event: 3,926
  • Pull request event: 1,044
  • Fork event: 26
Last Year
  • Create event: 554
  • Release event: 4
  • Issues event: 169
  • Watch event: 44
  • Delete event: 471
  • Member event: 3
  • Issue comment event: 1,703
  • Push event: 4,626
  • Pull request review event: 4,022
  • Pull request review comment event: 3,935
  • Pull request event: 1,044
  • Fork event: 26

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 1,414
  • Total Committers: 52
  • Avg Commits per committer: 27.192
  • Development Distribution Score (DDS): 0.813
Past Year
  • Commits: 802
  • Committers: 40
  • Avg Commits per committer: 20.05
  • Development Distribution Score (DDS): 0.672
Top Committers
Name Email Commits
ringo-but-quantum g****m@x****i 265
erick-xanadu 1****u 227
David Ittah d****0 186
paul0403 7****3 105
Ali Asadi a****i@x****i 99
Romain Moyard r****d@g****m 85
Raul Torres 1****c 74
Mehrdad Malek 3****m 54
Joey Carter j****r@x****i 54
Sergei Mironov s****v@x****i 45
Josh Izaac j****6@g****m 29
github-actions[bot] 4****] 19
lillian542 3****2 19
Sengthai Heng s****7@g****m 18
Jacob Mai Peng j****g@g****m 14
Christina Lee c****l@g****m 13
Tzung-Han Juang t****g@x****i 9
Rashid N H M 9****m 8
Andrija Paurevic 4****u 7
Tzung-Han Juang 1****g 7
Yushao Chen (Jerry) c****3@o****m 7
Vincent Michaud-Rioux v****x@x****i 6
Ritu Thombre 4****9 6
HSZheng m****3@g****m 6
runora95 5****5 4
Will w****0@g****m 4
Mudit Pandey m****y@x****i 4
Lee James O'Riordan m****d 4
dependabot[bot] 4****] 3
Isaac De Vlugt 3****t 3
and 22 more...
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 338
  • Total pull requests: 2,201
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 10 days
  • Total issue authors: 47
  • Total pull request authors: 64
  • Average comments per issue: 1.61
  • Average comments per pull request: 2.15
  • Merged pull requests: 1,569
  • Bot issues: 0
  • Bot pull requests: 66
Past Year
  • Issues: 140
  • Pull requests: 1,265
  • Average time to close issues: 18 days
  • Average time to close pull requests: 7 days
  • Issue authors: 30
  • Pull request authors: 44
  • Average comments per issue: 1.36
  • Average comments per pull request: 2.03
  • Merged pull requests: 872
  • Bot issues: 0
  • Bot pull requests: 52
Top Authors
Issue Authors
  • erick-xanadu (86)
  • dime10 (46)
  • paul0403 (35)
  • josh146 (33)
  • joeycarter (16)
  • grwlf (10)
  • mehrdad2m (9)
  • isaacdevlugt (8)
  • yorgossot (7)
  • glassnotes (7)
  • sengthai (7)
  • maliasadi (6)
  • rmoyard (5)
  • tzunghanjuang (4)
  • mlxd (4)
Pull Request Authors
  • erick-xanadu (446)
  • paul0403 (278)
  • dime10 (255)
  • rauletorresc (178)
  • mehrdad2m (146)
  • joeycarter (125)
  • rmoyard (124)
  • maliasadi (103)
  • github-actions[bot] (60)
  • grwlf (48)
  • josh146 (47)
  • sengthai (43)
  • tzunghanjuang (39)
  • lillian542 (30)
  • albi3ro (29)
Top Labels
Issue Labels
bug (109) enhancement (47) good first issue (31) frontend (14) upstream (9) chore (9) housecleaning (9) compiler (8) documentation (7) dependencies (4) docs (3) CI (3) wontfix (2) runtime (2) duplicate (1) question (1) author:build-wheels (1)
Pull Request Labels
author:build-wheels (151) frontend (121) do-not-merge (70) ci:build-wheels (70) bug (63) urgent (59) reviewer:require-wheels (44) compiler (38) runtime (34) housecleaning (32) CI (29) OQD (25) documentation (18) docs (14) requires-wheel-builds (14) plxpr (10) enhancement (10) external (8) good first issue (7) dependencies (6) review ready (5) seed-CI (4) wip (3) upstream (2)

Packages

  • Total packages: 3
  • Total downloads:
    • pypi 18,311 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 63
  • Total maintainers: 2
proxy.golang.org: github.com/pennylaneai/catalyst
  • Versions: 22
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 6.4%
Average: 6.7%
Dependent repos count: 6.9%
Last synced: 4 months ago
proxy.golang.org: github.com/PennyLaneAI/catalyst
  • Versions: 22
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 6.4%
Average: 6.7%
Dependent repos count: 6.9%
Last synced: 4 months ago
pypi.org: pennylane-catalyst

A JIT compiler for hybrid quantum programs in PennyLane

  • Versions: 19
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 18,311 Last month
Rankings
Dependent packages count: 6.6%
Stargazers count: 13.6%
Downloads: 16.6%
Average: 19.6%
Forks count: 30.5%
Dependent repos count: 30.6%
Maintainers (2)
Last synced: 4 months ago