QRNG icon indicating copy to clipboard operation
QRNG copied to clipboard

Question about detection

Open Quantizr opened this issue 4 years ago • 8 comments

Hi, I'm a high schooler who is interested in quantum physics and quantum computing. I have a very limited understanding of quantum computing at the moment, and I'm having trouble understanding how your QRNG design produces random numbers. This is how I understand your device:

As you stated in your article, there are trillions of photons in each light pulse. Each individual photon has a 50% chance to collapse into a vertical or horizontal state. As an example, assuming exactly 1 trillion photons pass through, approximately 500 billion photons would be vertically polarized, and approximately 500 billion would be horizontally polarized. Photoresistors of the type used in this device are not able to detect light to the photon level, so, in theory, both resistors should provide a resistance with an unmeasurable difference. Any measurable difference in voltage would be caused by background light, imperfectly angled sensors, dark counts, or variance within the measuring tool. As far as I understand, what actually is happening is RNG created by radiation/noise from the background or from the hardware, which, while it should be truly random, is not quantum randomness. Another implication is that using an expensive polarized beamsplitter is completely unnecessary in that case, as a cheaper non polarized 50/50 beamsplitter would work just fine.

I just re-read the original article and found you were originally using a 650nm red laser diode. If I recall correctly, lasers emit polarized light, meaning that the quantum state of the photons is already collapsed at the moment of leaving the laser, making the entire RNG pointless. I'm not sure if the same is true with LEDs though. Anyway, the point is, as far as I understand it, single photon generation and detection is required for this form of quantum number generation. However, I am still just a high school student with very little knowledge about quantum physics, so I'm very likely wrong about this whole thing. It'd be great if you could clarify what I'm missing here.

