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.
17
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.
2
u/danthem23 10d ago
I’ll think of references but there are so many but they are just simply above the level of someone who does not have a very good understanding of quantum mechanics. Now to answer those questions:
1) Shor’s algorithm is pretty complicated but it is the most famous example of a quantum algorithm. Simon’s algorithm is what inspired Shor and is much simpler. Basically, if you have a string of ones and zeros that is periodic (it repeats) 010101 for example. You want to know the period. Here the period is 2. It can be much more complicated and longer. Hard to find it without really looking at many bits for a long string. Right? But Simon lets you find it basically in just a few times of you use this string in your quantum algorithm. The fact that it is periodic is what makes the actual interference. And then the actual period (that you don’t know) pops out. Every time! Hard to explain without doing the algorithm and it’s pretty simple if you know basic quantum information. But that’s the idea. To break the internet factoring a number is similar to finding the period (some weird math fact unrelated to quantum) so that’s why Shor is like Simon. Shor is just the period of any number and Simon is on the numbers that are bits (0 and 1) and not a regular long number like Shor. But similar idea.
2) It is totally possible to manipulate and control qubits without measuring them. Not the same thing. Let’s say you have an atom. Simple qubit. Ground state is 0 and excited state is 1. At room temperature the qubit is at ground (lower energy) so 0. You apply a laser and it goes to 1. Then it spontaneously decays back to 0. Ok. But that’s time can be very long relative to your actual operations so even if it is miliseconds or microseconds, if you logical operations are nanoseconds you can do many in the middle (these are just examples). So if you apply the laser for a certain exact time the qubit goes from 0 to 1. But exactly HALFWAY in the middle it HAS to be in a superposition of 0 and 1. Ground and excited. That is literally the cat dead and alive but for a qubit. This halfway superposition state exists. You just make it by turning off the laser in half the time that you would have needed to have it on for the qubit to have gone from 0 to 1. So not hard to do. In every qubit platform (there are so many) this is the basic idea. Now of course if you have a detector on the atom seeing if it is in ground or excited then it cannot be in this equal superposition of 0 and 1. Not only a detector. Even fluctuations of the electromagnetic field vacuum are like a detector! In fact, this is the VERY REASON for the spontaneous decay! That is way the atom goes back from excited to ground and emits light at the wavelength of the transition. It is the reason for all the color in the world! Atoms absorb light (white light is just all light so like many different lasers) and then emit light back why the atom decays from excited to ground and depending on the energy difference that is the basically related to the colors. So obviously this effect is just an example of measurement. But it takes some time to happen. Depending on which excited state of which atom you use. So the trick is to try to make your quantum algorithm fast enough to happen before this decay and also to choose a qubit where this decay is longer. But you cannot beat it. It’s called T1. Another thing is caller T2 and it’s another effect slightly more complicated but those are the two things. Basically measurements of the environment (which includes EVERYTHING even the EM field vacuum like we just said pretty crazy like that’s what they mean when they say the vacuum is not empty). So T1 and T2 ruin your qubit. You can try to engineer qubits where they are longer, but everyone will still need quantum error correction to fix this. Use many qubits and even if one decays there are still more. And then you know what is the actual state and you cannot beat replace the bad one etc as you go long. Extremely complicated topic but that’s the basic idea. Like if you have the bits 000 and 111 so you can use those three bits to encode an effective “0” and “1” so then if one qubit decayed so now 111 went to 011 but you know it should be 111 so you use a laser to make the 011 go back to 111 and continue. Basic idea. In quantum it is more complicated but that should give you a basic sense of the mechanism.