How does a quantum computer work?

A quantum computer works in a totally different way from a classical computer. Quantum bits or ‘qubits’ can exist in a superposition state of both zero and one simultaneously. This means that a set of two qubits can be in a superposition of four states, which therefore require four numbers to uniquely identify the state. So the amount of information stored in N qubits is two to the power of N classical bits.

Video source: Veritasium / YouTube.

View Transcriptarrow

DEREK MULLER, NARRATOR: A classical computer performs operations using classical bits which can be either 0 or 1. Now in contrast a quantum computer uses quantum bits or qubits and they can both be 0 and 1 at the same time and it is this that gives a quantum computer its superior computing power. There are a number of physical objects that can be used as a qubit: a single photon, a nucleus or an electron. 

I met with researchers who are using the  outermost electron in phosphorus as a qubit, but how does that work? 

Well, all electrons have magnetic fields, so they’re basically like tiny bar magnets and this property is called spin. If you place them in a magnetic field they will align with that field just like a compass needle winds up with the magnetic field of the earth and this is the lowest energy state so you can call it the 0 state or we call it, for the electron, spin down. Now, you can put it into one state or spin up but that takes some energy. 

ASSOCIATE PROFESSOR ANDREA MORELLO: If you took out the glass from your compass, you could turn the needle the other way, but you would have to apply some force to it. You would have to … push it to the other side. That is the highest energy state. In principle, if you were so delicate, to really put it exactly against the magnetic field it would stay there. 

DEREK MULLER, NARRATOR: Now, so far, this is basically just a classical bit, it’s got two states, a spin up and spin down, which are like the classical 1 and 0. But the funny thing about quantum objects is that they can be in both states at once. Now, when you measure the spin, it will either be up or down, but before you measure it, the electron can exist in what’s called a quantum superposition, where these coefficients indicate the relative probability of finding the electron in one state or the other. 

Now it’s hard to imagine how this enables the incredible computing power of quantum computers without considering two interacting quantum bits. Now, there are four possible states of these two electrons. 

ASSOCIATE PROFESSOR ANDREA MORELLO: Well, you could think that’s just like two bits of a classical computer, right? Like if you have two bits, you can write 0, 0; 0, 1; 1, 0; 1, 1. There’s four numbers. But these are still just two bits of information, right? All I need to say to determine which one of the four numbers you have in your computer code is the value of the first bit and the value of the second bit. Here instead, quantum mechanics allows me to make superposition of each one of these four states, so I can write a quantum mechanical state which is perfectly legitimate. There is some coefficient times this plus some coefficient times that. So to determine the state of the two spin system, I need to give you four numbers—four coefficients. Whereas in the classical example, of the two bits, I only need to give you the two bits. So this is how you understand why two qubits actually contain four bits of information. I need to give you four numbers to tell you the state of the system, whereas here I only need two. Now if we made three spins, we would have eight different states. I need to give you eight different numbers to define the state of those three spins, whereas classical is just three bits. If you keep going, what you’ll find is that the amount of equivalent classical information contained by N qubits is 2 to the power N classical bits. And of course, the power of exponentials tells you that once you have 300 of those qubits in what we call the fully entangled state, so you must be able to create this really crazy state where there is a superposition of all three others being one way or another way and another way and so on. Then, you have like 2 to the 300 classical bits which is as many particles as there are in the universe.  

DEREK MULLER, NARRATOR: But there’s a catch. Although the qubits can exist in any combination of states, when they are measured, they must fall into one of the basis states and all the other information about the state before the measurement is lost. 

ASSOCIATE PROFESSOR ANDREA MORELLO: So you don’t want generally to have as the final result of your quantum computation, something that is a very complicated superposition of states because you cannot measure superposition. You can only measure one of these basis states. 

OFFSCREEN: So up and down?

ASSOCIATE PROFESSOR ANDREA MORELLO: Yep. So what you want is to design the logic operations that you need to get to the final computational result in such a way that the final result is something you are able to measure. It’s just a unique state. 

OFFSCREEN: There’s no trigger?

ASSOCIATE PROFESSOR ANDREA MORELLO: There’s no trigger. Essentially, I mean, I’m stretching things here, but I guess it is to some degree the reason why quantum computers are not a replacement for classical computers. No they’re not. 

They’re not universally faster. They are only faster for special types of calculations where you can use the fact that you have all this quantum superposition available to you at the same time to do some computational parallelism.  

If you just want to watch a video in high definition or browse the Internet or write a document in Word, they’re not going to give you any particular improvement. If you need to use a classical algorithm to figure this out. 

So you should not think of a quantum as something where every operation is faster. In fact, every operation is probably going to be slower than in the computer you have on the desk. But it’s a computer where the number of operations required to arrive at the result is exponentially smaller. So the improvement is not in the speed of the individual operation, it is in the total number of operations you need to arrive at the result. That is only the case in particular types of calculations, in particular algorithms. It’s not universal, which is why it’s not a replacement of a classic computer. 


Quantum computing

Latest videos

How fun with lasers led to a Nobel Prize

Video: How fun with lasers led to a Nobel Prize

Small devices solving big problems

Video: Small devices solving big problems

Year that was 2021 in science

Video: Year that was 2021 in science