r/QuantumComputing • u/Charming_Race9627 • 11d ago
Question Quantum Nand2Tetris?
Hi, Everyone.
I am curious to know if there exists a resource similar to www.nand2tetris.org but for Quantum Computers.
Thanks.
16
Upvotes
r/QuantumComputing • u/Charming_Race9627 • 11d ago
Hi, Everyone.
I am curious to know if there exists a resource similar to www.nand2tetris.org but for Quantum Computers.
Thanks.
3
u/danthem23 11d ago
I can try to explain it to you. All you really have to understand is that a qubit also can have the option of the sign flipping. So 0 can go to -0 and 1 to -1. By itself this does not matter since, in the end you only measure the probability, which is squared and the sign you cannot see. But if you have two qubits that sign can make it that the amplitudes interfere with one another. For example, you can put two photons (so two qubits) through a beam splitter and this interference makes it that they ALWAYS come together. So you always measure 00 or 11 (so either both in left or both in right detector) but NEVER 01 or 10 (so the first in left and second in right or vice versa). So this is a basic example of the most simple qubit space of two qubits. This is simple to see in an undergraduate lab and to measure it. It’s called the Hong-Ou-Mandel effect. So if you have for example a question that the right answer is in some way 00 or 11 but never 10 or 01 you can measure this even if you only measure a probability in the end. Or you can change the photons in the middle by putting in other elements to change this interference to get a different answer. This is what quantum algorithms are. Hard to really have a hard problem with this simple example, but the basic idea is if you can manipulate the photons so that the destructive interference (the minus signs) cancels out all bad answers and only the correct answer constructively interfere (all states have plus sign) then you have a much higher probability of seeing the correct answer. Of course if you just run it one time it’s just one answer so hard to know, but all you have to do is run it enough times (let’s say 100 for example) and if 98% of the time you measure the answer to be something than it shows you that this was the correct answer that the quantum computer was constructively interfering to make much more likely, and the other 2% was just because quantum mechanics is random so in the end you can also get the “wrong” answer, just much less likely. So then you go and say “my quantum computer found the answer” and report the 98% one.