The Qubit Report

Adarsh Kishore


Quantum computers, you might have heard, are magical uber machines that will soon cure cancer and global warming by trying all possible answers in different parallel universes. There’s so much hype around them these days that you might think that they’ll soon get you free from doing DSA with awesome time complexities. Sorry, but that’s not happening anytime soon.

Putting all the hype aside, under the hood there is a lot of interesting stuff going on. Understanding all of it will require some basic knowledge from mathematics (here it is again) and quantum physics, the parent of quantum computing, and I’ll guide you in doing so. But before we dive into the technicalities, a bit of historical context is always interesting.

The OG, Richard Feynmann

Richard Feynmann was one of the leading physicists in the 20th century. He made lots of contributions to quantum physics, especially in the field of quantum chromodynamics, which he founded. Don’t worry if you don’t know what that is, I don’t know either 🙂

Feynmann was hungry for a window into the quantum world. The problem is that quantum mechanical systems are inherently fragile, and they collapse back into classical systems just by observing them (we’ll define this more rigorously later on. For now, it suffices to understand that by observing them, they lose information). Therefore, he wanted a computer that could simulate such a system, which could then be observed without losing anything (it’s your program now, after all).

If you have done some programming, then you can easily understand how hard it is to simulate something. For quantum systems, Feynmann found that his computer does not have the required processing power. This is because the quantum world is much much richer than the classical one. To be able to simulate only a small quantum environment, you need more bits than there are atoms in the universe. A classical computer simply can’t do it.

Then he had an idea. Why not use a computer using properties of quantum mechanical systems to simulate? Thus, the idea of a quantum computer was born, and with it, Feynmann started to build a bridge between quantum mechanics and computer science.

With this, let us jump into the realm of the subatomic!

It Comes in Waves

In quantum physics, an entity can exist as both a particle and a wave simultaneously. For example, you might have heard of the electron wave-particle duality. If this seems counterintuitive to common sense, then this is only the beginning! The quantum world is completely different from the classical one we are used to, and it makes no attempt to appeal to our common sense. Here, apples can be oranges one moment and go bananas the next. The only thing it shares with our world is mathematics, and therefore we’ll use that to dig for more information.

When a quantum system is not under observation, then the entities exist in the form of waves. Like we say that there is an ‘electron cloud’ around a nucleus, not an electron particle. The cloud refers to the wave nature of the electron. However, when we try to observe the system, just by our observation, the wave collapses into a particle. Just how it collapses is encoded in the wave itself.

If we consider waves, then concepts like amplitudes and wavelengths make sense. Although wavelengths also have their own importance in quantum mechanics, for our purposes, it is enough to understand the role played by amplitude.

Amplitude is just the maximum height the wave can get to from the baseline. And the conventional interpretation of quantum waves is in terms of a probability wave. That is, the amplitude at each point of the wave tells us the probability of finding the particle at that point if we were to observe the system and collapse it.

Therefore, if the amplitude at some place is very high, that means there is a very high chance to find the particle there if we looked at the system. For example, in an atom, the amplitude is the highest in concentric circular rings around the nucleus, what we call orbits. Orbits aren’t definite paths followed by electrons, they are just the places where finding them has the highest probability.

To be sure, we are not saying that the amplitude is literally the probability. Firstly, the probability is just a number between 0 and 1, while amplitude can be anything. Also, these waves are not 1D as shown in the diagram, but 3D waves.

But there is a correspondence between them in that the higher the amplitude, the greater the probability.

Now a question may arise in your mind: if everything is just a random probability, how will a quantum computer give me an answer to anything? Good question, and here comes the answer: via interference.

Interference Comes in Two Flavors

That’s right, constructive and destructive. When two waves pass through each other, they do something called a superposition. The amplitude at a point becomes the sum of amplitudes of the individual waves.

If the resultant amplitude is less than the original amplitudes, the waves are said to have destructive interference. And the opposite case is called constructive interference.

Example of destructive interference, in which both waves cancel each other to give the black wave

How does this relate to quantum computing? For this, we finally come down to the smallest unit of information that can be stored in a quantum computer: the qubit.

Qubit

The smallest unit of information that can be stored in a classical computer is the bit: binary digit. A bit can take two values, 0 and 1.

