pennylane
PennyLane is a cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Train a quantum computer the same way as a neural network.
What it is and what it does
PennyLane is a quantum computing platform that bridges the gap between quantum algorithm research and practical implementation. It provides a Python interface to define quantum circuits, simulate them on classical hardware, and execute them on real quantum devices. The framework treats quantum computing as a differentiable programming problem, allowing you to train quantum circuits like neural networks using automatic differentiation through autograd and autoray.
The package integrates with a broad ecosystem: it depends on scipy, numpy, networkx, and rustworkx for numerical and graph operations; uses pennylane-lightning for high-performance simulation; and supports hardware-agnostic circuit compilation and resource estimation. It's designed for researchers and developers working in quantum machine learning, quantum chemistry, quantum optimization, and general quantum algorithm development, with extensive documentation, tutorials, and a research demo library.
Use it for:
- Build and train variational quantum algorithms for optimization or machine learning tasks using gradient-based methods
- Simulate quantum circuits on classical hardware to prototype algorithms before deploying to real quantum devices
- Develop quantum chemistry simulations to study molecular properties and reactions
- Estimate resource requirements and compile circuits for specific quantum hardware platforms
- Explore quantum machine learning models by treating quantum circuits as differentiable layers in hybrid workflows
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PennyLane is a quantum computing framework that lets you build, simulate, and optimize quantum circuits and algorithms using Python, with support for quantum machine learning, quantum chemistry, and integration with multiple quantum hardware backends.
Yes. PennyLane is actively maintained, has low installation friction, carries no known security vulnerabilities, and is released under a permissive license. It's the right choice if you're doing quantum computing, quantum machine learning, or quantum chemistry work in Python and need a framework that bridges simulation and real hardware. The 15 dependencies are standard scientific packages, and the active community and documentation support make it a solid foundation for quantum research.
Install
pennylane on PyPI
pip
pip install pennylaneuv
uv add pennylanepoetry
poetry add pennylaneInstalling pennylane
Before you install
Low friction installation via pip with a pure-wheel distribution. Active maintenance with a release 49 days ago and ongoing commits. Requires Python 3.11 or above. Brings in 15 runtime dependencies including scipy, numpy, and pennylane-lightning, which is manageable for a scientific package of this scope.
License in practice
Released under Apache License 2.0 (permissive), meaning you can use, modify, and distribute PennyLane freely in both open-source and commercial projects with minimal restrictions—just include a copy of the license.
Quickstart
pip install pennylane
import pennylane as qml
from pennylane import numpy as np
# Create a quantum device
dev = qml.device('default.qubit', wires=2)
# Define a quantum circuit
@qml.qnode(dev)
def circuit(params):
qml.RX(params[0], wires=0)
qml.RY(params[1], wires=1)
qml.CNOT(wires=[0, 1])
return qml.expval(qml.PauliZ(0))
result = circuit([0.1, 0.2])
Requires Python 3.11 or above. For GPU-accelerated simulation, additional setup of pennylane-lightning with GPU support may be needed.
Verify before relying
- Whether pennylane-lightning is automatically installed or requires separate setup for GPU acceleration
- Performance characteristics and simulation limits for circuit depth or qubit count
- Compatibility details with specific quantum hardware providers beyond the generic integration claim
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 15 — scipy, networkx, rustworkx, autograd, appdirs, autoray, cachetools, pennylane-lightning, requests, tomlkit, typing_extensions, packaging, diastatic-malt, numpy, gast |
| Maintenance | actively maintained — 49 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 297,899/month — #7,878 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pennylane-0.45.1-py3-none-any.whl
Tags
More Physics packages
NetworkX provides data structures and…
permissive · top 1,000 on PyPI
sympySymPy is a Python library for symbolic…
permissive · top 1,000 on PyPI
pydicomPydicom reads, modifies, and writes DICOM…
permissive · top 5,000 on PyPI
albumentationsAlbumentations applies image transformations to…
permissive · top 5,000 on PyPI
CoolPropCoolProp provides thermodynamic and transport…
permissive · top 5,000 on PyPI
pyquaternionProvides quaternion representation,…
permissive · top 5,000 on PyPI
pennylane-lightningPennyLane-Lightning provides high-performance…
permissive · top 15,000 on PyPI
cirqCirq is a Python framework for writing,…
permissive · top 15,000 on PyPI
cirq-coreCirq-core provides the foundational framework…
permissive · top 15,000 on PyPI
pytketPytket is a Python interface to TKET, a quantum…
permissive · top 15,000 on PyPI
qiskitQiskit is an open-source SDK for building and…
permissive · top 5,000 on PyPI
openfermionOpenFermion compiles and analyzes quantum…
permissive · top 15,000 on PyPI
cirq-pasqalCirq-Pasqal is a Cirq integration module that…
permissive · top 15,000 on PyPI
cirq-webProvides browser-based 3D visualization tools…
permissive · top 15,000 on PyPI
openfermionpyscfBridges OpenFermion quantum algorithm library…
permissive · top 15,000 on PyPI
pyscfPySCF is a Python framework for quantum…
permissive · top 15,000 on PyPI