Image for post
Image for post
Photo by Markus Spiske

QC — What are Qubits in Quantum computing?

Qubits are the core component in quantum computing. With superposition, we can encode an exponential amount of information that can scale a solution better than classical computing. In Part 1, we take a look at the motivation for quantum computing and study some quantum mechanics principles. In part 2 here, we go into the core of quantum computing and demystify the concept of qubits.

Superposition

The concept of superposition is important because this is what qubits (quantum bits) about! So let’s start developing a mathematical model for the spin. Don’t get scared, it is pretty simple. The pace will be slower in this section so you can take time to adjust to the notation in quantum mechanics. It builds the foundation of something pretty fun. Also, the math is far more simple than reconciling the theory with intuition.

When we say the spin of a particle is in a superposition of states, it simply means it is in a linear combination of up spin and down spin. Here is the equation in the Dirac notation.

Image for post
Image for post

The coefficient α is called the amplitude.

Image for post
Image for post

Here, the up spin and the down spin states are just the basis vectors. The concept is similar to the x, y basis vectors in the law of motion in Physics.

Image for post
Image for post

The Dirac notation |ψ⟩ is just a short form for a matrix.

Image for post
Image for post

|0⟩ and |1⟩ are the two orthogonal basis vectors that are encoded as:

Image for post
Image for post

It also has a dual form written as:

Image for post
Image for post

The math is simply matrix multiplication and linear algebra. We just shorten it with Dirac notation. Once you get familiar with it, we can take a lot of short cuts to manipulate them easily. For example, the inner product of two orthogonal basis vectors ⟨0|1⟩ is the multiplication of the 1 × 2 and 2 × 1 matrix. It is always zero. The inner product of any superposition is one, i.e. the total probability = 1.

Image for post
Image for post

Here are some more superposition states and the corresponding matrix.

Image for post
Image for post

If you want more details on the notation again, here is a summary for your later reference. But let’s get into something important.

Between measurements, we can manipulate the superpositions. But when we measure the up spin, the superposition collapses to one of the possible states, i.e. either |0⟩ or |1⟩. This is the core principle of quantum dynamics, and how nature works. Let’s say a particle is in:

Image for post
Image for post

The chance that it collapses to a particular state equals the square of the corresponding amplitude. It turns out this method models the experimental results very well. In our example, the chance of measuring the particle in up spin is therefore 1/2.

Image for post
Image for post

There is one obvious rule we need to follow. The probabilities of measuring all possible states add up to 1 (⟨ψ|ψ⟩=1). To enforce this, we make

Image for post
Image for post

We can visualize the superposition as a point lying on the surface of a unit sphere. The up and down spin is just the north and south pole of the sphere respectively. So the red dot below is another example of a superposition state. When it is measured, nature forces it to take a side, either up or down.

Image for post
Image for post

But I am not 100% honest with you. To really have the superposition represented as the Bloch sphere above, the amplitude α can also be a complex number like:

Image for post
Image for post

Here are the values of the superpositions in the six corners.

Image for post
Image for post

To calculate the probability, we compute the square of the norm, i.e. multiply the amplitude with its complex conjugate. (The complex conjugate of 3+4i is 3–4i)

Image for post
Image for post

Let’s have a quick recap on “bits v.s. qubits”. A bit represent one of the two possible values, 0 or 1. A qubit represents points on the surface of the unit sphere. For round 1, a qubit wins over a bit on how many states that it can represent.

Image for post
Image for post

In addition, we can combine quantum states in forming a composite system. By the principle of quantum mechanics, a composite system is modeled by a tensor product.

Image for post
Image for post

where

Image for post

For example, this is a composite system with 2 down spins and 1 up spin:

Image for post
Image for post

Soon, we will see why this is so powerful — something that classical computing cannot deliver. Here is another 3-qubits example:

Image for post
Image for post
Source

Below is the general equations describing a 2-qubit system. It composes of the spins of 2 particles.

Image for post
Image for post

So the new quantum state has 4 computational basis vectors, namely |00⟩, |01⟩, |10⟩, and |11⟩ with 4 complex coefficients.

Image for post
Image for post

For 3-qubits, we have 8.

Image for post

The system grows exponentially. 64-Qubits has

Image for post
Image for post

basis vectors. The biggest US lottery jackpot was 1.6 billion dollars. Two to the power of 64 is about winning the biggest lottery 30 billion times. With 64-qubits, we can encode and manipulate a lot of data using these billion-billion coefficients (dimensions). Qubits win round two.

Increasing the qubits linearly, we expand the information capacity exponentially.

But, there is a big catch! We can manipulate information in a very high dimensional space but we cannot read those coefficients directly. When all operations are completed, the only way to “read” the qubits is to measure it which returns one of the states only (not the coefficient).

Image for post
Image for post

When qubits are measured, the capacity is no different from bits. It’s extremely tricky to design algorithms under this constraint. We have a turbocharged concept but the way to do things are awkward. We will come back to this later.

Image for post
Image for post
Source

Next

Now, we understand the Qubits, the equivalent of bits in the classical computer but far more powerful. In a classical computer, we have +, -, ×, ÷ operators to manipulate bits. Quantum computers have none of them. So how do we manipulate qubits? This will be answered in the following article.

Here is the index for the whole series:

Written by

Deep Learning

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store