pennylane

Build and differentiate hybrid quantum-classical circuits using the PennyLane framework.

18|3|Updated Aug 14, 2026
One-click install
npx skills add https://github.com/unitarylab/quantum-practices --skill pennylane-unitarylab
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: pennylane
Source: https://github.com/unitarylab/quantum-practices/tree/main/simulators/pennylane
Command: npx skills add https://github.com/unitarylab/quantum-practices --skill pennylane-unitarylab

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pennylane.

What problem does it solve? Developing variational quantum algorithms and quantum machine learning models requires a framework that unifies circuit construction, automatic differentiation, and classical ML integration, which is difficult to assemble from low-level tools. ## Core Features & Use Cases - Differentiable Quantum Circuits: Define QNodes on simulators like default.qubit and compute gradients via parameter-shift, backpropagation, or finite-difference methods. - Hybrid ML Integration: Embed quantum layers inside PyTorch, TensorFlow, or JAX models for end-to-end training of quantum neural networks. - Variational Algorithm Support: Implement VQE, QAOA, and QNN workflows with built-in circuit templates and flexible parameter management. - Use Case: A researcher prototyping a variational quantum eigensolver can define a parameterized ansatz, compute expectation values of a Hamiltonian, and optimize parameters with gradient descent, all within one PennyLane workflow. ## Quick Start Ask the AI to write a PennyLane circuit that creates a two-qubit QNode on default.qubit, applies an RY rotation and CNOT, and returns the expectation value and its gradient.

Frequently Asked Questions about pennylane

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a quantum circuit in PennyLane?▼

Create a device with qml.device, such as default.qubit with a wire count, then decorate a Python function with @qml.qnode to define the circuit. Inside the function, apply operations like qml.RY and qml.CNOT and return a measurement such as qml.expval.

How do I compute gradients of a quantum circuit in PennyLane?▼

Use qml.grad on a QNode to obtain its gradient function, which supports parameter-shift, backpropagation, and finite-difference methods. This enables end-to-end optimization of variational circuits with standard optimizers.

PennyLane vs Qiskit for quantum machine learning?▼

PennyLane focuses on hybrid quantum-classical machine learning with native automatic differentiation and integration with PyTorch, TensorFlow, and JAX. Qiskit centers on circuit construction and IBM hardware access, making PennyLane the typical choice for gradient-based QML research.

Does PennyLane work with PyTorch and TensorFlow?▼

Yes, PennyLane integrates with PyTorch, TensorFlow, and JAX, allowing quantum layers to be embedded inside classical neural networks. Install the desired ML backend alongside pennylane and train hybrid models with standard frameworks.

What Python version does PennyLane require?▼

PennyLane requires Python 3.9 or higher and runs on Windows, macOS, and Linux. Install it with pip install pennylane, optionally adding torch, tensorflow, or jax for hybrid workflows.

When is PennyLane not the right simulator choice?▼

PennyLane is optimized for variational and machine learning workflows rather than large-scale statevector benchmarking or hardware-specific pulse control. For those scenarios, frameworks focused on high-performance simulation or direct hardware access may fit better.