adaptyv
How to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user…
Hardware-agnostic quantum ML framework with automatic differentiation. Use when training quantum circuits via gradients, building hybrid quantum-classical models, or needing device portability across IBM/Google/Rigetti/IonQ. Best for variational algorithms (VQE, QAOA), quantum
$ npx -y skills add k-dense-ai/claude-scientific-skills --skill pennylane --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/pennylaneContext preview
The summary Claude sees to decide when to auto-load this skill.
Hardware-agnostic quantum ML framework with automatic differentiation. Use when training quantum circuits via gradients, building hybrid quantum-classical models, or needing device portability across IBM/Google/Rigetti/IonQ. Best for variational algorithms (VQE, QAOA), quantum
name: pennylane description: Hardware-agnostic quantum ML framework with automatic differentiation. Use when training quantum circuits via gradients, building hybrid quantum-classical models, or needing device portability across IBM/Google/Rigetti/IonQ. Best for variational algorithms (VQE, QAOA), quantum neural networks, and integration with PyTorch or JAX. For hardware-specific optimizations use qiskit (IBM) or cirq (Google); for open quantum systems use qutip. license: Apache-2.0 license allowed-tools: Read Bash Python metadata: version: "1.2" skill-author: K-Dense Inc.
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.
PennyLane 0.45.0 requires Python 3.11 or newer. Install using uv with pinned versions for reproducible environments:
uv pip install "pennylane==0.45.0"
For quantum hardware access, install the plugin matching the target provider. Start from a clean environment when adding or upgrading Qiskit because its dependency graph is strict.
# IBM Quantum uv pip install "pennylane-qiskit==0.45.0" # Amazon Braket uv pip install "amazon-braket-pennylane-plugin==1.34.1" # Google Cirq uv pip install "pennylane-cirq==0.44.0" # Rigetti Forest uv pip install "pennylane-rigetti==0.40.0" # IonQ uv pip install "pennylane-ionq==0.45.0" # High-performance local simulators uv pip install "pennylane-lightning==0.45.0" # Catalyst JIT compilation uv pip install "pennylane-catalyst==0.15.0"
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)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
symbols = ['H', 'H']
geometry = np.array([[0.0, 0.0, -0.66140414], [0.0, 0.0, 0.66140414]])
molecule = qchem.Molecule(symbols, geometry)
H, n_qubits = qchem.molecular_hamiltonian(molecule)
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)
# 2. Define ansatz
@qml.qnode(dev)
def vqe_circuit(params):
qml.BasisState(hf_state, wires=range(n_qubits))
qml.UCCSD(params, wires=range(n_qubits), s_wires=s_wires, d_wires=d_wires)
return qml.expval(H)
# 3. Optimize
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")# Same circuit, different backends circuit_def = lambda dev: qml.qnod
🔔 Claude Scientific Skills is now Scientific Agent Skills. Same skills, broader compatibility — now works with any AI agent that supports the open Agent Skills standard, not just Claude.
How to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user…
This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection,…
AlphaGenome API key, free for non-commercial use from deepmind.google.com/science/alphagenome. ALPHA_GENOME_API_KEY is accepted as an alternative spelling.
Plan, execute, and document validation, verification, and transfer of analytical procedures under the governing framework - ICH Q2(R2) and Q14, USP…
Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data…
Autonomously improve a real artifact (code, training recipe, agent harness, data pipeline, prompt) against an objective and an evaluator, using Hypothesis Tree…