Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsJul 26, 2026·3 min de lecture

PennyLane — Quantum Machine Learning Framework

An open-source library for quantum machine learning, quantum chemistry, and quantum computing that supports automatic differentiation across quantum and classical computations.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
PennyLane Overview
Commande d'installation directe
npx -y tokrepo@latest install 09ea01fd-888c-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en dry-run.

Introduction

PennyLane is a Python library for quantum machine learning and quantum computing that bridges quantum circuits with classical ML frameworks. It enables automatic differentiation of quantum computations, allowing researchers to train variational quantum algorithms using gradient-based optimization with PyTorch, TensorFlow, or JAX.

What PennyLane Does

  • Defines parameterized quantum circuits as differentiable computational graphs
  • Computes gradients of quantum circuits using parameter-shift rules and backpropagation
  • Integrates with PyTorch, TensorFlow, JAX, and NumPy for hybrid quantum-classical workflows
  • Runs circuits on simulators and real hardware from IBM, Amazon Braket, IonQ, and others
  • Provides built-in templates for common variational circuits and quantum chemistry methods

Architecture Overview

PennyLane uses QNodes as its core abstraction: a quantum circuit bound to a device that acts as a differentiable function. The autograd engine applies quantum-specific differentiation methods (parameter-shift or backprop). Device plugins connect QNodes to simulators or hardware backends.

Self-Hosting & Configuration

  • Install via pip: pip install pennylane (pure Python, no compilation needed)
  • Add hardware plugins: pip install pennylane-qiskit, pennylane-braket, etc.
  • Default simulator (default.qubit) works immediately with no setup
  • Configure devices by specifying backend name, wire count, and shot count
  • Use pennylane.about() to verify installed plugins and versions

Key Features

  • Automatic differentiation of quantum circuits with multiple gradient methods
  • Hardware-agnostic design supporting 20+ quantum devices and simulators
  • Native integration with PyTorch, TensorFlow, JAX, and Autograd
  • Built-in circuit templates for VQE, QAOA, and quantum neural networks
  • Quantum chemistry module for molecular simulation and ground-state energy estimation

Comparison with Similar Tools

  • Cirq — Lower-level circuit framework; PennyLane adds autodiff and ML framework integration
  • Qiskit — Broader quantum SDK; PennyLane specializes in differentiable quantum computing
  • TensorFlow Quantum — TF-only; PennyLane supports PyTorch, JAX, and TF equally
  • Amazon Braket SDK — AWS-focused hardware access; PennyLane is backend-agnostic with a plugin system

FAQ

Q: Can PennyLane run on real quantum hardware? A: Yes. Through plugins it connects to IBM Quantum, Amazon Braket, IonQ, Rigetti, and other providers.

Q: How does PennyLane compute gradients of quantum circuits? A: It uses the parameter-shift rule by default. Simulators can also use backpropagation for faster training.

Q: Is PennyLane only for machine learning? A: No. It supports quantum chemistry (VQE, molecular simulation) and general variational algorithms beyond ML.

Q: What classical ML frameworks does PennyLane integrate with? A: PyTorch, TensorFlow, JAX, and NumPy/Autograd, allowing hybrid models that mix quantum and classical layers.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires