Skip to content

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

License

Notifications You must be signed in to change notification settings

johannesjmeyer/pennylane

 
 

Repository files navigation

Announcing PennyLane: Code Together! Join us on GitHub August 16th-27th, see event FAQ here.


PennyLane is a cross-platform Python library for differentiable programming of quantum computers.

Train a quantum computer the same way as a neural network.

Key Features

  • Machine learning on quantum hardware. Connect to quantum hardware using PyTorch, TensorFlow, JAX, Keras, or NumPy. Build rich and flexible hybrid quantum-classical models.

  • Device independent. Run the same quantum circuit on different quantum backends. Install plugins to access even more devices, including Strawberry Fields, Amazon Braket, IBM Q, Google Cirq, Rigetti Forest, Qulacs, Pasqal, Honeywell, and more.

  • Follow the gradient. Hardware-friendly automatic differentiation of quantum circuits.

  • Batteries included. Built-in tools for quantum machine learning, optimization, and quantum chemistry. Rapidly prototype using built-in quantum simulators with backpropagation support.

Installation

PennyLane requires Python version 3.7 and above. Installation of PennyLane, as well as all dependencies, can be done using pip:

python -m pip install pennylane

Getting started

For an introduction to quantum machine learning, guides and resources are available on PennyLane's quantum machine learning hub:

You can also check out our documentation for quickstart guides to using PennyLane, and detailed developer guides on how to write your own PennyLane-compatible quantum device.

Tutorials and demonstrations

Take a deeper dive into quantum machine learning by exploring cutting-edge algorithms on our demonstrations page.

All demonstrations are fully executable, and can be downloaded as Jupyter notebooks and Python scripts.

If you would like to contribute your own demo, see our demo submission guide.

Build a PennyLane Docker image

Docker support exists for building using CPU and GPU (Nvidia CUDA 11.1+) images.

Note: Docker builds using "make" will work on Linux and MacOS only. For MS Windows you can use WSL. They are currently not supported on the Apple M1 chip (ARM64).

Build a basic PennyLane image

  • To build a basic PennyLane image without any additional interfaces (Torch, TensorFlow, or Jax) or plugins (qiskit, amazon-braket, cirq, forest), run the following:
make -f docker/Makefile build-base

Build a PennyLane image with a specific interface

  • To build a PennyLane image using a specific interface (Torch, TensorFlow or Jax), run the following:
make -f docker/Makefile build-interface interface-name=tensorflow
  • To build a PennyLane image using a specific interface (Torch, TensorFlow or Jax) with GPU support, run the following:
make -f docker/Makefile build-interface-gpu interface-name=tensorflow

Build a PennyLane image with a plugin

  • To build a PennyLane image using a specific plugin (qiskit, amazon-braket, cirq, forest, etc), run the following:
make -f docker/Makefile build-plugin plugin-name=qiskit

Build a PennyLane-Qchem image

  • You can also build an image with the PennyLane Qchem package and its dependencies. Use the following commands:
make -f docker/Makefile build-qchem
  • To check all available interfaces, run the following:

make -f docker/Makefile available-interfaces
  • To check all available plugins, run the following:

make -f docker/Makefile available-plugins

Contributing to PennyLane

We welcome contributions—simply fork the PennyLane repository, and then make a pull request containing your contribution. All contributors to PennyLane will be listed as authors on the releases. All users who contribute significantly to the code (new plugins, new functionality, etc.) will be listed on the PennyLane arXiv paper.

We also encourage bug reports, suggestions for new features and enhancements, and even links to cool projects or applications built on PennyLane.

See our contributions page and our developer hub for more details.

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

PennyLane is the work of many contributors.

If you are doing research using PennyLane, please cite our paper:

Ville Bergholm, Josh Izaac, Maria Schuld, Christian Gogolin, M. Sohaib Alam, Shahnawaz Ahmed, Juan Miguel Arrazola, Carsten Blank, Alain Delgado, Soran Jahangiri, Keri McKiernan, Johannes Jakob Meyer, Zeyue Niu, Antal Száva, and Nathan Killoran. PennyLane: Automatic differentiation of hybrid quantum-classical computations. 2018. arXiv:1811.04968

License

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

About

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

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.6%
  • Other 0.4%