# Qubit

A Qubit (or QBit) is a unit of measure used in quantum computing.

Like a bit in normal (non-quantum) computing, a Qubit has two distinct states, 0 state and the 1 state. However, unlike the normal bit, a qubit can have a state that is somewhere in-between, called a "superposition."

You cannot measure the superposition without the superposition going away (changing). If you try to measure a qubit that is in a superposition, the qubit will change, and become one of two states. The resulting state the qubit changes to depends on how it is measured. For simplicity, let's assume we are measuring in a way that will make the qubit change to either a 0 state or a 1 state.

A qubit can be represented as a 2-element column vector.

A qubit in the 0 state looks like ${\displaystyle {\begin{bmatrix}1\\0\end{bmatrix}}}$.

A qubit in the 1 state looks like ${\displaystyle {\begin{bmatrix}0\\1\end{bmatrix}}}$.

In general, a qubit state will look like ${\displaystyle {\begin{bmatrix}\alpha \\\beta \end{bmatrix}}}$ , where ${\displaystyle |\alpha |^{2}+|\beta |^{2}=1}$.

α and β are called amplitudes. They can be complex numbers. Each state has an amplitude.

By squaring a state's amplitude, you can get the probability of measuring that state.

Each state can also have a phase. The phase is part of the amplitude and is what can make the amplitude a complex number.

A state's phase is like how much that state has rotated. The angle of phase is usually represented as either Φ or φ. Let's use φ.

φ can go from 0 to ${\displaystyle 2\pi }$ radians. The angle sort of goes into an Euler identity, where instead of ${\displaystyle e^{i\pi }}$, the ${\displaystyle \pi }$ gets substituted with the angle φ. The state's phase becomes ${\displaystyle e^{i\varphi }}$.

This expression ${\displaystyle e^{i\varphi }}$is a phase factor that becomes part of a state's amplitude. It gets multiplied with the amplitude.

A phase angle of 0 makes the amplitudes positive real numbers, since ${\displaystyle e^{i0}=1}$.

A phase angle of ${\displaystyle \pi }$ makes the amplitudes negative real numbers, since ${\displaystyle e^{i\pi }=-1}$. (This is Euler's identity)

A phase angle of ${\displaystyle {\frac {\pi }{2}}}$ makes the amplitudes positive imaginary numbers, since ${\displaystyle e^{i\pi /2}=i}$.

A phase angle of ${\displaystyle {\frac {3\pi }{2}}}$ makes the amplitudes negative imaginary numbers, since ${\displaystyle e^{i3\pi /2}=-i}$.

Beyond 0 and ${\displaystyle 2\pi }$, the phase angle just wraps back around again, since it is just a rotation.

An example qubit may look like ${\displaystyle {\frac {1}{\sqrt {2}}}{\begin{bmatrix}1\\-1\end{bmatrix}}}$. There is a 50% chance of measuring a 0 or a 1. There is a phase of 1 on the 0 state's amplitude. There is a phase of -1 on the 1 state's amplitude.

Qubits are generally written as kets, which look like ${\displaystyle |\psi \rangle }$. Kets are part of Bra-Ket notation, also known as Dirac notation. Kets are a way of saying column vector.

The 0 and 1 state are written as ${\displaystyle |0\rangle }$ and ${\displaystyle |1\rangle }$ respectively.

A general qubit in ket notation will be written as ${\displaystyle |\psi \rangle =\alpha |0\rangle +\beta |1\rangle }$.

This equation is exactly the same as ${\displaystyle |\psi \rangle ={\begin{bmatrix}\alpha \\\beta \end{bmatrix}}}$, since ${\displaystyle \alpha |0\rangle +\beta |1\rangle =\alpha {\begin{bmatrix}1\\0\end{bmatrix}}+\beta {\begin{bmatrix}0\\1\end{bmatrix}}={\begin{bmatrix}\alpha \\0\end{bmatrix}}+{\begin{bmatrix}0\\\beta \end{bmatrix}}={\begin{bmatrix}\alpha \\\beta \end{bmatrix}}}$