Trains and differentiates quantum circuits with PennyLane, supporting parameter-shift, backprop, and adjoint gradients. Use for hybrid quantum-classical models, quantum neural networks, VQE, QAOA, and quantum chemistry on built-in simulators.
Ships in alterlab-domain-specific. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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.
Keyless by default. The core of this skill — defining, differentiating, and training circuits on the built-in simulators (default.qubit, lightning.qubit, default.mixed), hybrid quantum-classical models, VQE/QAOA, and quantum chemistry — runs entirely offline with no account or token. Executing a trained circuit on a remote QPU (IBM, IonQ, Rigetti) is an optional add-on that uses the provider's own credentials; with no hardware token, develop and validate on the simulator first (PennyLane's device-agnostic design makes the later swap a one-line change).
Use this skill when the user wants to:
qml.qnn.TorchLayer) or JAXqml.qchem)| Scenario | Use Instead |
|---|---|
| IBM-specific transpilation, Runtime sessions/batches, or error-mitigation options | alterlab-qiskit |
| Google Quantum AI hardware, Cirq-native circuits, or XEB/RB characterization | alterlab-cirq |
| Lindblad master equations, decoherence, or cavity-QED dynamics | alterlab-qutip |
| Classical deep learning with no quantum circuit | alterlab-pytorch-lightning |
Hand-off rule. When the request matches a row above, open your answer by naming that skill by its exact id (for example alterlab-qiskit) and saying in one line why it fits better, then stop applying this skill's procedure. Name it even when you also need to ask for missing input. If only part of the request is out of scope, name the skill for that part and do only the in-scope part. A brief general pointer is fine; the named skill does the work.
Run install-free with one uv run command — no virtualenv or uv pip install step
(PennyLane ≥ 0.43; current 0.45.1 as of 2026-10 needs Python ≥ 3.11, and uv's default here
can be 3.9, so pin the interpreter). The simulators, autodiff and qml.qchem (built-in
differentiable Hartree-Fock, no PySCF needed for molecular_hamiltonian) all come with it:
uv run --python ">=3.11" --with pennylane python your_script.py
For quantum hardware access, install device plugins (persistently, inside an activated
virtualenv, or add each with another --with):
# IBM Quantum (0.45 pins qiskit<=2.3 and qiskit-ibm-runtime~=0.45 — use its own env
# if you also run the latest Qiskit directly)
uv pip install pennylane-qiskit
# Amazon Braket (IonQ, IQM, Rigetti, AQT QPUs and managed simulators)
uv pip install amazon-braket-pennylane-plugin
# Cirq simulators
uv pip install pennylane-cirq
# IonQ
uv pip install pennylane-ionq
pennylane-rigetti is unmaintained (pins pyquil<4, networkx<3); reach Rigetti QPUs
through Amazon Braket instead.
Version notes (v0.42–0.45): TensorFlow is gone (qml.qnn.KerasLayer removed in
v0.42, the tf interface dropped in v0.44), and shots belong on the QNode —
@qml.qnode(dev, shots=1000) or qml.set_shots(qnode, shots=...) — because
qml.device(..., shots=...) and call-time circuit(x, shots=...) are deprecated
since v0.43.
Build a quantum circuit and optimize its parameters:
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)
New to PennyLane? See references/getting_started.md for installation, QNodes,
devices, gradients, and a first optimization loop.
Build circuits with gates, measurements, and state preparation. See references/quantum_circuits.md for:
Create hybrid quantum-classical models. See references/quantum_ml.md for:
Simulate molecules and compute ground state energies. See references/quantum_chemistry.md for:
Execute on simulators or quantum hardware. See references/devices_backends.md for:
Train quantum circuits with various optimizers. See references/optimization.md for:
Leverage templates, transforms, and compilation. See references/advanced_features.md for:
# 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)
from pennylane import qchem
# 1. Build Hamiltonian (returns the qubit Hamiltonian and qubit count).
# Coordinates default to Bohr — state the unit, or H2 at "0.74" is badly compressed.
symbols = ['H', 'H']
coords = np.array([0.0, 0.0, 0.0, 0.0, 0.0, 0.74]) # Å
mol = qchem.Molecule(symbols, coords, unit="angstrom")
H, n_qubits = qchem.molecular_hamiltonian(mol)
# 2. Set up UCCSD ansatz from the excitations
hf_state = qchem.hf_state(electrons=2, orbitals=n_qubits)
singles, doubles = qchem.excitations(electrons=2, orbitals=n_qubits)
s_wires, d_wires = qchem.excitations_to_wires(singles, doubles)
dev = qml.device('default.qubit', wires=n_qubits)
@qml.qnode(dev)
def vqe_circuit(params):
qml.UCCSD(params, wires=range(n_qubits),
s_wires=s_wires, d_wires=d_wires, init_state=hf_state)
return qml.expval(H)
# 3. Optimize (one parameter per excitation)
opt = qml.AdamOptimizer(stepsize=0.1)
params = np.zeros(len(singles) + len(doubles), 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")
# Define the circuit body once, bind it to a device on demand.
def circuit_body(params):
qml.AngleEmbedding(params, wires=range(4))
return qml.expval(qml.PauliZ(0))
def make_qnode(dev, shots=None):
return qml.qnode(dev, shots=shots)(circuit_body)
# Test on simulator
dev_sim = qml.device('default.qubit', wires=4)
result_sim = make_qnode(dev_sim)(params)
# Run on quantum hardware (IBM, via Qiskit Runtime)
from qiskit_ibm_runtime import QiskitRuntimeService
service = QiskitRuntimeService(channel='ibm_quantum_platform') # requires saved IBM Cloud credentials
backend = service.least_busy(operational=True, simulator=False)
dev_hw = qml.device('qiskit.remote', wires=4, backend=backend)
# Hardware needs finite shots; for gradients use diff_method='parameter-shift'.
result_hw = make_qnode(dev_hw, shots=1024)(params)
default.qubit before deploying to hardware@qml.qnode(dev, shots=N) or qml.set_shots; device-level shots are deprecatedqml.specs() to analyze circuit complexityPart of the AlterLab Academic Skills suite.
evals/evals.json (opens in a new tab)references/advanced_features.md (opens in a new tab)references/devices_backends.md (opens in a new tab)references/getting_started.md (opens in a new tab)references/optimization.md (opens in a new tab)references/quantum_chemistry.md (opens in a new tab)references/quantum_circuits.md (opens in a new tab)references/quantum_ml.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
18 skills in this plugin
/alterlab-adaptyvPrepares and validates Adaptyv Bio Foundry protein-testing submissions with no account — optimizes and pre-screens sequences locally (NetSolP/SoluProt heuristics, SolubleMPNN, ESM), assembles the experiment payload, and validates it offline against the Foundry's own type/method/sequence rules so it is ready and correct before it costs anything. Submitting to the Foundry, browsing the target catalog, tracking status and retrieving results run through the Foundry API with the user's own ADAPTYV_API_KEY (experiments cost money and take weeks). Use when designing proteins for wet-lab validation (binding/affinity, expression, thermostability, fluorescence), preparing or validating a Foundry submission, pre-screening sequences, or tracking an Adaptyv experiment. Triggers on "Adaptyv", "Foundry API", "cloud lab", "biolayer interferometry / BLI", "wet-lab validation". Part of the AlterLab Academic Skills suite./alterlab-aeonRuns time series machine learning with the aeon library — classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search via scikit-learn compatible APIs. Use when working with temporal data, sequential patterns, or time-indexed observations (univariate or multivariate) that need specialized algorithms beyond standard ML approaches. Part of the AlterLab Academic Skills suite./alterlab-astropyProcesses astronomy and astrophysics data with the Astropy Python library — celestial coordinates, physical units, FITS files, cosmological calculations, time systems, tables, and world coordinate systems (WCS). Use when tasks involve coordinate transformations, unit conversions, FITS file manipulation, cosmological distance calculations, time scale conversions, or general astronomical data analysis. Part of the AlterLab Academic Skills suite./alterlab-cirqBuilds, simulates, and runs quantum circuits with Cirq, Google Quantum AI's framework for NISQ hardware, noise-aware low-level circuit design, and noise characterization. Use when targeting Google Quantum AI processors or their Quantum Virtual Machine models (Willow, Sycamore-class Rainbow/Weber), IonQ/AQT/Pasqal via Cirq plugins, designing noise-aware NISQ circuits, or running characterization experiments (randomized benchmarking, XEB). For IBM Quantum hardware and Qiskit Runtime prefer alterlab-qiskit; for gradient-trained quantum ML and hybrid quantum-classical models prefer alterlab-pennylane; for open-system Lindblad/master-equation dynamics prefer alterlab-qutip. Part of the AlterLab Academic Skills suite./alterlab-digital-humanitiesApplies computational methods to humanities research — text mining and NLP (LDA/BERTopic topic modeling, sentiment, named entity recognition with spaCy/NLTK), corpus linguistics (concordance, collocation, keyness), digital archives (Dublin Core, TEI XML), GIS for history, network analysis, stylometry and authorship attribution, OCR (Tesseract, Kraken, Transkribus), and data visualization (Gephi, Palladio). Use when distant-reading a literary corpus, mapping historical events or trade networks, attributing disputed authorship, digitizing historical documents, or building digital scholarly editions. Part of the AlterLab Academic Skills suite./alterlab-fluidsimRuns computational fluid dynamics simulations with the FluidSim Python framework using pseudospectral FFT methods, with HPC support and output analysis. Use when simulating Navier-Stokes equations (2D/3D), shallow water equations, or stratified flows, or when analyzing turbulence, vortex dynamics, or geophysical flows. Part of the AlterLab Academic Skills suite./alterlab-domain-specific:alterlab-pennylanefrom alterlab-domain-specific
npx claudepluginhub alterlab-ieu/alterlab-academic-skills --plugin alterlab-domain-specific2 plugins in one repository ship this exact skill · first indexed Nov 9, 2026
Other plugins' skills for the same job