Towards Quantum Computing (IV): Not so fast
Are quantum computers the future? In this post we are going to know the advantages and disadvantages of quantum computers.
Hello, Hypers!
Next week I’ll publish the last chapter of the first season of the Towards Quantum Computing series. I want to write about other topics here in Under the Hype but I know there are many things to unveil about Quantum Computing.
So, I propose to stop for now, but I’m sure I’ll be doing another bunch of articles on Quantum Computing shortly. More on this next week.
Now, let’s dive into this new exciting chapter of the series. Today we are going to know the advantages and limitations of quantum computers. By the end of this post we’ll be able to answer the question: Are quantum computers replacing classical computers anytime soon?
Let’s get started!
In case you missed the previous chapter of the Towards Quantum Computing series, here’s the link:
The power of Quantum Computing
The main advantage of Quantum Computing is the parallelism. Qubits can be in a superposition of states so a quantum computer can operate on all of the states simultaneously.
For example, let’s say we want to know the result of a function f(x) applied to a bit x. Two classical computations are needed to find the result for x = 0 and x = 1. But a quantum computer can evaluate both answers in parallel!
The best part is that no matter if x is one or ten bits long, a quantum machine with the same number of qubits still needs just one operation to evaluate all the answers! The following illustration shows the example of x being two bits long and a quantum computer with two qubits:
This is a huge difference between Quantum Computers and Classical Computers. Adding a qubit to a quantum computer doubles its processing power. To double the processing power of a classical computer you would need to double the number of wires in the processor. That’s why the processing power of quantum computers is measured by the number of qubits it has. If a quantum computer has n qubits, then it can perform two to the power of n operations at once!
Note: From now on, we’ll denote two to the power of n as
2^n
.
Now let’s talk about memory. In a standard 64-bit laptop, each number can be represented using 64 bits. If you want to store four numbers in such a machine, then you need to have 4 * 64 = 256 bits of memory. In general, for M different numbers, you need M * 64 bits of memory. That means that the bits needed for memory are linear as a function of the numbers to store.
On the other hand, on an n-qubit quantum computer, there are 2^n
different coefficients of the quantum state that could hold the numbers. So, these coefficients can be used as memory. That means that the qubits needed for memory are logarithmic as a function of the numbers to store.
It seems that Quantum Computers are the real deal! Is there any reason to not use them? (in case we could have one in our home)
Limitations of Quantum Computing
Well, this parallelism story looks amazing but it is not as good as advertised. Yes, a quantum computation can calculate a superposition of 2^n
numbers in a single operation. But at some point, we’ll need to measure it to extract information. If you have been following this series, you know that measuring collapses the superposition to a single state. That resulting state is unpredictable and follows a probability distribution determined by the coefficients of the superposition.
We have all the 2^n
states but we can see just one of them on each measure. That means that we’ll need to measure at least 2^n
times to get all the states that form the superposition. The consequence is that we’ll need to run the quantum computer 2^n
times to get all the results. So, we won’t get any advantage from quantum computing!
We’ll let’s stop there. Quantum computers are practical indeed, but just for certain types of problems. Since quantum computers are built on quantum physics principles, we intuitively expect that they would be best suited for simulating quantum phenomena. In general, these types of problems look for correlations between different outputs.
That’s why it is generally accepted that quantum computers won’t replace classical computers but will be able to perform different calculations that classical computers simply cannot.
Next week, we’ll see an example of a problem that a quantum computer can solve more efficiently than a classical computer. It will be our first quantum algorithm! Finally! But also, it will be the last chapter of the first season of the Towards Quantum Computing series. I want to write about other topics.
However, as I said at the beginning of this post, I know there are many things to unveil about Quantum Computing. That’s why I’m saying it will be just the season finale. I’ll be back soon with another bunch of articles on Quantum Computing.
Conclusion
Quantum Computers have the advantage of parallelism. We can double the processing power of a quantum computer by adding just one qubit. Also, the qubits required to store n numbers is a logarithmic function of n. Those are great advantages over classical computers.
But there is also bad news in the Quantum World. Although we can have a superposition of many states, we would need to make an exponential number of runs to get all of those possible results. This means that those advantages are not as good as advertised. In general, quantum computers are best suited for just some kinds of problems.
Next week, on the season finale, we’ll implement our first Quantum Algorithm and discover one example of a problem in which quantum computers are faster than classical computers.
That’s all for today. If you enjoyed this post, please let me know by hitting that heart button, writing a comment, and sharing it with your friends. I appreciate it a lot. Now that you know that I’m taking a break from Quantum Computing maybe it is a good time to suggest some topics you’d like me to cover here in Under the Hype.
Thanks for reading me for another week. See you soon!