Analogously, the qubit is the ‘bit’ of quantum computers. It is a quantum mechanical system that can occur in two states. However, here comes the quantum twist: by the principle of superposition that we discussed above, it can also exist in both these states simultaneously. To understand this better, let’s call its states 0 and 1. Needless to say, these ‘0’ and ‘1’ are quite different from the bit values of classical computers.

Then the qubit can be in 0 and 1, and in any linear combination of them as well.

In terms of this picture, the top and bottom correspond to the states of absolute 1 and 0 respectively. However, the arrow can also point somewhere in between, for example, the equator corresponds to a 50-50 chance of both states simultaneously (Of course, the qubit doesn’t look like this. I gave the example only to make the linear combination point clearer).

Before you measure a qubit, it can exist in a superposition of every possible state, and the probability that it will collapse into some state upon observation is given by the amplitude of the wave at that point. This also explains why to simulate a single qubit, you would need an exorbitant amount of classical bits, the same problem which Feynmann came across when he first thought of a quantum mechanics simulator.

How an algorithm works is that it will increase the amplitudes of the states corresponding to the correct answer, and decrease the amplitudes of other states. Then the probability of getting the right answer becomes high. 

But hey wait, computers are deterministic machines, not probabilistic! If I give the same input I should get the same output every time, no? How is this gonna help me? Well, there is one field where we do get probabilistic answers, and that is machine learning. The accuracy of an algorithm is measured by a percentage; scaled down by 100, with a probability between 0 and 1.

This is where quantum computing can be of much use. Since a single qubit stores so much more information than a classical bit, memory requirements will drastically decrease, time complexities will get crazy better, and the average quantum computer will pack more power than the biggest supercomputers around now.

All this sounds awesome, at least in theory. In practice, well, there are a few problems arising due to our non-idealistic world which physics never takes into account. (Here’s air resistance looking at you 🙂 )

It’s All Getting Entangled

A single qubit is not that much of use, is it? Although capable of storing many more states than a bit, without context it’s all useless. For providing context we need other qubits also, and they must act in a way that is mathematically related (All of them going into completely random states doesn’t help much).

The physics term for this is called entanglement. When two qubits are entangled together, their behaviors and states get related to each other, in that given the state of one of them, you can predict the state of the other. 

The two qubits are entangled together, and each one’s state influences the other

To give a classical analogy, you can consider a book. But this is a very special kind of book. When you look at each page individually, you are unable to understand anything, it is all gibberish. It is only when you turn the pages one after the other and see all of them together in correspondence with each other, that it starts making sense.

In quantum computing also, an individual qubit state doesn’t tell anything. It is only when you look at all of them collectively that it starts making sense.

So fine, what’s the issue? We can entangle a lot of qubits together and that should give us our quantum computer right? Well, not quite. For one thing, entanglement is quite hard to maintain. For even two qubits, the slightest disturbance can cause decoherence between them, causing them to get unentangled. And I don’t need to tell you how much noise and fluctuations occur in our world 🙂

For this reason, quantum computers are usually kept in a vacuum, near absolute zero. Obviously, this isn’t practical for large-scale production. Also, designing a quantum algorithm is no easy task, as rather than conventional deterministic programming, now you need to deal with probabilistic qubits and waves.

For all these reasons, quantum computers are still much slower than classical computers in practice (No, they’ll not save you from DSA. Go grind it :D). Nevertheless, recent advances in this field by giants like Google, IBM, and Microsoft have shown promising results.

Conclusion

Quantum computing is still very much in its infancy. However, it is advancing at a rapid rate, much faster than the rate at which classical computers advanced in the 1950s. The time is not too far off when they’ll be used like classical computers are used today.

Potential applications are numerous. One is obviously in machine learning. They have applications in cryptography also, as they can find the prime factors of a number much faster than classical computers. This means that the state-of-the-art encryption of today’s time will be rendered obsolete by them. 

In the next part of this blog series, we will explore some of the potential applications of quantum computing.

Check out Part 2 by IEEE here!

With mathematics and computer science coursing through his veins, Adarsh really does have the IT factor. Often getting lost in fictional worlds methodically handcrafted by Isaac Asimov and Brandon Sanderson, solving differential equations while listening to his favorite jams has proven the best way to keep him grounded.


Leave a comment