PennyLane is a cross-platform Python library for quantum machine learning, automatic differentiation, and optimization of hybrid quantum-classical computations.


  • Follow the gradient. Built-in automatic differentiation of quantum circuits
  • Best of both worlds. Support for hybrid quantum and classical models
  • Batteries included. Provides optimization and machine learning tools
  • Device independent. The same quantum circuit model can be run on different backends
  • Compatible with existing machine learning libraries. Quantum circuits can be set up to interface with either NumPy, PyTorch, or TensorFlow, allowing hybrid CPU-GPU-QPU computations.
  • Large plugin ecosystem. Install plugins to run your computational circuits on more devices, including Strawberry Fields, Rigetti Forest, ProjectQ, and IBM Q

Available plugins

  • PennyLane-SF: Supports integration with Strawberry Fields, a full-stack Python library for simulating continuous variable (CV) quantum optical circuits.
  • PennyLane-Forest: Supports integration with PyQuil, the Rigetti Forest SDK, and the Rigetti QCS, an open-source quantum computation framework by Rigetti. Provides device support for the Quantum Virtual Machine (QVM) and Quantum Processing Units (QPUs) hardware devices.
  • PennyLane-qiskit: Supports integration with Qiskit Terra, an open-source quantum computation framework by IBM. Provides device support for the Qiskit Aer quantum simulators, and IBM QX hardware devices.
  • PennyLane-PQ: Supports integration with ProjectQ, an open-source quantum computation framework that supports the IBM quantum experience.

Getting started

To get PennyLane installed and running on your system, begin at the download and installation guide. Then, familiarize yourself with the PennyLane’s key concepts for machine learning on quantum circuits.

For getting started with PennyLane, check out our basic qubit rotation, and Gaussian transformation tutorials, before continuing on to explore hybrid quantum optimization, and hybrid GPU-QPU optimization via PyTorch. More advanced tutorials include supervised learning, building quantum GANs (QGANs), and quantum classifiers.

Next, play around with the numerous devices and plugins available for running your hybrid models — these include Strawberry Fields, provided by the PennyLane-SF plugin, the Rigetti Aspen-1 QPU, provided by the PennyLane-Forest plugin, and the IBM QX4 quantum chip, provided by the PennyLane-PQ and PennyLane-qiskit plugins.

Finally, detailed documentation on the PennyLane interface and API is provided. Look there for full details on available quantum operations and expectations, and detailed guides on how to write your own PennyLane compatible quantum device.

How to cite

If you are doing research using PennyLane, please cite

Ville Bergholm, Josh Izaac, Maria Schuld, Christian Gogolin, Carsten Blank, Keri McKiernan, and Nathan Killoran. PennyLane: Automatic differentiation of hybrid quantum-classical computations. 2018. arXiv:1811.04968


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 discussion and chat with our PennyLane team.

For more details on contributing or performing research with PennyLane, please see Research and contribution.


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

Indices and tables