top of page
Writer's picturemansour ansari

The math for quantum computing made easy: 2 Qubit system

Updated: Jan 22, 2022

Suppose you intend to find the prime factors of a 2048 bit number. In that case, it would take classical computers millions of years but, a quantum computer could do it in just minutes. And that is because a quantum computer is built on qubits. These devices take advantage of quantum superposition to reduce the number of steps required to complete the computation, which is the key in solving computationally intensive calculations, searches, optimization, not deterministically but probabilistically. That is a powerful tool to solve the big problems humanity faces today. But how do we actually explain the basic math behind the qubits?


The math behind the quantum computer is solid, and that is why everyone is trying so hard to build more reliable qubits - the race is going. With about 100 qubits that work near perfect, whoever makes them first, can potentially claim the front-runner, the leader of the quantum advantage era. Quantum advantage undoubtedly will help humanity in so many different ways that we can't even anticipate yet. The true potential of quantum computing is unknown at this time, but we know from doing the math, with about 1,000,000 perfect qubits with long coherence time, we know it will be a game-changer.


Part 1 - I explain the math behind 2 qubit and next posts will cover the 6 qubit and N qubit systems.


Here is the math behind 2 qubits . First I start with 4 basic states of qubit system.

Understanding the fundamentals is an essential part of understanding quantum computers. If we can understand the 2 qubit math, it becomes easy to understand N qubit concept. For me, researching this post was a good learning experience, another convincing reason to love quantum computing. Once I understood how the math behind only 2 qubit system works, it became apparent that 2 to the power of N qubit is truly a new exciting way to calculate and solve intractable problems, way beyond the ability of our best super computers.

Let's start by 4 states of the each qubit. So, there's four basic states 00,10,01, 11. (Above)


These are the states that two classical bits can exit. But there are also infinitely many states formed by superpositions, or combinations of these basic states. That's the key here. It is a hard concept to visualize as if the qubit staying in a limbo, suspended, incomplete - but it is not!. Let me explain.


Do you remember the Gate building for the classical bits? We also need to do gates with qubits to flip them. Each operation of a quantum computation is performed by a quantum gate (there are many different gates,) which, like a classical gate, changes (flips) the state of the qubits whatever they are and flips them. So let's start our quantum computation in state 00, and then apply a quantum gate.

Now, the qubits are in a superposition. There's a one half probability or 50% chance of being 0 1. And a one half probability of being 1 0.

What is the square root there? For now ignore the square roots, I'll explain them later and it makes better sense. The particular superposition is the result of the quantum gate we chose to apply.


What happens if we apply another gate it again?

Here's a quantum gate applied for second time, changing the state of our computation again.


At the end of the quantum computation, we observe or measure the system. But as soon as we measure, collapsing the wavefunction and revealing a single basic state, in this case, a collapse to state 01.


If you run the same computation repeatedly, the final result will be 0 1 half the time, it'll be 1 0 16th of the time, and 11 1/4 of the time. The numbers in the superposition tell you the probability that the superposition will collapse into each basic state.


Suppose you run the computation 100 times, what happens then roughly 50 times it will result in state 0 1, 17 times it'll result in state 1 0, and 33 times it'll result in state 1 1. This allows you to recover the probabilities and therefore the final superposition of the computation. I understand you may say, this doesn't seem very efficient with two qubits, but I can show you that it can save you a lot of time with more qubits. So what's the math behind this?

Part 2- The above post covered the 2D version of math behind the qubits. Next post will cover the Sphere space.

32 views

Recent Posts

See All

Comments


bottom of page