QNN, QGNN, and QSNN convergence examples (BL-42)

July 28, 2026 ยท View on GitHub

scpn_quantum_control.ml_examples provides one deterministic, simulator-only training example for each of the repository's QNN, QGNN, and QSNN model families. The suite composes the existing trainers; it does not introduce a second optimisation engine or a new numerical hot path.

Frozen tasks and acceptance gates

Each task fixes its data, seed, step budget, target loss, minimum loss drop, and optional task metric before execution. A certificate passes only when the target, loss-drop, deterministic-replay, and metric gates all pass.

FamilyExisting training routeFrozen taskStepsInitial lossBest lossGate
QNNMulti-frequency parameter-shift phase-QNN classifierSeparate phase features 0 and pi into labels 0 and 1800.02299670500.0000710821loss <= 1e-4, drop >= 0.02, accuracy = 1.0
QGNNExact message passing followed by a Phase-QNode readout gradientFit four seeded three-node K_nm graphs to synthetic Kuramoto targets600.5089500060.003414575loss <= 0.005, drop >= 0.45
QSNNStatevector QuantumDenseLayer with parameter-shift descentSilence the firing probability of one quantum synapse for a unit input160.7728800230.000000562loss <= 1e-5, drop >= 0.7, final spike = 0

These are small, synthetic convergence witnesses. They do not establish generalisation, architecture-independent trainability, state-of-the-art accuracy, production convergence, or quantum advantage.

Python API

from scpn_quantum_control.ml_examples import run_ml_convergence_suite

evidence = run_ml_convergence_suite()
assert evidence.passed

for certificate in evidence.certificates:
    print(
        certificate.spec.family.value,
        certificate.best_loss,
        certificate.passed,
    )

Use required_qnn_frameworks=("jax", "pytorch") when an environment must execute specific QNN framework adapters. An unknown framework is rejected. A missing required dependency or a failing installed adapter makes the suite fail closed; evidence files are not written.

Framework matrix

The committed 2026-07-28 local evidence records every matrix cell explicitly. not_applicable means the bounded model family has no registered native adapter; unsupported means the route lies outside this suite.

FamilySCPN native routeJAXPyTorchTensorFlowHardware
QNNran, requiredran, agreement passedran, agreement passedunavailable in the evidence environmentprovider gradient unsupported
QGNNran, requirednot applicablenot applicablenot applicableoutside the suite
QSNNran, requirednot applicablenot applicablenot applicableneuromorphic hardware unsupported

The QNN JAX and PyTorch rows execute the same bounded classifier loss and agree with its parameter-shift reference. The evidence records maximum absolute gradient errors of about 1.11e-9 and 1.39e-17, respectively. It does not claim arbitrary framework parity.

Evidence CLI

PYTHONPATH=src:oscillatools/src python scripts/run_ml_convergence_examples.py \
  --json-output data/ml_convergence_examples/bl42_convergence_evidence.json \
  --markdown-output data/ml_convergence_examples/bl42_convergence_evidence.md

The JSON payload uses schema ml_convergence_examples.v1 and binds all task specifications, loss histories, certificates, framework rows, notebook pointers, and claim boundary with a canonical SHA-256 content digest. The human-readable evidence and machine-readable evidence are committed together. The CLI performs no provider, QPU, or neuromorphic hardware execution.

Learning pointers

FamilyNext source
QNNscripts/run_ml_convergence_examples.py and the public API above
QGNNQuantum Graph Neural Network
QSNNnotebooks/10_qsnn_training.ipynb

The QSNN example is a probability/synapse-angle convergence witness for the existing dense quantum layer. It does not model temporal spike coding, LIF membrane dynamics, STDP, event-driven execution, or neuromorphic hardware.

Claim boundary

deterministic synthetic local QNN/QGNN/QSNN training evidence on frozen small tasks; no arbitrary-architecture, generalisation, SOTA, provider, QPU, neuromorphic-hardware, or production convergence claim

Authored by Anulum Fortis & Arcane Sapience (protoscience@anulum.li)