alterlab-pennylane — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited alterlab-pennylane (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
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.
Install using uv:
uv pip install pennylaneFor quantum hardware access, install device plugins:
# 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-ionqBuild 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)
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. 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):
return qml.qnode(dev)(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)
# On hardware, build the QNode with diff_method='parameter-shift' for gradients.
result_hw = make_qnode(dev_hw)(params)default.qubit before deploying to hardwareqml.specs() to analyze circuit complexity~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.