executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
kernels-fidelityEvaluate, configure, and train Qiskit Machine Learning fidelity-based quantum kernels, including statevector kernels, ComputeUncompute fidelity, duplicate and PSD policies, trainable parameters, and kernel losses.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this route when the task is to turn a parameterized quantum feature map into
fidelity kernel matrices, select a fidelity primitive or statevector simulation,
control duplicate/PSD/shot behavior, bind trainable feature-map parameters, or
optimize a kernel with QuantumKernelTrainer.
QuantumCircuit feature map whose data-parameter count
equals the input feature dimension. The current implementation's base class
rejects a missing feature map, even where a constructor annotation permits
None; do not rely on an implicit default.FidelityStatevectorKernel for exact/classically simulated overlaps,
optionally with bounded caching and shot-noise emulation. Choose
FidelityQuantumKernel for a sampler-backed BaseStateFidelity; its default
fidelity is ComputeUncompute over the QML reference sampler.K_train = kernel.evaluate(X) and, for held-out data,
K_test = kernel.evaluate(X_test, X_train). Check shapes before passing a
precomputed matrix to a consumer. Route QSVC/QSVR fitting to the algorithms
sub-skill; this skill owns the kernel object and matrices, not model fitting.enforce_psd=True unless the
downstream algorithm or experiment explicitly requires the raw noisy matrix.
Select evaluate_duplicates deliberately for primitive kernels.assign_training_parameters, then use
QuantumKernelTrainer with a derivative-free optimizer and an appropriate
kernel loss. Route optimizer-specific choices to the optimizers sub-skill.ComputeUncompute(sampler=..., pass_manager=...) using a pass manager for the
same backend and validate the resulting circuit layout before execution.Read workflows for concrete procedures, api-reference for signatures and matrix semantics, fidelity-and-runtime for primitive/runtime adaptation, and troubleshooting before changing an otherwise working configuration.
BaseKernel, FidelityQuantumKernel,
FidelityStatevectorKernel, their trainable variants, BaseStateFidelity,
ComputeUncompute, StateFidelityResult, QuantumKernelTrainer, and kernel
losses (SVCLoss, SVRLoss, MSRLoss, MARLoss, HuberLoss).pip install qiskit-machine-learning
plus compatible Qiskit and scikit-learn packages.Run the bundled smoke check with python path/to/kernel_smoke.py. It constructs
a two-feature statevector kernel, asserts a square symmetric training matrix,
checks the asymmetric (1, 2) shape, and verifies unit self-fidelity. For a
sampler-backed or trainable deployment, additionally check the relevant workflow
and runtime failure cases in the references. Do not claim hardware verification
from a statevector-only smoke test.