Agent skill

Pennylane

by davila7 in davila7/claude-code-templates

Cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry.

MITAuto-check passedResearch & Science

Install Pennylane

skills CLI
$ npx skills add davila7/claude-code-templates --skill pennylane -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install davila7/claude-code-templates pennylane --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .claude/skills && cp -r skills-src/cli-tool/components/skills/scientific/pennylane .claude/skills/pennylane && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
pennylane
GitHub stars
33k
Used in
7 other repos
Token cost
~1.9k tokens
SKILL.md length
471 words
Files
8 (incl. references)
Skills in repo
479
Repo updated
First seen
Licence
MIT

At a glance

Cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry.

  • Works in 6 steps: Quantum Circuit Construction → Quantum Machine Learning → Quantum Chemistry → …
  • Working with quantum circuits
  • SKILL.md covers Overview, Installation, Quick Start and Core Capabilities, plus 4 more sections
  • Calls uv

What it does

Pennylane is an agent skill from davila7/claude-code-templates. Cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Enables building and training quantum circuits with automatic differentiation, seamless integration with PyTorch/JAX/TensorFlow, and device-independent execution across simulators and quantum hardware (IBM, Amazon Braket, Google, Rigetti, IonQ, etc.). Use when working with quantum circuits, variational quantum algorithms (VQE, QAOA), quantum neural networks, hybrid quantum-classical models, molecular simulations…

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including reference files (for example `references/advanced_features.md`, `references/devices_backends.md` and `references/getting_started.md`).

It sits in Research & Science, covering Quantum computing and Deep learning. It works with PyTorch, TensorFlow and Python. The repository describes itself as: CLI tool for configuring and monitoring Claude Code. The licence is MIT.

