PennyLane
A framework for differentiable quantum programming that connects quantum circuits to PyTorch, JAX and TensorFlow and works with many hardware backends and simulators.
Basic information
| Name | PennyLane |
|---|---|
| Full name | PennyLane |
| Category | Quantum Machine Learning |
| Developer | Xanadu (the company) |
| Release year | 2018 |
| Official website | github.com/PennyLaneAI/pennylane |
| GitHub repository | PennyLaneAI/pennylane |
| Official documentation | Not specified |
| Package on PyPI | pennylane |
| License | Apache-2.0 (PyPI license_expression) |
| Project status | Active Had a release in the last 12 months |
| Latest version | 26 June 2026 (version 0.45.1) |
| Programming language | Python |
| Operating systems | Linux, MacOS X, POSIX, Windows (as declared by the package on PyPI) |
| Required Python version | >=3.11 |
| Difficulty level | Medium |
Data last checked: 21 November 2026 — source: PyPI JSON API (2026-11-21)
Overview
In PennyLane the user defines quantum nodes (QNode) that are differentiated automatically, so circuits enter hybrid models and are optimised with classical framework optimizers, with plugins to connect to hardware and simulators from various providers.
It stands out for a rich library of tutorials on quantum machine learning and quantum chemistry.
When to choose it? Choose it for differentiable quantum machine learning with classical frameworks.
Uses
Main uses
- Differentiable variational circuits
- Hybrid quantum-classical models
- Teaching quantum computing
Scientific fields
- Quantum computing
- Quantum chemistry
Suitable project types
- A hybrid quantum classifier with PyTorch
Research applications
- Experiments with variational circuits and the barren plateau problem
Technical features
A feature is shown as "Supported" only if it is documented in the library's official documentation; anything we have not verified is shown as "Not specified".
| CPU support | Supported |
|---|---|
| GPU support | Partial or through an add-onThrough simulators such as lightning.gpu. |
| CUDA compatibility | Partial or through an add-on |
| Distributed training or computing | Not supported |
| Automatic differentiation (Autodiff) | SupportedWith PyTorch, JAX and TensorFlow. |
| Model deployment | Not applicable |
| Pre-trained models | Not applicable |
| Supported data types | Quantum circuits |
| Integration with other libraries | PyTorch, JAX, TensorFlow, Qiskit Machine Learning |
| Flexibility (editorial estimate) | High |
| Performance (editorial estimate) | Depends on the simulator |
| Community (editorial estimate) | Large in the field |
| Documentation quality (editorial estimate) | Excellent tutorials |
Installation and running
pip install pennylaneCompatibility: Python >=3.11 — according to the package data on PyPI, checked on 21 November 2026
Installing inside a virtual environment (venv or conda) is recommended. If you need compatibility with a specific CUDA version or operating system, refer to the official documentation, because this information changes with every release.
Code examples
Examples marked "Run and tested" were actually run, with their output, test date and library versions recorded; the others need a GPU or model downloads, so they were not run in the test environment.
MediumA differentiable variational circuit in PennyLaneRun and tested
Goal: Optimising the parameters of a quantum circuit by gradient.
import pennylane as qml
from pennylane import numpy as np
dev = qml.device("default.qubit", wires=2)
@qml.qnode(dev)
def circuit(w):
qml.RX(w[0], wires=0); qml.RY(w[1], wires=1)
qml.CNOT(wires=[0, 1])
return qml.expval(qml.PauliZ(1))
w = np.array([0.1, 0.2], requires_grad=True)
opt = qml.GradientDescentOptimizer(stepsize=0.4)
print(f"Before: {circuit(w):.4f} | gradient: {np.round(qml.grad(circuit)(w), 4)}")
for _ in range(40):
w = opt.step(circuit, w)
print(f"After 40 steps: {circuit(w):.4f}")
Code explanation
We define a quantum node (QNode) on the default.qubit simulator and compute the expectation value of PauliZ. PennyLane computes the gradient with the parameter-shift rule, and we use an optimizer to drive the expectation value towards -1.
Output recorded during testing
Before: 0.9752 | gradient: [-0.0978 -0.1977] After 40 steps: -1.0000
This example was actually run and tested on 21 November 2026 on a CPU — pennylane 0.45.1, python 3.13.18
Pros
- Automatic differentiation of circuits
- Hardware-independent
- Excellent tutorials
Limitations
- Simulation is expensive for large systems
References and verification
- Package page on PyPI (source of the version, licence and release date) Checked directly
https://pypi.org/project/pennylane/
Checked on: 21 November 2026 — version checked: 0.45.1 — reviewed by: the DLArabic team
- Official website A link the package officially declares on PyPI
https://github.com/PennyLaneAI/pennylane
Checked on: 21 November 2026 — reviewed by: the DLArabic team
- Official repository A link the package officially declares on PyPI
https://github.com/PennyLaneAI/pennylane
Checked on: 21 November 2026 — reviewed by: the DLArabic team
History of verified versions
| Version | Release date | Checked on |
|---|---|---|
| 0.45.1 | 26 June 2026 | 21 November 2026 |
Page information last reviewed: 21 November 2026. The description was written originally for the encyclopedia and is not copied from the official websites.
