I was curious about quantum computing and wanted to see what was all about. I learned some basics. I realize that superposition was similar to a biased randomness and that entangled can be represented with a formula which relates two qubits :
correlated ? (bQubit = aQubit = (aCollapse ? collapse(aPercentOne) : collapse(bPercentOne))) : (correlated = 0); //qubits entangled
Qubits are like bits but can be at the same time a percentage of |0> and a percentage (until 100% in total) of |1>. If they are entangled, the one that collapses first, "drags" the other to the same state or the contrary, depending on how are they correlated. I use the words correlated and entanglement indistinctly.
SuperpositionFor simulated superposition we need biased aleatoriness, For creating true randomness we need a "seed" based on analog pin A0 or any other.
randomSeed(analogRead(A0));
If we created a randomness which starts and finish different of 0 and 200 we biased the behavior of qubits. That provides overlap very similar to the real one.
//Ex. percent of be a one: 25%
bool collapse(int percentOne) {
int percentZero = 100 - percentOne;
return random(100 - percentZero, 100 + percentOne) > 100 ? 1 : 0;
}
qubit_entangled.ino firmwareFor representing the quantum bits, you can use LEDs.
Once loaded the first program, qubit_entangled.ino, It is important to open the Serial Monitor and answer the questions asked:
- Percentages of being a one of both qubits
- If they are entangled
- Which qubit collapse first.
Before, you can mount the circuit:
It not necessary to use the button and the third LED for this example of code.
qubits_six_OR_nov10_2020 firmwareThis second code what does is a operation with two pair of three qubits. Although we do not use instructions of quantum computing, we use AND an OR operations that have an equivalence in other similar in quantum computing.
This firmware requires the three LEDs-Qubits and the button to stop/resume the program
With each firmware, we can see the behavior of qubits depending on the percentages of being |1> and |0> of each one. LEDs also provide a better comprehension. And Serial Monitor helps. And I think that the set simulates very well qubits using only Arduino.
I have not pretend being exact but creative in all case.
Possible BetteringIn my opinion we could use a joystick for change the percentage of being |0> and consequently of being |1> of two qubits in real time, so learn speedily how affects the final collapses. A joystick would no more that two potentiometers, one dedicated for each qubit.
Comments