Final note: I am almost completely confident of this: one cannot perform a Hadamard transform on more than a single photon at a time and it would not be able to return the superposition measurement (I assume that is what you mean by qubit angle? though I'm not sure what you mean by angle... is it the angle of the linear combination of basis states vectors?). A measurement after a Hadamard transform would just collapse it back to a single classical state and not give a measurement of the entangled state as far as I'm aware.

Quantizr avatar Jul 01 '20 05:07 Quantizr

Despite the @Quantizr assumptions and implications seems correct, I've found this experiment/project https://directory.eoportal.org/web/eoportal/satellite-missions/s/spooqy-1 which as far as I understand creates (in space) an experiment like QRNG. It uses many non linear optical filters to create a pair of entangled photons starting from a blue laser beam (which, as @Quantizr noted, produces a beam of same-phase photons).

Anyway, I'm not a physicist or an engineer and my quantum knowledge is barely zero, so my comment is valuable only for the link.

dakk avatar Jul 22 '20 09:07 dakk

Apologies for the (Long) hiatus.

"Each individual photon has a 50% chance to collapse into a vertical or horizontal state. As an example, assuming exactly 1 trillion photons pass through, approximately 500 billion photons would be vertically polarized, and approximately 500 billion would be horizontally polarized."

Yes

"Photoresistors of the type used in this device are not able to detect light to the photon level, so, in theory, both resistors should provide a resistance with an unmeasurable difference."

In theory, yes.

"Any measurable difference in voltage would be caused by background light, imperfectly angled sensors, dark counts, or variance within the measuring tool." That is an assumption, and one I had as well.

If background light were the primary cause, we should expect the RNG to work without the addition of light, it does not. Imperfectly angled sensors weights the randomness, pretty heavily, resolving that is part of the tuning process.

Dark counts are not really a significant issue just because of the sheer volume of photons we're working with and because photoresistors are really insensitive.

There is the issue of residual electricity in the circuit - that could definitely cause a problem (and did cause a heavy weighting problem at first), but you'll notice in the firmware we added a delay - this was placed there to ensure that both sensors drained fully.

Unfortunately we're working with a single arduino here and I don't have the necessary equipment to more thoroughly test the device for any measurement issues.

With that being said, generally these kinds of issues don't induce randomness, they reduce it. If, say, the H wire is pushing some residual electricity into the V wire we should expect to see more V counts than H counts and vice versa.

"As far as I understand, what actually is happening is RNG created by radiation/noise from the background or from the hardware, which, while it should be truly random, is not quantum randomness." Background radiation is 100% not the cause, you're welcome to test it out yourself if you like though.

Hardware issues, I mean, maybe? An electrical pulse is actually generated when light hits the photoresistors, in the V1 arduino model you'll notice the photoresistors are tied directly to ground, so the voltage spike measured is the voltage generated by the light itself, this could induce some kind of inductive currents that messes with the ADC I guess? The ground isn't floating either, I had diodes on my first set up to prevent backflow, but it didn't seem to make a difference in the results

"Another implication is that using an expensive polarized beamsplitter is completely unnecessary in that case, as a cheaper non polarized 50/50 beamsplitter would work just fine." Possibly, but I don't think it will be operating on the same principles, that might be fun to try though

"If I recall correctly, lasers emit polarized light" All light is polarized. Lasers simply emit light that is mostly polarized in a specific direction. It can be kind of confusing, polarization is an inherent part of any electromagnetic wave, we're using linearly polarized light which is why I'm using simpler terms like vertical/horizontal, it's all relative to the observer.

"meaning that the quantum state of the photons is already collapsed at the moment of leaving the laser" Nope, even the linear polarization of a laser is only a probabilistic function. Try it out for yourself, take a laser pointer and point it at a wall 20 or 30' away, now start walking towards it. The laser point starts out big and gets smaller, if it were perfectly polarized there would be no beam widening.

"single photon generation and detection is required for this form of quantum number generation." Well, this design is specifically so that we can use a collection of photons to perform the computation and avoid the very pricey components

"Final note: I am almost completely confident of this: one cannot perform a Hadamard transform on more than a single photon at a time and it would not be able to return the superposition measurement (I assume that is what you mean by qubit angle?" We can, we just have to be realistic that the only results we will be able to get are an average of each individual photon. Maybe I should have lead with that, build the device and rotate the laser diode, if you take the tangent of the input voltages H/V you will find the average polarization angle of all the photons in the laser pulse, when properly tuned that angle will be 45*.

The "qubit" I'm referring to in the paper is the simulated qubit which is effectively the average of every photon the hadamard was performed on. The angle is just that, the angle of the polarization of our simulated qubit.

And I should mention that aforementioned angle isn't exact, it's a bit wonky to even describe, basically the calculated angle should always be between 0-90, there is some information loss there and if you think of the polarization angle as a line drawn through a circle with four quadrants, we're able to recover only one quadrant, and we don't even know which one that is, only that it is intersected by a line with that angle. So 45* could actually be 135* or 225*, etc. It's really only useful for tuning the device.

"A measurement after a Hadamard transform would just collapse it back to a single classical state and not give a measurement of the entangled state as far as I'm aware." There is no entanglement involved in this, the Hadamard transform places each photon into a superposition of itself. It's physically occurring in the beam splitter whether we measure it or not, the effects of this operation are observable, in this case by measuring the number of photons in the horizontal and vertical mode.

Hope that clarified a little?

NoahGWood avatar Mar 10 '21 04:03 NoahGWood

I recently finished writing a science fair paper/creating a working prototype for a low cost single photon QRNG (based on https://pubmed.ncbi.nlm.nih.gov/17477690/, but uses a reverse bias LED as a low cost single photon detector), so I guess I have a tiny bit more knowledge on QRNGs now.

It seems like essentially what you are doing is attempting to measure a very inaccurate count of the photons which arrive at the sensor every 104 microsecond time interval (based on your implementation of the default Arduino ADC). The main problem I see with that is that the Arduino ADC on measures to 10 bit precision (and that 10bit precision is only an estimate), so you are only measuring to an accuracy of 4.88 mV. This would require quite a large fluctuation in the light which hits each photoresistor to cause that great of a difference, but only a small inaccuracy in the output of the photoresistor or Arduino ADC to make such a change appear. As I stated before, I maintain that none of the randomness is caused by a differences in the photon count between the two resistors.

You state "If background light were the primary cause, we should expect the RNG to work without the addition of light, it does not." That is because photoresistors will not output a voltage below a threshold voltage. Get rid of the laser and beamsplitter and just place the device under a normal lightbulb. If you angle the device/light bulb correctly, it should produce the same exact effect.

"Possibly, but I don't think it will be operating on the same principles" -- it's operating under the same exact principles of measuring inaccuracies in the Arduino ADC (feed a constant voltage from a bench power supply into the Arduino, the voltage displayed will not be the same).

"The laser point starts out big and gets smaller, if it were perfectly polarized there would be no beam widening." I'm pretty sure beam divergence has nothing to do with polarization...

"Well, this design is specifically so that we can use a collection of photons to perform the computation and avoid the very pricey components" Like I said, that would work if you could accurately count the number of photons without other factors changing the output voltage to a greater degree than the variance of light itself.

Quantizr avatar Mar 10 '21 05:03 Quantizr

Forget what I said above, its all a big jumble of thoughts, but my main conclusion is this. Use your same setup, same code, same photoresistors, but get rid of the beamsplitter and laser. Place a lightbulb close to the photoresistors and tune for bias. You should see randomness in the exact same way as you had with the beamsplitter and laser.

Now that I think of it, I know exactly why your original design does not work as you think it does. A back of the napkin calculation says that if you have a 1mW laser with photons equally divided across two photoresistors, each photoresistor would receive around 160 billion photons every 104 microseconds (Arduino ADC time interval). Optimally, each photoresistor would receive exactly 160 billion photons over the time interval, but we know that isn't always the case. We do know that the amount of photons received follows an approximately normal distribution (photon shot noise follows Poisson distribution, approaches normal at large counts). We can calculate the margin of error (use alpha 0.05 for convenience) = 1.96 * √0.5 * (1 - 0.5) / √160,000,000,000 = 1.73241161e-6 which is an approximately 0.000173% margin of error. Let's assume that at precisely 160 billion photons/104microseconds, the photoresistors output exactly 2.000000 volts.

So, if your measuring equipment is be able to measure voltages an an accuracy of 0.00346*2 = 0.00692mV, 95% of the time the voltages will still be measured as equal, much less using the 4.88mV which an Arduino can measure to.

Phrased another way, 95% of the time, the voltage output of an ideal photoresistor would be within 0.00346 mV of the mean, so in order to meaningfully measure differences in voltage, your equipment must be accurate to a voltage much less than 0.001 mV, compared to the arduino's 4.88mV measuring accuracy.

Phrased a third way, 95% of photon counts would be within 553,600 photons of each other. In order to compare photon counts between the two photoresistors and minimize the chance of photons being measured as equal, your way of measuring photons must be accurate to a few thousand photons, which is a lot better than having to use single photon detection, but is still something which photoresistors + an arduino cannot do. For reference, your setup can only count photons (assuming no outside noise) to an accuracy of around 400 million photons.

I keep making edits, but phrased a fourth way, the reason why your design does not work is you cannot express a value many times smaller than 0.000173%(and that # of decimals for any number from 0% to 100%) in 10 bits which is all the Arduino is capable of measuring.

Hopefully my explanation made sense

Quantizr avatar Mar 10 '21 05:03 Quantizr

I'm sure every random function is influenced by quantum events of the past, but I like this toy example

C-Bookie avatar Nov 09 '21 00:11 C-Bookie

The system used in this case is called a vacuum fluctuation QRNG and is indeed a well proven concept. The doubt regarding this hardware realisation however, is understandable. I will experiment with this setup and give my feedback how well it works or what improvements could be made aswell...

QbitCreator avatar Jan 16 '22 17:01 QbitCreator