# Qubits: The substitution of bits in quantum scenario

(Kurzgesagt – In a Nutshell)

As I’ve mentioned in my previous post, qubits doesn’t suffer from the limitation of only being $0$ or $1$. Within this article, I’m going to talk about some background knowledge essential for ones who have just stepped into the field like me.

#### Single Qubit

*Dirac notation* $\left | \cdot \right\rangle$ (pronounced as *ket*) is adopted to indicate qubit states. The state $\left|\psi\right\rangle$ associated with a qubit can be an arbitrary unit vector in the two-dimensional vector space over the complex numbers. Two basis states $\left|0\right\rangle$ and $\left|1\right\rangle$ are two elements (or *basis vectors*) than span a *computational basis*, in which any other state of a qubit may be represented as a linear combination of the elements.

The general state of a qubit can be simply written as
$$\left|\psi\right\rangle = \alpha_0\left|0\right\rangle + \alpha_1\left|1\right\rangle$$
or by vector representation $$\left|\psi\right\rangle = \begin{bmatrix}
\alpha_0 \\ \alpha_1

\end{bmatrix}$$
where $\alpha_0$ and $\alpha_1$ are complex coefficients. All qubit states must be a unit vector in the complex vector space, thus constrained by the normalization $$\left|\alpha_0\right|^2 + \left|\alpha_1\right|^2 = 1$$

In contrast to classical bits, qubits don’t have “actual values”. Correctly, they have to be described by states. The general state $\left|\psi\right\rangle$ is a *superposition* of the basis states $\left|0\right\rangle$ and $\left|1\right\rangle$ with *probability amplitudes* $\alpha_0$ and $\alpha_1$. That means if you measure a single qubit in the state $\left|\psi\right\rangle$, you’ll get $0$ with probability $\left|\alpha_0\right|^2$ and $1$ with probability $\left|\alpha_1\right|^2$. Classical bits are just special instances of qubits. Their value is the same as one of the two basis states $\left|0\right\rangle$ or $\left|1\right\rangle$ with probability $1$.
$$\left|0\right\rangle = \begin{bmatrix}
1 \\ 0
\end{bmatrix}; \left|1\right\rangle = \begin{bmatrix}
0 \\ 1
\end{bmatrix}$$

#### Multiple Qubits

In classical computers, because each bit can have one out of two values, there are $2^2 = 4$ value combinations for every two bit including $\left|00\right\rangle, \left|01\right\rangle, \left|10\right\rangle$ and $\left|11\right\rangle$. These are four orthonormal basis vectors that span the four-dimensional vector space of two qubits.
An alternative notation for the basis states: $$\left|0\right\rangle\left|0\right\rangle, \left|0\right\rangle\left|1\right\rangle, \left|1\right\rangle\left|0\right\rangle, \left|1\right\rangle\left|1\right\rangle$$
In fact, this notation deliberately suggests multiplication or, to be exact, the *tensor product* of two qubit vectors. It can be written formally in mathematical language as $$\left|0\right\rangle \otimes \left|0\right\rangle, \left|0\right\rangle \otimes \left|1\right\rangle, \left|1\right\rangle \otimes \left|0\right\rangle, \left|1\right\rangle \otimes \left|1\right\rangle$$
A tensor product of $M$-component vector $\mathbf{a}$ and $N$-component vector $\mathbf{b}$ returns a $MN$-component vector.
$$\mathbf{a} \otimes \mathbf{b} = \begin{bmatrix}
a_1 \\ a_2 \\ \vdots \\ a_{n}
\end{bmatrix} \otimes \begin{bmatrix}
b_1 \\ b_2 \\ \vdots \\ b_{m}
\end{bmatrix} = \begin{bmatrix}
a_1b_1 \\ a_1b_2 \\ \vdots \\ a_1b_{m} \\ a_2b_1 \\ \vdots \\ a_nb_{m-1} \\ a_nb_m
\end{bmatrix} $$
Therefore applying the tensor product on the states of two qubits creates a vector that represent two-qubit state. This rule can be generalized into the representation of $n$-qubit state illustrated by a $n$-fold tensor product. Let’s apply this for three qubits in the basis states, i.e. $\left|6\right\rangle_3$
$$\left|6\right\rangle_3 = \left|110\right\rangle = \left|1\right\rangle \otimes \left|1\right\rangle \otimes \left|0\right\rangle
= \begin{bmatrix}
0 \\ 1
\end{bmatrix} \otimes \begin{bmatrix}
0 \\ 1
\end{bmatrix} \otimes \begin{bmatrix}
1 \\ 0
\end{bmatrix} = \begin{bmatrix}
0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 1 \\ 0
\end{bmatrix} $$
The state $\left|m\right\rangle_n$ is represented by $2^n$-dimensional vector whose all entries are zero except that the $m$-th entry has value $1$, noted that the vector is indexed from $0$. The subscript right after a ket notation will be used to indicate the finite number of considered qubits from then on.

