# Understanding quantum bit notation

## Turns out it’s somewhat intuitive!

Quantum computers are going to accelerate drug discovery, change the way we encrypt our information, and much more. If you haven’t heard of quantum computing yet, here’s a video that provides a nice introduction.

This article breaks down how we mathematically express qubits (quantum bits) and explains why each notation works.

Refresher on superposition: in classical computing, bits can only take on boolean values (0 or 1 and nothing in-between). But a qubit can be in a superposition of |0and |1. (For now, let the symbols “|” and “ ” just be indicators that a value is related to a quantum object.) Qubits in superposition have some chance of “collapsing” to |0 and some chance of collapsing to |1 when measured.

# Expressing 1 qubit

## Expanded notation for 1 qubit

Let’s say we have a qubit, |φ. Perhaps you have seen expanded notation:

This representation uniquely describes the qubit’s superposition:

(Technically, a² and b² are relative probabilities. They’re scaled so that a² + b² = 100%. They’re squared because they could be negative.)

For example, this qubit has a 50% chance of collapsing to |0 or |1 when measured: Example #1. Note that the |φ₁⟩ ‘phi one’ (left) is a variable representing the qubit. (Fig 2)

And this qubit has a 100% chance of collapsing to |1 when measured:

This helps to answer the question, what do the |1 and |0 represent?

This builds intuition about expanded notation. Some qubit,

is a combination of the fundamental |0and |1states, with some chance of becoming |0or |1(collapsing upon measurement).

## Vector notation for 1 qubit

There exists another way to express qubits, which involves vectors. If you’ve never seen vectors or matrices, you should check out this introduction.

To start, let’s define |0and |1in terms of vectors:

We will get back to why these definitions make sense. For now, let’s see how they let us rewrite a qubit:

So the qubit |φcan be expressed as just one vector of two numbers:

And note that a and b still represent the coefficients of |0and |1(all we did was mathematically simplify the expression).

For example, this qubit has a 50% chance of collapsing to |0 or |1 when measured: Example #3. This is the vector notation of Example #1. (Fig 8)

This qubit has a 100% chance of collapsing to |1 when measured: Example #4. This is the vector notation of Example #2. (Fig 9)

But a qubit that has a 100% chance of collapsing to |1 is just the qubit |1. So Example #4 (above) shows us the following: Example #4: |φ₄⟩ has a 100% chance of collapsing to |1⟩ when measured, so it is |1⟩. (Fig 10)

Similarly, the vector below represents a qubit with a 100% chance of collapsing to |0 when measured, so it is |0:

And these are the two definitions that we began with: Note, it just happens that (1)² = 100% and (0)² = 0%, so it seems the values weren’t squared. (Fig 12)

Now you see how the initial definitions of |0and |1 as vectors in Fig 5 make sense — they uphold the following rule:

But what if |φwere comprised of more than one qubit?

# Expressing 2+ qubits

## Expanded notation for 2+ qubits

We can use expanded notation in a very similar manner. Note, though, that each additional qubit doubles the number of fundamental states:

(In general, an n-qubit system can be in a superposition of 2 states.)

So, for example, a 4-qubit system could be written in expanded notation as follows (note, 2⁴ states need to be represented):

As you can see, expanded notation becomes tedious to write. But there exists a more compact way to represent qubits!

## Vector notation for 2+ qubits

A multi-qubit system can also be represented as a vector. For simplicity, let’s consider a 2-qubit system (we write |00to |11in ascending binary order):

Let’s name the two qubits in our 2-qubit system, qubit 1 and qubit 2. Coloring the equation will help visualize this (qubit 1 is in red, qubit 2 is in blue):

For example, the state |01is equivalent to

We already know how to write the two qubits of |φin vector notation:

While the coefficients here are not a, b, c, and d, they’re related to a, b, c, and d, as we will now show. Note that the probability that |φcollapses to |00 when measured can be represented in two ways:

So it turns out that:

Similarly, the probability that |φcollapses to |01 when measured can be represented in two ways:

This yields

And the same can be done for |φcollapsing to |10 to show

or |φcollapsing to|11to show

So we have

This relationship between a, b, c, d and x, y, z, w in Fig 24 will soon help us to understand the intuition behind the vector representation of |φ₆.

To represent a system of 2+ qubits in vector notation, we take the tensor product ‘⊗’ of all of the qubits (we’ll understand why further down). For now, let’s just see what happens:

Here are the steps in Fig 25 broken down:

Look at that! We’ve simplified a 2-qubit system to just one vector:

There’s something special about this vector! Notice that if you square the values of the vector from top-to-bottom, you get, a², b², c², and d². Those are the probabilities that |φ₆ will collapse to |00, |01, |10, or |11 when measured.

That’s why we take the tensor product of the qubits —it makes the result contain all the coefficients defining the superposition. And because of the way a tensor product is calculated, the coefficients will be in the same order as they were in expanded notation!

For example, we could find the probability that |φ₆ will collapse to |01 when measured by squaring the second item in its vector representation, shown in green: Notice that there is no |01⟩ in the vector representation because it is implied. (Fig 27)

Say we are told that a 2-qubit system, |φ, has a 50% chance of collapsing to |00or |11 when measured. We can write it in vector notation as follows:

Again, the values in the vector correspond to the fundamental states in descending order (e.g., |00, |01, |10, |11 for 2 qubits). The expanded notation is no longer needed: Remember, the values are squared to find the coefficients. (Fig 29)

Finally, here is what the generic 4-qubit system from Fig 16 would look like in vector notation:

While that’s a very tall vector, at least you don’t need to write out all the states from |0000 to |1111. If you really wanted to, you could rewrite the vector as a transpose of a row vector to save space:

That’s it! Hopefully, you now have a better grasp of the notation.

# What next?

Understanding qubits in vector notation becomes very helpful when you begin to work with quantum logic gates. The gates can be represented as matrices so that their interactions with qubits become matrix multiplications. If you’re interested in how that works, check out this lecture about the mathematical representation of quantum computing.