To start talking about quantum computing it is necessary to understand some concepts first, such as superposition and entanglement. Superposition is the property of a particle having two quantum states at the same time, we can use the image below as a “simpler” example to understand.
Entanglement is when we have two particles in a state that one influences the other. We can think that it’s as if we had two things, with two cats, where the state of one directly influences the other (if one is alive because the poison doesn’t work, the other is also alive).
In classical computing we have the bits represented by 0 and 1 and basically three main logic gates: AND, OR and NOT. We can think of the zero as not passing energy, and one as the opposite. Now, in quantum computing we have the QUBITS, where they can represent either zero and one since they are in superposition. Unlike classical computing, it is possible to have a much higher number of logical gates , as they are all defined by matrices. I know it’s a lot of information, so let’s break it down.
The qubit is represented by a particle, preferably a photon, that has something called a spin (all particles have it by the way). Spin can be interpreted very basically (but not quite correctly) as the magnetic orientation of the particle. Keeping this in mind, we can see in the figure below the comparison of a bit to a qubit.
A mathematical view for the qubit would be a sphere with values of 0 at the top and 1 at the bottom. To “change” the value of the qubit we can rotate the sphere (in quantum physics we say that we apply an operator). One of these operators is Hadamard, in the quantum circuits we can see them as the logic gate with the symbol H.
The qubit in the quantum circuit can be initialized in state 0. To place it in superposition we can use the Hadamard operator, which works by rotating the qubit by 90° degrees, leaving it between 0 and 1, thus placing the state in superposition. For the curious, the quantum state of superposition is mathematically given by:
With the qubit being able to be changed through an operator, the quantum computer ends up having more possibilities of combinations of bits, favoring some applications.
The classical computer is excellent for returning accurate results, such as 2 + 2 = 4. The quantum computer, on the other hand, works with probability, that is, to perform a calculation it is necessary to run the program several times to obtain a high probability of success. Due to the greater number of possibilities, some calculations are very effective in the quantum computer, such as factoring numbers.
When we look at the number 16 we know that it is possible to factor the same into 2 x 8 or 4 x 4. Factoring numbers is the basis of encryption, when we send a message over the internet it travels as a large number accessible to everyone. But only where the message is received do we have the key to understand the message. Example:
“On your computer you have the key 2 and send a message 8, the encrypted message will “travel” the internet in the form of 16. If the recipient has a key the message can be read.”
Anyway, like the cryptography behind bitcoin becomes almost impossible (if not impossible) to be broken with the classic computer, it would require an absurdly high processing power. For quantum computing the matter is already different. The number of quantum states (combinations) may be greater than the number of atoms in the universe, facilitating this type of calculation, which may lead (in the not-too-distant future) to the end of cryptography as we know it.
Today it is already possible to program on a quantum computer using the cloud, there are also some reliable emulators such as Quantum Inspire. A simple quantum circuit might look like the image below. Each line symbolizes a qubit initialized at state 0, and with the Hadamard operator placing the qubits in superposition.
Where the result of the circuit is a probability of possible states, the number on top of the columns shows the possibility of getting that result. As you can see, to get a good probability it is necessary to run the same program several times (in this case it was run 1000 times).
At the end of the day, the classical computer will not be replaced by the quantum one, there are still numerous activities in which the classic will emerge victorious. It is also very unlikely that one day we will have quantum computers at home, due to the complexity of their functioning, such as operating at temperatures close to absolute zero. Some activities that the quantum computer can perform: data storage, encryption, moving information instantly (internet with ping 0), but those are topics for another time.