Show HN: DIY Quantum Random Number Generator and a Quantum Magic 8-Ball

dnhkng1 pts0 comments

Building the Beam Universe Splitter I: A Quantum Magic 8-Ball | David Noel Ng Light Dark System

Post<br>Cancel<br>Building the Beam Universe Splitter I: A Quantum Magic 8-Ball<br>Contents Building the Beam Universe Splitter I: A Quantum Magic 8-Ball

Sometimes I get weird projects stuck in my head. I’ve always wanted to do a “quantum” hardware project; in my PhD and postdoc I’d messed about making fluorescent dyes and proteins that were technically quantum (I designed around a Jablonski diagram ), but it was all unsatisfying. I’ve wanted to get down to single quantum events, ever since reading The Fabric of Reality, the 1997 book by physicist David Deutsch.<br>This is ‘Part One’ in a two-part blog series, on my little rabbit hole on this topic. This first part is a build-log on the construction of a Quantum Random Number Generator (QRNG). It’s actually a lot more complicated to build one than initially suspected. As usual, my blind ignorance and cheerful initial optimism were the main drivers of the success of this project. One step at a time as you go over the ‘over-engineering’ cliff…<br>“But, wait a sec!”, the thoughtful reader asks. “Doesn’t a normal computer already do this?” /dev/urandom pulls from an OS entropy pool, ultimately seeded by physical noise sources that are quantum at the bottom… (waves to NSA 👋🏻😅).<br>Yes, but only sort of. A Pseudorandom Number Generator (PRNG) seeded from OS entropy makes one quantum draw at the seed, then runs deterministically forever after. To be fair to /dev/urandom, it’s better than that: modern Linux runs a Cryptographic RNG (CRNG) that keeps reseeding itself from interrupt timing, so it’s topping up its entropy as it goes. But between top-ups you’re still reading the output of a deterministic function, not a fresh physical event. A QRNG generates new physical entropy at every sampling step. And although you won’t find any statistical difference between the three, they have vastly different properties in the most important aspect of all: philosophically .<br>Here’s what we’ll cover: radioactive lenses from the 70s, Geiger counters, photomultiplier tubes, beam splitters, analog/digital circuitry, von Neumann debiasing, FPGA logic, various server software systems, and the first complete demo: a quantum Magic 8-Ball .<br>TL;DR:<br>Here is the whole build in one breath:<br>flowchart LR<br>LED["UV LED"] --> BS["50:50beam splitter"]<br>BS --> A["PMT A"]<br>BS --> B["PMT B"]<br>A --> FPGA["Red PitayaFPGA"]<br>B --> FPGA<br>FPGA --> Q["QRNG streamTCP :5000"]<br>FPGA --> L["Lever streamTCP :5003"]<br>Q --> API["REST API"]<br>API --> E["Magic 8-Ball"]<br>And a Magic 8-Ball to try: ask it your question, and receive exactly one answer here, plus every possible answer across the multiverse.*<br>*This offer is exclusive to Everettians; Copenhagenists will receive one answer only, and remain in the boring-interpretation universe.

Background<br>This did not emerge fully formed. Well, the idea kinda did, but the final architecture is the survivor of several wrong-but-plausible versions:<br>AttemptWhy it seemed reasonableWhat killed itRadioactive lens timingRadioactive decay is genuinely randoma PITA to work with, and I kinda want to be able to use my camera lensSingle PMT photon counterPhoton arrivals are PoissonTiming bits were valid but not the which-path quantum coin flip I wantedManual potentiometer tuningGreat for first pulses on the scopePainfully long/boring to sweep reproduciblyPer-PMT dead timeSuppress after-pulses on the channel that firedCreates a private recovery window where the other PMT can winVon Neumann-only extractionSimple, mathematically clean debiasingThrew away too many hard-won photonsInterleaved cascade serializerHigher yield than von NeumannIntroduced a local lag-4 to lag-8 memory signaturePlain FIFO readoutNormal streaming designReturned older data first when interactive requests wanted fresh entropy<br>Hardware Build<br>The Radioactive Camera Lens Attempt<br>In my first attempt to harness the quantum realm, I messed about with a gem in my lens collection: an early Canon FD 55mm F1.2 Aspherical lens, with a rear element made with thoriated glass. Hold a Geiger counter to it and it makes you wonder if holding a camera to your eye with this beast mounted is really such a great idea (but OMG, the Bokeh …).

But I didn’t like it conceptually. Sure, the time between counts is random, but not the cool kind of random I wanted. Timing between the pulses and taking the least significant bit is random, but not sexy random. I wanted a proper quantum coin flip.<br>A Geiger tube gives me when something happened. I wanted which way something happened. I also had a photon counting PMT, which when wrapped up in aluminium foil, and only counting a few hundred thousand photons per second also worked similarly. But I wanted a device where the bit was not derived from timing arithmetic, but from a physical choice: left detector or right detector. So the spicy camera lens went back on the shelf, and the build moved toward photons, mirrors, and...

quantum magic ball wanted random from

Related Articles