The general state of a set of $n$ qubits is constrained only the normalization just as the state of a single qubit. Consider a set of $2$ qubits in the general state:
$$\left|\Psi\right\rangle = \alpha_{00}\left|00\right\rangle + \alpha_{01}\left|01\right\rangle + \alpha_{10}\left|10\right\rangle + \alpha_{11}\left|11\right\rangle = \begin{bmatrix}
\alpha_{00} \\ \alpha_{01} \\ \alpha_{10} \\ \alpha_{11}
\end{bmatrix},$$
$$\left|\alpha_{00}\right|^2 + \left|\alpha_{01}\right|^2 + \left|\alpha_{10}\right|^2 + \left|\alpha_{11}\right|^2 = 1$$
In general, the state of $n$ qubits can be any superposition of the $2^n$ different classical states whose probability amplitude satisfy the unit constraint. So the new quantum state has a computational basis with $2^n$ basis vectors, namely $\left|x\right\rangle_n$ with $0\leq x \leq 2^n-1$.
$$\left|\Psi\right\rangle = \sum_{x=0}^{2^n-1}\alpha_x\left|x\right\rangle_n,$$
$$\sum_{x=0}^{2^n-1}\left|\alpha_x\right|^2 = 1.$$
It’s easy to get the state of $n$-qubits by applying the tensor product on individual states. The opposite, however, is not true. A general state of $n$-qubits, which is a superposition of $2^n$ basis vectors, cannot, in general, be expressed as a product of the states of $n$ individual qubits. In other words, an individual qubit in a multi-qubit system may not have individual state (*pure state*) of its own. If a qubit is not in pure state, then it must be in mixed state, which is likely described as a density matrix. In the context of this blog, I refer the term “state” of a single qubit as “pure state” as a default unless further elaborations are available.
$$\left|0\right\rangle \otimes \left|1\right\rangle = \begin{bmatrix}
1 \\ 0
\end{bmatrix} \otimes \begin{bmatrix}
0 \\ 1
\end{bmatrix} = \begin{bmatrix}
0 \\ 1 \\ 0 \\0
\end{bmatrix} = \left|01\right\rangle, $$
$$ \begin{bmatrix}
\frac{1}{\sqrt{2}} \\ 0 \\ 0 \\ \frac{1}{\sqrt{2}}
\end{bmatrix} \not\equiv
\begin{bmatrix}
a \\ b
\end{bmatrix} \otimes \begin{bmatrix}
c \\ d
\end{bmatrix} $$

The general states of multiple qubits that cannot be expressed as products are called *entangled* states, a term first used in this context by Schrödinger. Entanglement, along with superposition, is the most important principle behind the quantum computation initiative because peculiar yet interesting behaviors of a set of entangled qubit may drive us to groundbreaking findings that cannot be produced by even the strongest classical super-computers in the world.