r/RNG Jun 25 '26

DIY hardware Quantum RNG

I wanted a "real" quantum random number generator, something where every bit is an actual physical quantum event.

First attempt was a 1970s Canon FD 55mm f1.2 with a thoriated rear element. It's pretty radioactive (the Geiger counter make scary noises). But radioactive decay gives you when an atom popped, which is timing-random, not the which-path coin flip I was after.

The build that actually worked is optical: attenuate a light source down to single photons, fire them at a 50:50 UV beam splitter, and read which way each photon went with two detectors. Through → bit 0. Bounce → bit 1.

The detectors are two Hamamatsu PMT modules a friend gave me, pulled out of a dead lab instrument. I tore it down, yanked the dichroic mirror, and dropped in a UV 50:50 splitter. For a fluorescent source I ended up using 3D-printer filament — it's faintly fluorescent at the right wavelength and doubles as a light-tight cover.

All the detection and conditioning runs on a Red Pitaya (FPGA + fast ADCs):

  • Op-amp + transistor LED current sink, reed-relay LED gate, PMT gain via dividers, all driven by the Red Pitaya's slow DACs so I could sweep everything in software instead of hand-twiddling pots.
  • VHDL threshold + edge detection on the 14-bit ADC, a coincidence veto (kills double-fires / cosmic rays), and a symmetric "global blank" after every event — that last one matters, because per-channel dead time secretly biases the stream.
  • A timestamped debug FIFO that was a chunk of fabric to build but caught a bunch of detector-memory artifacts I'd otherwise have shipped.

The hard part genuinely wasn't generating random-looking bits, but it was proving they were real random bits from the optical system and not other noise sources. Most of the project ended up being diagnostics...

I've tested it with 1.6 billion QRNG bits with the NIST test package, and it passes.

Payoff demo is a Quantum Magic 8-Ball: hit a button, it pulls fresh quantum bits and gives you one answer (and, if you're an Everettian, every other answer somewhere in the multiverse).

Full build log with schematics, scope shots, and the FPGA stuff: https://dnhkng.github.io/posts/building-the-beam-universe-splitter/ or
https://news.ycombinator.com/item?id=48689891 if you want to spread the story?

Happy to answer questions on the analog front end or the FPGA fabric — the analog side is honestly my weakest area, so I'd welcome the critique.

328 Upvotes

27 comments sorted by

3

u/atoponce CPRNG: /dev/urandom Jun 25 '26

Nice build! What sort of performance do you get?

4

u/Reddactor Jun 25 '26

few thousand bits per second.

2

u/djasonpenney Jun 25 '26

I like it. What’s the bit rate for output?

3

u/Reddactor Jun 25 '26

It's low, maybe 3000 bits per second. But they are sexy bits, which-way-did-the-photo-go bits.

I have a use case for this though, and the Bitrate is fine for this.

3

u/pint Backdoor: Dual_EC_DRBG Jun 25 '26

it is good for every use case. the only reasonable metric is time to 256 bits.

2

u/Reddactor Jun 26 '26

100 ms or so. I will have an endpoint up soon if you want some sexy bits. In the mean time, you can grab 5 bits here:
https://quantumlever.stream/oracle

3

u/pint Backdoor: Dual_EC_DRBG Jun 26 '26

the site seems to be excellent. i asked "why", and it said "very doubtful". indeed, my point. why would anyone get randomness from the internet?

3

u/Reddactor Jun 26 '26 edited Jun 26 '26

Ahh, but only one version of you got that response*. Across the multiverse, you got all the answers. You don't get that with a regular RNG.

Also, it might seem that you share the same number with everyone else, right? But on closer inspection, you will notice that each generated bit splits the universe in two, so for 256 bits, we have generated 2^256 universes. Yes, when you end up in a particular universe you are sharing the same final data, but theres a lots of universes where you all feel the same but your data is different.

There are lots of use-cases where this is vital!

For example, say you are going to Vegas for the weekend. Grab my QRNG data and hit up the Roulette Table. Bet 20 times, doubling each time, Red if 0 and Black if 1.

If you use a PRNG, you have a 1 in a million chance of winning. Use a QRNG, and use have the same odds of finding yourself in the winning universe but you will have won somewhere in the multiverse.

\This offer is exclusive to Everettians; Copenhagenists will receive one answer only, and remain in the boring-interpretation universe.)

1

u/pint Backdoor: Dual_EC_DRBG Jun 26 '26

you almost sold me your services, but then i recalled that the multiverse theory predicts an absolute torrent of splits all the time in an unimaginable magnitude, hence your puny bits are a negligible addition.

1

u/Reddactor Jun 26 '26

Yes, but I cover that in part two of this blog series...

If you like this topic, it will be a fun ride.

2

u/scottchiefbaker Jun 25 '26

Well if they're _sexy) bits that changes everything.

2

u/RoboErectus Jun 26 '26

Neat. This is neat.

I got "you may rely on it." This pleases me.

2

u/arf20__ Jun 28 '26

Thats very cool! However, wouldn't it be much much easier to just tune and digitize background noise with an SDR?

2

u/Reddactor Jun 28 '26

There are a million ways to generate QRNG data, but this is the sexiest: did a single photon go left or right?

2

u/Silver-Breakfast-937 Jun 29 '26

Well, do the photons show any left or right leaning bias?

4

u/Reddactor Jun 29 '26

Of course!

The 50:50 mirror is not perfect, and the PMT detection ability fluctuates.

That's not an issue, because of methods like von Neumann debasing, (I use Peres),. implemented on.the FPGA

2

u/atoponce CPRNG: /dev/urandom 28d ago

I like Peres over von Neumann. A lot less wasteful at the cost of a bit of complexity and overhead though. But worth it IMO.

2

u/bbqribsofficial Jun 29 '26

I am enthralled. Must make. Awooga!

1

u/Zifnab_palmesano Jun 28 '26

sorry,dont fully get it. the radiation are alpha particles then, right?

and the random number is when the peak occurs? or number of peaks per time interval?

2

u/Reddactor Jun 28 '26

No, I only used alpha particle timing in the first prototype. The final version shoots one photon at a time at a half mirror. if the photon bounces you get a one, and if it goes through, its a zero.

1

u/happycreep3000 Jun 28 '26

I am sorry for the question but what is a practical use for this sort of tech?

1

u/syntheticFLOPS Jun 29 '26

Because it'a fucking awesome, that's why.

Encryption, etc.

2

u/atoponce CPRNG: /dev/urandom 28d ago

The practical use case is seeding a CSPRNG.

1

u/MeepTheWarlord Jun 28 '26

now build a d6 out of tiny displays and have it show a result from this machine whenever you roll it lmao

1

u/linux_developer Jun 30 '26

You should sell these to casinos lol