All standard computers rely on a bit for storage. We should understand that before we move on to its quantum equivalent, the qubit. All computers (modern) use a digital and binary representation of all data. That goes for the machine in front of you and in fact any machine.

# Binary representation: The Bit.

The words and text that you are viewing right now are stored as binary represtations of 0 and 1. Everything whether, a letter, number or an image is represented at the most fundamental level of a string of 0’s and 1’s. So for example the number 5 can be represented as 101 and number 1 as 001. Such a binary scheme is able to store 8 states because for each bit there are 2 possible states: 0 or 1. That means there are 2 x 2 x 2 = 8 states, 2^3 states. More generally we can specify the number of states as 2^n, where n is the number of bits. If you wanted to store every letter of the alphabet you need 26 states and the nearest factor of 2 that stores this number of states is 32. So this means we need 5 bits giving us 2^5 = 32 possible states with six spare states. Now there are common schemes such as ASCII which use 8 bits and each unit of 8 bits describes a character.

## Why use binary? Why not analogue?

There are many reasons to use binary states, even though it may seem very odd at first. Namely representation of data is then unquestionable. A letter cannot change easily. You can imagine an analogue computer could store letters with voltages, imagine the 8 state can above, we could store using 8 different voltages. Such schemes do and have exists, but the issue with analogue states is how to deal with them in a smart manner. Analogue computers must perform addition with analog representations.

For example, if we store two different numbers in an analogue representation, then there is always going to be some limit of precision by which adding the numbers together is going to lead to inaccurancies, because we cannot use infinite volatages, we must scale representations. For example, if we store 23 and 42 with the voltages 0.23V and 0.42V, then if we add these together we should get 0.65V representing 65. But we have had to introduce some degree of rounding and if our machine can only deal with 0.1 precision we may only be able to store 0.2V and 0.4V, which means the sum of 0.2V and 0.4V gives 0.6V or 60 (approximating 65). Eventually by the build up of small deviations and limited precision, errors propogate making calculations unreliable.

Using a binary representation (with a MAXIMUM of 2^8 = 256 states) we can do this addition with no loss of accuracy. For example:

Binary Decimal
00010111 23
+ +
00101010 42
= =
01000001 65

We represent the numbers (23,42,65) as binary. Note that we assume that the bits on the left are most significant. I’ll explain how this works with a simpler case. For example take 65, all zero’s bar two 1’s. The position of these is significant. Now in binary, we count in powers of two. That means for the 8 bits we have from the left most position (0) 128. This makes sense because we should not have any amount of 128, as 65 is much smaller. However move along to the next bit (left to right) and the bit represents 64. Now, we should take this position (with a 1) as 64 is less than 65, the number we want to represent. Now we are just one away from summing to our target of 65. The right most bit represents 1, so lets put a (1) there and sum. Hence we get the representation 65 from 01000001.

128 64 32 16 8 4 2 1
2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0
0 1 0 0 0 0 0 1

## What does bit stand for?

Just for completeness, the bit stands for binary digit. A shortened version, Simple really!

# The Qubit, an easy introduction to the world of Quantum Computing

Now you understand bits (hopefully) and how to do a simple operation with them, lets move onto the differences and how a Qubit is different, how we work with them and how to represent them. The most crucial part to remember regarding qubits or Quantum Bits (QuBits) is there are not just two states like we saw in the binary case above. There are other attirbutes as you would expect, but what makes the uniqueness of quantum is the fact there are just a 0 or 1. Qubits can be very complex, as can the mathematical tools used to represent and manipulate them. By giving you a taste of some of these simple operations we hope to inspire you Quantumly.

## Representing a Qubit

In esccence we need a form that allows our Qubit representation to take on a multitude of states. In reality we cannot know exactly what these states represent, because there are some limitations with measurement of the Qubit. In fact one of the tenents of the Quantum field is that measurements are essentially statistical and probablistic. This means we could have a state, Q, that represents a 0 40% of the time and a 1 60% of the time. Imagine if we were to flip 10 coin, then we would expect say tails 60% of the time and heads 40% of the time. But flipping an individual coin would not tell us about the distribution of states that we have.

Mathematicians have a representation of the quantum state that adheres to this statistical representation. They also have some very clever mathematical language that makes writing down and manipulating these states easier. We’ll come across a few of these states because being able to interoperate between these schemes will be very useful.

