Digital Quantum Simulation Lab โ TrotterโSuzuki Error, Measured โ by Darion Kellar
Educational digital quantum simulation lab in ONE pure-Python file: the transverse-field Ising chain (open chain, J = 1, labelled h) on N = 3 and N = 4 spins, simulated classically with a from-scratch linear-algebra kit โ Kronecker products, a scaling-and-squaring Taylor exponential for the exact propagator (unitarity deviation 4.88e-15), and Lie / Strang product formulas whose factors are exponentiated exactly as full matrices. The Trotter error is measured against the exact propagator in operator norm over the ladder n = 1..128 at t = 1 (order 1: 1.845492 -> 0.010793; order 2: 1.534259 -> 6.94410e-05), the log-log slopes are fitted and graded (measured -1.0074 vs theory -1; -2.0064 vs -2), and the steps to error < 1e-6 are printed with provenance: 1,069 for Strang, VERIFIED directly (measured 9.96e-07), versus 1,282,892 for Lie, EXTRAPOLATED from the fit and flagged as such. The resource ledger counts 8,980,244 rotations for Lie against 7,486 for Strang (a 1,199.6x ratio, Strang half-layers merged), the commuting points h = 0 and J = 0 are exact to machine precision (7.85e-16, 1.57e-15), and the observable section names its own trap: <Z_0> cannot separate the orders (diagonal phase layers cancel), so the orders are graded on <X_0> โ max deviation 0.063940 (Lie) vs 0.007016 (Strang) at n = 8. A from-scratch distance-weighted kNN classifier labels regimes from the lab's own policy.
Pure Python standard library. Zero dependencies. Zero network. Honest scope: N <= 4 spins simulated on a classical machine is not a quantum computer and claims no speedup โ no hardware is touched, no molecule or material is discovered, and a 4-spin chain says nothing by itself about the thermodynamic limit. Every speedup / hardware / chemistry / materials / drug / vendor-benchmark / cryptanalysis / investment 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)
๐งฎ Linear algebra from scratch: Kronecker products, matrix multiply / dagger / Frobenius norm as plain lists of complex numbers, the matrix exponential by scaling-and-squaring Taylor (stated openly, graded by unitarity 4.88e-15), and the operator norm by power iteration on Mโ M with two deterministic start vectors
๐ TrotterโSuzuki core: the ZZ factor exponentiated exactly as diagonal phases, the X factor as a Kronecker product of per-qubit rotations cos(hฯ) I + i sin(hฯ) X, assembled as full-matrix products โ Lie exp(โiBฯ) exp(โiAฯ) and Strang exp(โiAฯ/2) exp(โiBฯ) exp(โiAฯ/2)
๐ Error analysis: operator-norm error ladder n = 1..128 at fixed t, log-log slope fitted over the asymptotic region (n โฅ 4) and asserted against theory in CHECKS, steps-to-target verified by fit-guided bisection where affordable and flagged EXTRAPOLATED where it is not
๐ง TinyML kNN regime classifier (from scratch, stdlib, distance-weighted): converged / trotter-limited / deep-circuit / trivially-exact from (error, steps, order, h/J), 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 16ร16 Hamiltonian, two product formulas, and an error ladder. Quantum speedup and cryptanalysis 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 quantum hardware is touched, ever: real devices, circuit execution, and hardware specifications are permanent HOLD gates (see the gate table below). This lab simulates a quantum algorithm 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, power iteration for the operator norm, and a fit-guided bisection for the verified step count โ 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.
The chain, by hand โ TFIM built from in-file Kronecker products (dims 8 and 16); trace(H) = 0 exactly, ||H||_F = 10.5830, and ||[A, B]||_F = 19.5959 printed as the reason Trotter error exists.
Exact reference, receipted โ scaling-and-squaring Taylor propagator: unitarity deviation 4.88e-15, roundtrip U(t)U(-t) = I to 4.88e-15, <Z_0>(t = 1) from |0000> = -0.033022.
The ladder โ operator-norm error at t = 1 for n = 1..128, both orders; at n = 16 Strang (0.004451) is 19x more accurate than Lie (0.086520).
Slopes, fitted and graded โ -1.0074 (Lie, prefactor 1.4236) and -2.0064 (Strang, prefactor 1.1674) over n >= 4, asserted within 0.15 of theory; the fit reproduces the measured n = 128 errors within 35%.
Steps to target, with provenance โ Strang: 1,069 steps, bisected against directly measured errors (9.96e-07 at the count). Lie: 1,282,892 steps, fit-extrapolated and flagged EXTRAPOLATED everywhere it appears.
The observable trap, named โ the |0000> and Neel <Z_0> curves are identical, and Lie and Strang agree on <Z_0> to machine precision at equal n (diagonal ZZ half-layers are invisible to a diagonal observable); <X_0> separates the orders, 0.063940 vs 0.007016 max deviation at n = 8, with <X_0>(t = 1) = +0.499309 / -0.499309 for the two states.
Commuting points exact โ h = 0 error 7.85e-16 (Lie, n = 3), J = 0 error 1.57e-15 (Strang, n = 3); the h sweep shows Strang's n = 16 error growing 1.45e-15 -> 0.010762 across h = 0..2 while Lie's saturates around 0.07-0.10.
Resource ledger โ per-layer counts (3 ZZ + 4 X for N = 4) with Strang half-layer merging ((n + 1) ZZ layers for n steps): 8,980,244 total rotations for Lie vs 7,486 for Strang to the same 1e-6 target โ counted, none executed.
TinyML kNN classifier โ converged / trotter-limited / deep-circuit / trivially-exact from (error, steps, order, h/J); agreement with the lab's policy asserted on every scenario and all 336 training-grid rows.
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).