When your agent uses it

  • Working with quantum circuits
  • Variational quantum algorithms (VQE
  • Quantum neural networks
  • Hybrid quantum-classical models

Example prompts

  • “/pennylane”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Quantum Circuit Construction
  2. Quantum Machine Learning
  3. Quantum Chemistry
  4. Device Management
  5. Optimization
  6. Advanced Features

What it can do on your machine

Read from SKILL.md and the folder at commit 79182c5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • uv

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • pennylane.ai
    • docs.pennylane.ai
    • discuss.pennylane.ai
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Pennylane loads about 1.9k tokens when it runs, and up to ~24k if it reads all its reference files. Until then it costs about 175 tokens; SKILL.md has 471 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~175
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~24k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from davila7/claude-code-templates at commit 79182c5, republished under its MIT licence (© davila7). 471 words, ~1,893 tokens.

Download SKILL.mdSave it as .claude/skills/pennylane/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
pennylane
description
Cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Enables building and training quantum circuits with automatic differentiation, seamless integration with PyTorch/JAX/TensorFlow, and device-independent execution across simulators and quantum hardware (IBM, Amazon Braket, Google, Rigetti, IonQ, etc.). Use when working with quantum circuits, variational quantum algorithms (VQE, QAOA), quantum neural networks, hybrid quantum-classical models, molecular simulations, quantum chemistry calculations, or any quantum computing tasks requiring gradient-based optimization, hardware-agnostic programming, or quantum machine learning workflows.

PennyLane

Overview

PennyLane is a quantum computing library that enables training quantum computers like neural networks. It provides automatic differentiation of quantum circuits, device-independent programming, and seamless integration with classical machine learning frameworks.

Installation

Install using uv:

bash
uv pip install pennylane

For quantum hardware access, install device plugins:

bash
# IBM Quantum
uv pip install pennylane-qiskit

# Amazon Braket
uv pip install amazon-braket-pennylane-plugin

# Google Cirq
uv pip install pennylane-cirq

# Rigetti Forest
uv pip install pennylane-rigetti

# IonQ
uv pip install pennylane-ionq

Quick Start

Build a quantum circuit and optimize its parameters:

python
import pennylane as qml
from pennylane import numpy as np

# Create device
dev = qml.device('default.qubit', wires=2)

# Define 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))

# Optimize parameters
opt = qml.GradientDescentOptimizer(stepsize=0.1)
params = np.array([0.1, 0.2], requires_grad=True)

for i in range(100):
    params = opt.step(circuit, params)

Core Capabilities

1. Quantum Circuit Construction

Build circuits with gates, measurements, and state preparation. See references/quantum_circuits.md for:

  • Single and multi-qubit gates
  • Controlled operations and conditional logic
  • Mid-circuit measurements and adaptive circuits
  • Various measurement types (expectation, probability, samples)
  • Circuit inspection and debugging
2. Quantum Machine Learning

Create hybrid quantum-classical models. See references/quantum_ml.md for:

  • Integration with PyTorch, JAX, TensorFlow
  • Quantum neural networks and variational classifiers
  • Data encoding strategies (angle, amplitude, basis, IQP)
  • Training hybrid models with backpropagation
  • Transfer learning with quantum circuits
3. Quantum Chemistry

Simulate molecules and compute ground state energies. See references/quantum_chemistry.md for:

  • Molecular Hamiltonian generation
  • Variational Quantum Eigensolver (VQE)
  • UCCSD ansatz for chemistry
  • Geometry optimization and dissociation curves
  • Molecular property calculations
4. Device Management

Execute on simulators or quantum hardware. See references/devices_backends.md for:

  • Built-in simulators (default.qubit, lightning.qubit, default.mixed)
  • Hardware plugins (IBM, Amazon Braket, Google, Rigetti, IonQ)
  • Device selection and configuration
  • Performance optimization and caching
  • GPU acceleration and JIT compilation
5. Optimization

Train quantum circuits with various optimizers. See references/optimization.md for:

  • Built-in optimizers (Adam, gradient descent, momentum, RMSProp)
  • Gradient computation methods (backprop, parameter-shift, adjoint)
  • Variational algorithms (VQE, QAOA)
  • Training strategies (learning rate schedules, mini-batches)
  • Handling barren plateaus and local minima
6. Advanced Features

Leverage templates, transforms, and compilation. See references/advanced_features.md for:

  • Circuit templates and layers
  • Transforms and circuit optimization
  • Pulse-level programming
  • Catalyst JIT compilation
  • Noise models and error mitigation
  • Resource estimation

Common Workflows

Train a Variational Classifier
python
# 1. Define ansatz
@qml.qnode(dev)
def classifier(x, weights):
    # Encode data
    qml.AngleEmbedding(x, wires=range(4))

    # Variational layers
    qml.StronglyEntanglingLayers(weights, wires=range(4))

    return qml.expval(qml.PauliZ(0))

# 2. Train
opt = qml.AdamOptimizer(stepsize=0.01)
weights = np.random.random((3, 4, 3))  # 3 layers, 4 wires

for epoch in range(100):
    for x, y in zip(X_train, y_train):
        weights = opt.step(lambda w: (classifier(x, w) - y)**2, weights)
Show full SKILL.md (190 more words)Show less
Run VQE for Molecular Ground State
python
from pennylane import qchem

# 1. Build Hamiltonian
symbols = ['H', 'H']
coords = np.array([0.0, 0.0, 0.0, 0.0, 0.0, 0.74])
H, n_qubits = qchem.molecular_hamiltonian(symbols, coords)

# 2. Define ansatz
@qml.qnode(dev)
def vqe_circuit(params):
    qml.BasisState(qchem.hf_state(2, n_qubits), wires=range(n_qubits))
    qml.UCCSD(params, wires=range(n_qubits))
    return qml.expval(H)

# 3. Optimize
opt = qml.AdamOptimizer(stepsize=0.1)
params = np.zeros(10, requires_grad=True)

for i in range(100):
    params, energy = opt.step_and_cost(vqe_circuit, params)
    print(f"Step {i}: Energy = {energy:.6f} Ha")
Switch Between Devices
python
# Same circuit, different backends
circuit_def = lambda dev: qml.qnode(dev)(circuit_function)

# Test on simulator
dev_sim = qml.device('default.qubit', wires=4)
result_sim = circuit_def(dev_sim)(params)

# Run on quantum hardware
dev_hw = qml.device('qiskit.ibmq', wires=4, backend='ibmq_manila')
result_hw = circuit_def(dev_hw)(params)

Detailed Documentation

For comprehensive coverage of specific topics, consult the reference files:

  • Getting started: references/getting_started.md - Installation, basic concepts, first steps
  • Quantum circuits: references/quantum_circuits.md - Gates, measurements, circuit patterns
  • Quantum ML: references/quantum_ml.md - Hybrid models, framework integration, QNNs
  • Quantum chemistry: references/quantum_chemistry.md - VQE, molecular Hamiltonians, chemistry workflows
  • Devices: references/devices_backends.md - Simulators, hardware plugins, device configuration
  • Optimization: references/optimization.md - Optimizers, gradients, variational algorithms
  • Advanced: references/advanced_features.md - Templates, transforms, JIT compilation, noise

Best Practices

  1. Start with simulators - Test on default.qubit before deploying to hardware
  2. Use parameter-shift for hardware - Backpropagation only works on simulators
  3. Choose appropriate encodings - Match data encoding to problem structure
  4. Initialize carefully - Use small random values to avoid barren plateaus
  5. Monitor gradients - Check for vanishing gradients in deep circuits
  6. Cache devices - Reuse device objects to reduce initialization overhead
  7. Profile circuits - Use qml.specs() to analyze circuit complexity
  8. Test locally - Validate on simulators before submitting to hardware
  9. Use templates - Leverage built-in templates for common circuit patterns
  10. Compile when possible - Use Catalyst JIT for performance-critical code

Resources

© davila7, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (references) in cli-tool/components/skills/scientific/pennylane of davila7/claude-code-templates.

  • SKILL.md
  • references/advanced_features.md
  • references/devices_backends.md
  • references/getting_started.md
  • references/optimization.md
  • references/quantum_chemistry.md
  • references/quantum_circuits.md
  • references/quantum_ml.md

Open the folder on GitHubat commit 79182c5

Used in 7 other repositories

We found 9 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 7 other GitHub owners. This page covers the copy in davila7/claude-code-templates, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Pennylane next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Pennylane compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Pennylane this skilldavila7/claude-code-templates33k7 repos~1.9kAutomated safety check: PassMIT
Running Testsbrendanhasz/probflow175—~657Automated safety check: PassMIT
Formattingbrendanhasz/probflow175—~381Automated safety check: PassMIT
Ray Train Distributed TrainingOrchestra-Research/AI-Research-SKILLs13k2 repos~2.7kAutomated safety check: PassMIT
Technology Selectiondotnet/skills5.6k1 repos~2.1kAutomated safety check: PassMIT
Pixi Environment Builderxuzhougeng/wisp-science1k—~3.7kAutomated safety check: PassAGPL-3.0

Similar skills

  • Running Tests

    brendanhasz/probflow

    Run Python unit test suites strictly using the uv package manager and pytest.

    175 GitHub stars~657 tokensUpdated 14 days ago
    Testing & QAAuto-check passed
  • Formatting

    brendanhasz/probflow

    Ensure consistent code formatting using the uv package manager and pre-commit.

    175 GitHub stars~381 tokensUpdated 14 days ago
    AI & LLM EngineeringAuto-check passed
  • Ray Train Distributed Training

    Orchestra-Research/AI-Research-SKILLs

    Scales PyTorch, TensorFlow and Hugging Face training from a single GPU to multi-node clusters with Ray Train, including Ray Tune sweeps and checkpoint recovery.

    13k GitHub starsUsed in 2 repos~2.7k tokens
    AI & LLM EngineeringAuto-check passed
  • Official

    Guides technology selection and implementation of AI and ML features in .NET 8+ applications using ML.NET, Microsoft.Extensions.AI (MEAI), Microsoft Agent Framework (MAF), GitHub Copilot SDK, ONNX…

    5.6k GitHub starsUsed in 1 repo~2.1k tokens
    AI & LLM EngineeringAuto-check passed
  • Pixi Environment Builder

    xuzhougeng/wisp-science

    A skill your agent uses when creating, migrating, or debugging pixi environments, especially for scientific Python, bioinformatics, single-cell analysis, CUDA/PyTorch, Jupyter/VS Code kernels…

    1k GitHub stars~3.7k tokensUpdated yesterday
    Research & ScienceAuto-check passed
  • Re AI Model

    dslsdzc/rev-skills

    AI 模型文件逆向与静态分析:ONNX/PyTorch/Safetensors/TFLite 格式解析、 网络结构还原、权重提取、文件级水印分析(权重 pattern/metadata/tensor hash/embedding 异常)。

    135 GitHub stars~2.4k tokensUpdated 6 days ago
    AI & LLM EngineeringAuto-check passed

More from davila7/claude-code-templates

All 479 skills in this repo
  • Perplexity Web Search

    davila7/claude-code-templates

    Runs web-grounded searches through Perplexity's Sonar models over OpenRouter for current events, recent literature and cited facts beyond the model's training cutoff.

    33k GitHub starsUsed in 11 repos~3.5k tokens
    Auto-check: notes
  • Neuropixels Data Analysis

    davila7/claude-code-templates

    Analyzes Neuropixels recordings from SpikeGLX or Open Ephys through preprocessing, drift correction, Kilosort4 spike sorting, quality metrics and curation.

    33k GitHub starsUsed in 9 repos~2.8k tokens
    Auto-check passed
  • Scientific Venue Templates

    davila7/claude-code-templates

    Supplies LaTeX templates and formatting rules for journals, conferences, posters, and grant proposals, then can check a draft against them.

    33k GitHub starsUsed in 9 repos~5.1k tokens
    Auto-check: notes
  • Brand Voice Content Creator

    davila7/claude-code-templates

    Analyzes a brand's existing writing to lock in a consistent voice, then builds SEO blog posts and platform-specific social content around it.

    33k GitHub starsUsed in 3 repos~1.9k tokens
    Auto-check passed
  • CAPA Officer

    davila7/claude-code-templates

    Guides corrective and preventive action (CAPA) work in a quality management system, from initiation and root cause analysis through effectiveness verification.

    33k GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed
  • Fda Consultant Specialist

    davila7/claude-code-templates

    Senior FDA consultant and specialist for medical device companies including HIPAA compliance and requirement management.

    33k GitHub starsUsed in 1 repo~2.7k tokens
    Auto-check passed

Questions about Pennylane

What does Pennylane do?

Cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Pennylane is an agent skill from davila7/claude-code-templates. Cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry.

When should I use Pennylane?

Pennylane fits situations like: working with quantum circuits; variational quantum algorithms (VQE; quantum neural networks; hybrid quantum-classical models.

How do I install Pennylane in Claude Code?

Run `npx skills add davila7/claude-code-templates --skill pennylane -a claude-code`. Or copy the skill folder (cli-tool/components/skills/scientific/pennylane in davila7/claude-code-templates) into .claude/skills/pennylane in your project. Claude Code loads it when a task matches its description.

How do I install Pennylane in Codex?

Run `npx skills add davila7/claude-code-templates --skill pennylane -a codex`. Or copy the skill folder (cli-tool/components/skills/scientific/pennylane in davila7/claude-code-templates) into .agents/skills/pennylane in your project. Codex loads it when a task matches its description.

Can I use Pennylane in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add davila7/claude-code-templates --skill pennylane -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pennylane, .gemini/skills/pennylane, .github/skills/pennylane and .opencode/skills/pennylane in your project.

What does Pennylane need to run?

Going by SKILL.md and its folder, Pennylane needs the command-line tools its instructions call (uv). Our summary lists: Python 3.

Does Pennylane access the network?

SKILL.md names 4 domains. As links in the text: pennylane.ai, docs.pennylane.ai, discuss.pennylane.ai and github.com. This is read from the text; nothing was executed.

Is Pennylane safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Pennylane use?

Pennylane is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Pennylane use?

About 1.9k tokens (SKILL.md is roughly 7.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 22k tokens, read only when the agent opens those files.

What are the alternatives to Pennylane?

Skills that share tags, products or a category with Pennylane: Running Tests (brendanhasz/probflow, 175 stars), Formatting (brendanhasz/probflow, 175 stars), Ray Train Distributed Training (Orchestra-Research/AI-Research-SKILLs, 13k stars) and Technology Selection (dotnet/skills, 5.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Pennylane?

davila7 (a GitHub user) maintains it in davila7/claude-code-templates, which has 32,552 GitHub stars. The repository holds 479 skills in this directory. The repository was last updated on October 11, 2026.

Source: davila7/claude-code-templates on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.