### Matrix and Vector form of the Qubit

Mathematicians use Matrix forms, but here you don’t really need to understand a lot about them to understand this example. As you saw earlier, we must have a probabilistic interpretation of 0/1. We can do this with a matrix or a simple column vector. One form of the column representation is fully 0 and the other is fully 1.

Representing a zero state (0)

$\begin{bmatrix}1 \\0\end{bmatrix}$

Representing a one state (1)

$\begin{bmatrix}0 \\1\end{bmatrix}$

OK, so what. Well if we had just two states, that would be boring wouldn’t it! Quantum states can be in a mixed state. That means that we can have a blend of these two states. Lets show that in vector form using two terms, alpha and beta. So now we have a blend of two states, you might call it a superposition of states, a mix of the 0 and 1. But aha, we need to ensure that alpha and beta are constrained. Because we are dealing with probabilities, we know that the measurement of the qubit must be constrained to be within the range of 0 to 1.

We can now specify two co-coefficients that we can use to scale how much we want of state 0 and state 1. So we can have a superposition of states. An important concept in Quantum Mechanics.

Lets now create a combination of these two states

$\alpha\begin{bmatrix}0 \\1\end{bmatrix}+\beta\begin{bmatrix} 0 \\1 \end{bmatrix}$

The constants alpha and beta can take values, such that the total probability is never over 1 and maximally at 1. So if we wanted to have all in state 0, alpha would be equal to 1 ($\alpha=1$) and beta equal to zero ($\beta = 0$).

## Measuring a Qubit

For a single qubit we have the following constraint that

$\alpha^2 + \beta^2 = 1$

This means that we have constraints. Lets see some examples if we wanted to have a state that is as likely to be in state 0 as it is in state 1. This means that $\alpha=\beta=\frac{1}{\sqrt{2}}$ and an equal superposition of a single Qubit looks like

$\begin{bmatrix} \frac{1}{\sqrt{2}}\\ \frac{1}{\sqrt{2}} \end{bmatrix}$

## Multiple states of the Quantum Qubit

Before we saw some simple ways we can combine two states. What makes quantum computing very powerful is the fact there are many states that our single qubit can actually take. But before we do anything else, we should note that matrix or vector notation can be cumbersome for writing down relations in the Quantum field, so bring on Dirac notation.

# Dirac Notation (those bra and kets)

Paul Dirac, one of the kings of mathematics and Quantum https://en.wikipedia.org/wiki/Paul_Dirac created notation to make dealing with Quantum states easier. He created the following (bra and ket’s)

### The ket $|0 \rangle$$|0 \rangle$ notation

This is a column vector as we saw above, here it is again

$\begin{bmatrix}1 \\0\end{bmatrix}$

and is denoted with an angled bracket as follows $|0\rangle$ for a state which is fully in 0 and $|1\rangle$ for a state which is fully in 1. Ket’s are used typically for the state of the quantum system.

### The bra $\langle 0 |$$\langle 0 |$ notation

This is a row vector, basically the transpose of a column vector. Just for completeness but we won’t worry about it here.

$\begin{bmatrix}1 &0\end{bmatrix}$

Now we can write our earlier expression of the equal superposition as

$\frac{1}{\sqrt{2}}|0\rangle + \frac{1}{\sqrt{2}}|1\rangle$

# Measuring a Qubit State

If we were to now make a measurement of the Qubit that we have before in the equal superposition here is what we might get. Note that we only measure a state each time. The state of our Qubit is either measured in state 0 or state 1, but for the limited number of measurements we see an equal number of each state represented. Of course, six measurements is very low and we all know that low numbers in statistics can lead to issues. So it might be that we need 1000 measurements before we see the level of precision in measuring an equal superposition of states.

But on balance we would see 50/50 split between these two states. This means we have a probability of being in state 0 as 0.5 and in state 1 as 0.5. More formally if were to look at the Dirac or matrix notation we would see that the measurement in state 0 or state 1 is

${(\frac{1}{\sqrt{2}})}^2 = 0.5$

In summary, if we could run this stochastic experiment an infinite number of times, the equal superposition would yield state 0 with probability 0.50000000000… (you get the drift) and state 1 with probability 0.50000000000…