Intro to Qubits, Round 1

James Wall
The Quantum Authority
8 min readDec 19, 2017

Originally published here:

http://thequantumauthority.com/the-technical-intro-to-quantum/

Okay so hopefully if you are reading this you know what quantum computing is at a high level. If you do not, feel free to head on over here to ground yourself in the basics.

Now it’s time to get into the details of how quantum computing works by talking about qubits.

Are you ready?

Ok, so we know that traditional computers operate off of ones and zeros, right? And quantum computers aim to utilize that space in between the one and the zero.

So how do we do that?

Traditional computers, otherwise known as binary digital electric computers, use electrical signals that come in one of two states: ON or OFF. These signals are represented by a bit. A bit comes in one of two flavors: one or zero. And nothing else. So if our signal is on, the bit representing that signal is a 1. And if our signal if of, then the bit representing the signal is a zero.

I want to make sure that we are clear on one thing before we move forward. A bit is a representation of the information. It is a clean-cut piece of information that is either 1 or 0. An electrical signal is the physical representation of a bit. It is anything but clean cut, but by defining our threshold voltages appropriately we can make do. For example, a signal of 0 to 2 volts could represent a zero while a signal of 3 to 5 volts could represent a one.

Got it? Good.

In order to use the space in between the one and the zero, we need to fundamentally change the bit into something else. What should we call a bit for quantum computing? Why, a quantum bit of course.

Quantum bits (or qubits, for short) are effectively the same as traditional bits. The difference is that in addition to the traditional one and zero, a qubit can also have a quantum state.

Quantum states sound scary, but really it is not too much of a leap to figure out the basics of quantum states.

Anyways, qubits. We know that they need to be able to have states other than zero or one. In order to do this, we need to learn a little bit about a principal called superposition

Let’s forget about quantum computers for a second and talk about superposition as a general concept. In mathematics, the superposition principle states that the output of a given linear system must be the sum of the expected outputs of the inputs to the system.

Let’s break down the superposition principle in an easier to understand way.

Say you have two equations:

  • 2 + 2 = 4

and

  • 1 + 1 = 2

What would happen if you added the left sides of the equation together and the right sides of the equation together?

You would get:

2 + 2 + 1 + 1 = 4 + 2

Or

2 + 2 + 1 + 1 = 6.

Which is what you would expect.

Congratulations, you just figured out superposition. Think of the left side of that last equation as the inputs and the right side as the output. In this system, when we added the inputs to the same system, the output was the outputs of those two individual equations summed together.

Superposition is honestly more or less that, however, it is usually seen in referenced more complicated linear systems than our example above.

What is a linear system? A simplified definition of a linear system is a group of one or more equations, none of which have any variables raised to a power that is not zero or one.

So y = x is linear because that is the same as saying y<sup>1</sup> = x<sup>1</sup>. But y = x<sup>2</sup> is not linear.

Quantum computing works with a flavor of superposition called quantum superposition. It is derived from quantum mechanics. We don’t need to go too far into the technical details of quantum mechanics in this post. Basically, all we need to know is that quantum superposition allows us to add two states together to form a quantum state.

Wait for a second, earlier we asked how we can go about creating a quantum state for a qubit. And now we have discovered that there is a way to create a quantum state by adding two states together. So all we need are two existing states to create a new quantum state, right?

Right. And what has two existing states already?

The qubit! A bit has two states (0 and 1), as does a qubit. So in order for a qubit to create a quantum state, all we have to do is superimpose its two existing states on one another!

That’s tight.

Ok, so let’s make this a little more formal. If we have our two input states, 0 and 1, we can make quantum states. We will refer to 0 and 1 now as |0> and |1> (pronounced “ket 0” and “ket 1” respectively), and we refer to those two states collectively as our basis states.

Given our two basic states, |0> and |1>, we can create a quantum state by superimposing the two. Aka, we will literally add them together.

There is a little bit more to this. We will multiply ket 0 and ket 1 each by their own factor. We will call those two factors ‘a’ and ‘b’ for now. I’ll explain why we need those factors in a moment. For now, we have the following equation:

Quantum State = a * |0> + b * |1>

You know, let’s give the quantum state a variable name too. Let’s name it Ψ (pronounced psi).

So now our equation is:

Ψ = a * |0> + b * |1>

There is one more twist to this equation, which I’ll get to in a moment.

For now, let’s get a visual representation of the qubit that we have described so far.

Ok, let’s break down this image.

A bit can be 0 or 1. One way to visually represent this is with the following:

Let’s call this line the z-axis.

Now, remember, we refer to 0 and 1 (aka the basis states) as |0> and |1> in qubits.

So a similar visualization for the qubit would be:

So here come’s the tricky part to grasp. We know that the quantum state has to be a superposition of the two basis states, right? So that means that, ideally, we need our qubit to be able to represent any and all different quantum states that we can make.

Since quantum superposition in our case is defined such that:

Ψ = a * |0> + b * |1>

then we need our qubit out there to represent all possible Ψ for all possible a and b.

For you math nerds out there, you will recognize that this leads to an infinite number of Ψ, which is impossible to represent physically. This is because the factor a, as we currently have it, can have a value anywhere from negative infinity to positive infinity. And the same with b.

Luckily for us, we will introduce the normalization constraint on a and b. What does that mean?

It means that we add a second equation:

|a|^2 + |b|^2 = 1

So the absolute value of a, squared, plus the absolute value of b, squared, must equal 1.

Well, this does limit our choices of values for a and b considerably. What values can we have for a and b now?

Well, let’s see. If we set b to 0, then we see that a must be -1 or 1. “a” actually cannot be anything greater than 1 or less than -1 because of this. Think about it, if b is any non-zero value, then |a|² must be less than 1 for the equation to hold, which means that a has to be greater or equal to -1 and less than or equal to 1 at all times. The same logic applies to b.

Cool, so because of our new equation, we know that -1 <= a, b <= 1.

So how do we represent that visually? We need something that is related to ket 0 and ket 1 and constrains a and b via the normalization constraint.

Here’s where the idea of the sphere comes in.

We have the same z-axis as before. Except for this time, we draw a sphere around it. The distance from the center of the sphere to either of the basis states is the radius of the sphere. Because we know the basis states are valid, we, therefore, know that the distance of the radius of the sphere from the center sphere leads us to a valid state. Therefore, all of the possible quantum states are represented by the surface of the sphere (represented by |Ψ > in our diagram).

Ok… so where do a and b come in? Well, let’s first define the two angles that define this sphere. We will call one theta and the other phi.

a and b are defined in terms of theta and phi as follows:

a = cos(θ/2)

b = e^(iΦ)sin(θ/2)

We call this sphere the Bloch Sphere, named after our boy Felix Bloch, a Swiss Nobel laureate in physics.

And that’s the qubit folks!

To recap, we build on top of a normal binary state bit with quantum states.

We define those quantum states with the following system of equations:

  • Ψ = a * |0> + b * |1>
  • |a|^2 + |b|^2= 1

where:

  • a = cos(θ/2)
  • b = e^(iΦ)sin(θ/2)

where theta and phi are the two angles that define the sphere in our visualization:

What a doozy!

You now know the basic building block for quantum computers. The next step in your question for knowledge? Right here

--

--

James Wall
The Quantum Authority

Tech and travel enthusiast. Founder of the Quantum Authority.