QRNG icon indicating copy to clipboard operation
QRNG copied to clipboard

Loss of randomness

Open derekburgess opened this issue 2 years ago • 3 comments

I recreated your example from an article and it was working as expected, generating seemingly random 1's and 0's. I wanted to scale it up in size as well as add an OLED to print the results. After which, it continued to "work", but now it seems to have lost its randomness and only prints 1's -- Any thoughts on what might cause this? I have triple checked wiring and have even reverted my build back to the original scope, still it only produces a 1.

derekburgess avatar Feb 23 '22 15:02 derekburgess

Hi, Derek!

The most common cause of this issue is that the polarization of the photons coming from the laser is not at exactly a 45 degree angle relative to the beam splitter. This causes an unequal distribution in the number of photons being reflected/transmitted through the beam splitter.

When a photon hits a polarized beam splitter it is either reflected or transmitted. The probability of the photon being reflected or transmitted by a polarized beam splitter is directly related to how close the polarization of the photon and beam splitter are to one another.

A horizontally polarized beam splitter only allows photons through which are horizontally polarized and reflects the vertically polarized photons. The randomness comes from the angle in-between 0 and 90, a photon polarized at exactly 50% of the difference between these two angles (45 degrees) will collapse into either the horizontal or vertical mode with equal probability of reflection or transmission. This is the basis of the optical circuit.

qrng

Now, this is what I suspect to be the problem you've run into, and that is a when a photon does not match the 45 degree angle. A photon who is polarized closer to 90 degrees, say 75 degrees, will more often than not collapse into the vertical mode and be reflected. Likewise a photon whose relative polarization is closer to 0 degrees, let's say 10 degrees, will more often than not collapse into the horizontal mode and be transmitted.

Now, there are several trillion photons being generated and pushed through the entropy generator every pulse. If the laser is putting out photons which weighted towards one polarization over the other, that side of the circuit is more likely to receive more photons which decreases the resistance of the LDR which increases the voltage and ultimately causes the imbalance you are seeing.

I don't recall if it was discussed in the article or not, but you can try rotating the body of the laser diode while it is operating to "tune" the polarization until you wind up with a random distribution. This is what I originally did when I first designed it, alternatively you can place a 45 degree polarizing lens in front of the laser which is a more elegant solution.

The other possible issue is the Arduino itself because you are taking measurements at two separate times there is a possibility that the LDR which is being measured first is going to be higher than the LDR measured next. It's unlikely to be significant enough to measure on the Arduino, but you can try adjusting this in firmware by adding a small number to the voltage of either side to account for that.

Let me know if any of this helps you!

NoahGWood avatar Feb 24 '22 03:02 NoahGWood

Appreciate the reply, adjusting the angle of the pointer started producing more randomization. I will continue to toy with it tomorrow.

derekburgess avatar Feb 24 '22 04:02 derekburgess

Noah, this was it. I had upgraded the laser diode to a slightly larger version, with the same specifications, but I could not find a positioning that would make it work. I suspect that laser is either incorrectly labeled or creating distancing issues.

I returned to the laser diode similar to the one you use and was able to resolve the issue.

I am fascinated by the amount of variance which is possible with minor adjustments to position. I also found distance from the beamsplitter to impact results, is this expected?

Also while I have you, In the past I have used resistors inline with photo-resistors. Not sure I fully understand why this works without them? Since I get nearly the same voltage reading from both photo-resistors.

derekburgess avatar Feb 24 '22 16:02 derekburgess