Quantum Oracle Algorithms Lab โ by Darion Kellar
Educational quantum oracle algorithms lab in ONE pure-Python file: a from-scratch statevector simulator (2^n complex amplitudes, exact arithmetic, no sampling noise) running the four textbook oracle algorithms with every oracle call COUNTED on both sides. Deutsch-Jozsa decides constant vs balanced in exactly 1 quantum query for n = 1..6, against a classical worst case of 2^(n-1) + 1 counted on constant and adversarial instances (17 at n = 5, 33 at n = 6). Bernstein-Vazirani recovers the hidden string in exactly 1 query against exactly n classical queries, counted by reading the unit vectors. Grover's success probability is MEASURED from the simulator across iterations at N = 16 โ 0.062500, 0.472656, 0.908447, peak 0.961319 at k = 3 = round(pi/4 * sqrt(N)) โ and the overshoot is printed, not hidden: P falls to 0.581704 at k = 4 and 0.125492 at k = 5, against a classical expected 8.5 queries counted over every marked position ((N+1)/2, about N/2). Simon's hidden period (n = 4, s = 1011) is recovered by real GF(2) Gaussian elimination over the sampled equations in 5 quantum queries vs 9 counted classical collision queries. A query ledger prints both counts and the ratio for all four, and a from-scratch kNN classifier identifies the problem family from the lab's own run signatures.
Pure Python standard library. Zero dependencies. Zero network. Honest scope: these are query-complexity statements about the ORACLE MODEL โ one query is one black-box unitary a real machine would have to build from gates, on promised problems built for provable gaps. They are NOT practical speedup claims: the simulator itself is classical and exponential (2^n amplitudes, stated wherever a size is printed), no quantum hardware was touched, and Simon's measurement outcomes are enumerated in a fixed rotating order in place of random sampling (labelled in the report; each run still costs exactly 1 query). Every crypto-breaking / password-cracking / production / hardware / real-world-speedup claim is a permanent HOLD gate (14 total).
โ ๐งฐ Tech Stack Badges & Full Architecture Tech Stack
๐ Python 3.12, pure standard library (math, hashlib, json, sys) โ zero dependencies, zero network, deterministic (double-run byte-identical)
๐ฎ Statevector simulator core: H / X / Z / CNOT applied by index arithmetic on 2^n complex amplitudes, oracle unitaries as exact permutations / phase flips, diffusion as inversion about the mean โ every probability asserted against its analytic value in CHECKS
๐ข GF(2) linear algebra from scratch: Gaussian elimination to reduced row echelon form, null-space extraction for Simon's post-processing
๐ง TinyML kNN problem-family classifier (from scratch, stdlib): deutsch-jozsa / bernstein-vazirani / grover / simon from query counts + success probability + output structure
๐ช 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 simulated quantum register, four oracle circuits, and a paper query ledger. 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 QPUs, cloud quantum services, and hardware benchmarks are permanent HOLD gates (see the gate table below)
๐ซ No low-level code โ honestly. No C, no C++, no GPU, no compiled extensions: this is one interpreted Python file on purpose, so every amplitude can be read, checked, and diffed. Performance here means honest counting โ the simulator's own cost is the lesson: 2^n amplitudes, exponential in n, printed wherever a size appears.
๐ซ 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.
Statevector simulator, from scratch โ H / X / Z / CNOT by index arithmetic, norm asserted after a mixed gate sequence, Bell state probabilities exactly 0.5 / 0.5, CNOT truth table verified on all four basis states.
Deutsch-Jozsa, exactly 1 query โ phase kickback onto an ancilla in |->; the all-zero probability is exactly 1.0 for constant and exactly 0.0 for balanced at every n = 1..6; the classical worst case 2^(n-1) + 1 is counted, not quoted, on constant AND adversarial balanced instances.
Bernstein-Vazirani, exactly 1 query โ the hidden string (up to n = 6, e.g. s = 101101) is recovered with probability exactly 1.0; the classical baseline reads one bit per query and is counted at exactly n.
Grover, measured not quoted โ P(k) read off the simulated state at every k and checked against sin^2((2k + 1) theta) to 2e-6; the measured peak sits at the formula k for N = 8, 16, 32, 64, and the post-peak fall (overshoot) is a first-class table row.
Simon with real post-processing โ f(x) = min(x, x ^ s) is proven two-to-one in the checks; sampled equations y . s = 0 are solved by from-scratch GF(2) Gaussian elimination (null space), recovering s = 1011 at n = 4 in 5 runs.
Query ledger โ DJ 1 vs 17, BV 1 vs 6, Grover 3 vs 8.5, Simon 5 vs 9, each with its classical counting method named and the fine print attached: oracle-model statement, not a practical speedup claim.
TinyML kNN classifier โ deutsch-jozsa / bernstein-vazirani / grover / simon from (quantum queries, success probability, classical queries, output structure, exactness); the training grid is generated by running the lab's own algorithms, and the grid is self-consistent under the classifier.
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).