QuantumRandom-Lab: QRNG lab - Born-rule sampling, entropy, von Neumann extractor, test battery. Sim!
198
Quantum Randomness (QRNG) Lab β by Darion Kellar
Educational quantum randomness lab in ONE pure-Python file: a small statevector simulator (β€ 6 qubits, pure-Python complex amplitudes) whose Born probabilities are computed, not assumed β Hadamards give a provably uniform distribution, a qubit rotated by ΞΈ β Ο/4 is a provably biased source with P(1) = sinΒ²ΞΈ β plus Shannon and min-entropy accounting per bit and per byte, a von Neumann extractor that removes bias at the theoretical yield p(1βp), a simplified NIST-style test battery (labelled simplified), and a from-scratch kNN source classifier whose labels are generated by the battery itself.
Pure Python standard library. Zero dependencies. Zero network. Honest scope: this lab is a simulation β its sampling is driven by a seeded classical PRNG (seed printed in every report) so the demo is deterministic, which means its output is NOT true quantum randomness. Real QRNG randomness is unseeded and unreproducible. The classical PRNG contrast stream passes the battery and is labelled NOT quantum in the same report: passing statistics never certifies quantumness. Every certified-QRNG / real-key / gambling / beacon claim is a permanent HOLD gate (14 total).
docker pull credkellar/quantumrandom-lab:latest
docker run --rm credkellar/quantumrandom-lab:latest
The default command runs the full demo plus the built-in self-checks (CHECKS 54/54).
Run a specific command instead:
docker run --rm credkellar/quantumrandom-lab:latest python3 main.py checks # CHECKS 54/54
docker run --rm credkellar/quantumrandom-lab:latest python3 main.py sample # Born-distribution sampling (seeded)
docker run --rm credkellar/quantumrandom-lab:latest python3 main.py entropy # Shannon + min-entropy per source
docker run --rm credkellar/quantumrandom-lab:latest python3 main.py extract # von Neumann yield: measured vs theory
docker run --rm credkellar/quantumrandom-lab:latest python3 main.py tests # simplified battery, all four streams
docker run --rm credkellar/quantumrandom-lab:latest python3 main.py classify # kNN source classifier report
docker run --rm credkellar/quantumrandom-lab:latest python3 main.py holds # 14 HOLD gates
quantum_source = False: the standing proof that passing β quantum.python:3.12-slimScience Β· Developer tools Β· Machine learning & AI
credkellar/quantumrandom-lab:latestdocker pull credkellar/quantumrandom-lab:latest