Coder Social home page Coder Social logo

Comments (8)

QbitCreator avatar QbitCreator commented on August 24, 2024 1

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...

from qrng.

dakk avatar dakk commented on August 24, 2024

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.

from qrng.

NoahGWood avatar NoahGWood commented on August 24, 2024

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?

from qrng.

Quantizr avatar Quantizr commented on August 24, 2024

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.

from qrng.

Quantizr avatar Quantizr commented on August 24, 2024

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

from qrng.

C-Bookie avatar C-Bookie commented on August 24, 2024

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

from qrng.

anonfreak191 avatar anonfreak191 commented on August 24, 2024

I think it would be better to put both photo resistors in a voltage divider configuration. There is way to increase your ADC bit count (not physically but virtually), you split the voltage up into two or more analogue inputs, then in your code you can add them up to form a single number with a resolution of more than 10 bits. Also the 5v output of an arduino is very noisy, so its best to add a smoothing circuit. E.g, LDR and resistor voltage divider setup, feed the divider 10v, and depending on light it should vary between 0v to 10v, then run it through another divider to split the voltage 50/50, then run those two varying 0v to 5v lines through an analog pin, in your code you can add them together for a total resolution of 0-2046 which is far greater than the ADC 10bits (0-1023).

from qrng.

Hegezcc avatar Hegezcc commented on August 24, 2024

It is well worth to note, in firmware level (QRNG_BASIC/firmware/v1.1/v1.1.ino) the measurements are done until a difference between analog reads is seen, and that difference (or rather, its side) is then reported as random bit. I personally do not have any numbers about how many times the loop is actually executed, but this primarily causes the generator not to have a time guarantee, but rather trade time for its ADC precision to have a qualifying result. Using more precise ADC, equal photoresistots and their electronic paths shall give faster randomness generation.

from qrng.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.