Quantum Reservoir Computing Lab โ Memory Capacity, Fading Memory & a Nonlinear Readout โ by Darion Kellar
Educational quantum reservoir computing lab in ONE pure-Python file: the QRC protocol simulated end to end on 5 qubits (32x32 density matrix) โ a fixed random Ising reservoir (all 10 ZZ pairs + 5 X fields, couplings drawn from an in-file splitmix64 PRNG seeded 20261118; U = exp(-i H tau) at tau = 5.0 by scaling-and-squaring Taylor, unitarity deviation 3.156e-13, never trained), an input protocol stated as one formula (reset qubit 0 to |s><s| (x) Tr_0[rho], evolve, read the 10 expectation features), and a from-scratch ridge readout graded on held-out data (washout 50 / train 300 / test 200). Memory: per-delay R2 0.963282, 0.725080, 0.725040, 0.659045, then the cliff to 0.000307 at delay 12 โ MC = 3.279379 against the classical echo-state baseline's 5.228467 (same readout width 10, same stream, spectral radius scaled 3.032799 -> 0.9). Parity of the last two input bits: quantum readout 0.805 accuracy against the trivial predictor's 0.560 and the baseline's 0.760. A from-scratch distance-weighted kNN labels the measured reservoir fading-memory from the lab's own policy.
Pure Python standard library. Zero dependencies. Zero network. Honest scope: the toy is too small to conclude anything about quantum advantage in either direction โ 5 simulated qubits, one seeded series, one readout โ and the classical baseline is printed for scale, not as a verdict. No quantum hardware is touched, no model is deployed, and a computed memory capacity is a statement about this teaching model at the stated inputs. Every advantage / deployment / hardware / scaling / vendor / forecasting use is a permanent HOLD gate (14 total).
โ ๐งฐ Tech Stack Badges & Full Architecture Tech Stack
๐ Python 3.12, pure standard library (math, cmath, hashlib, json, sys) โ zero dependencies, zero network, deterministic (double-run byte-identical)
๐ฒ Determinism core: an in-file splitmix64 PRNG (seed 20261118) written out in full โ one stream drawn in a fixed order (reservoir couplings โ input series โ baseline weights), so a stochastic-looking topic still produces byte-identical output on every machine
๐ Reservoir core from scratch: Kronecker-product Hamiltonian (all 10 ZZ pairs + 5 X fields), the propagator exp(โiHฯ) by scaling-and-squaring Taylor (unitarity deviation 3.156e-13, asserted), partial trace + input reset on a 32ร32 density matrix, expectation features read off the diagonal
๐ฏ Readout core: ridge regression solved from scratch โ normal equations (XแตX + ฮปI)w = Xแตy by Gaussian elimination with partial pivoting; memory scored by squared Pearson correlation (Jaeger's MC measure), parity by thresholded accuracy against the trivial majority predictor
๐ Classical baseline: a 9-unit tanh echo-state network whose readout has the same width (10) as the quantum one, spectral radius estimated by power iteration on WแตW and scaled to 0.9, trained by the identical ridge path
๐ง TinyML kNN regime classifier (from scratch, stdlib, distance-weighted, k = 3): high-memory / fading-memory / nonlinear-capable / washed-out from (MC, delay-1 Rยฒ, parity accuracy, feature variance on a log scale), labels from the lab's own policy
๐ช Council seats: Gemini Argon 4 DECIDER (names-only, tighten-only) + Muse advisor (never overrides HOLD) + Google Flow plan-only (rendered = False, live = 0)
๐ซ Not applicable โ honestly. No blockchain, no Web3, no tokens: the "infrastructure" in this lab is one offline file holding a density matrix, a ridge solver, and a seeded input series. Quantum-advantage and deployment claims are permanent HOLD gates, not features. No fake badges here.
โ โ๏ธ Platform Support & Hardware Architecture
๐ฅ๏ธ Pure Python โ runs anywhere Python 3.12+ runs (Linux, macOS, Windows), plus the python:3.12-slim Docker image
๐ No hardware is controlled, ever: real quantum devices, readout electronics, and cryostats are permanent HOLD gates (see the gate table below). This lab simulates a reservoir classically; it does not run one
๐ซ No low-level code โ honestly. No C, no C++, no GPU, no compiled extensions: this is one interpreted Python file on purpose, so every matrix entry can be read, checked, and diffed. Performance here means honest algorithms โ a scaling-and-squaring exponential instead of a library call, an exact partial trace instead of a sampling shortcut, and the whole 550-step experiment cached once per process โ all deterministic and byte-identical between runs.
๐ซ None โ honestly. No cloud provider is used or needed: the lab runs fully offline on your own machine or in a local Docker container. Docker Hub appears only as the registry the publish workflow pushes the image to.
One seeded stream โ splitmix64 (seed 20261118) draws couplings, then the input series, then the baseline weights, in a stated order; the whole experiment is byte-identical across runs and machines.
The reservoir, receipted โ all-pairs Ising H built from Kronecker products; U = exp(-iH tau) by scaling-and-squaring Taylor with unitarity deviation 3.156e-13 asserted in CHECKS; the reservoir is never trained.
Input protocol as a formula โ rho -> |s><s| (x) Tr_0[rho] with |s> = sqrt(1-s)|0> + sqrt(s)|1>, then rho -> U rho U+; a fresh injection's <Z_0> = 1 - 2s is asserted at four input values.
Features with vital signs โ bias + <Z_i> + <Z_i Z_{i+1}> read off the density matrix; per-feature statistics over the test window (mean signal variance 0.008048, Z1 variance 0.017960) prove the reservoir is alive.
Memory, measured per delay โ test R2 0.963282 / 0.725080 / 0.725040 / 0.659045 for delays 1-4, the cliff at delay 5 (0.092422), 0.000307 at delay 12; MC = 3.279379 over the stated floor of 3.0, fading asserted.
Parity, graded against trivial โ XOR of the last two input bits: quantum accuracy 0.805 vs trivial 0.560 (margin +0.245 over the asserted +0.10), NMSE 0.619474.
The baseline in the same table โ 9-unit tanh ESN, readout width 10, radius scaled to 0.9: MC 5.228467 (it wins memory), parity 0.760 (it loses parity). Both printed; the toy is too small to conclude anything.
TinyML kNN classifier โ high-memory / nonlinear-capable / fading-memory / washed-out from (MC, delay-1 R2, parity, log-scaled feature variance); the measured reservoir reads fading-memory, dead features are vetoed to washed-out, and kNN == policy is asserted on all scenarios and all 120 grid points (leave-one-out).
Advisory seats โ Gemini Argon 4 DECIDER (names-only, tighten-only, sha256 trace), Muse advisor (can never override HOLD), Google Flow plan-only (rendered = False, live = 0).