# Qubit Touchdown: A Quantum Computing Board Game

**Links**:: 2022 Introduction to Classical and Quantum Computing

In this chapter, we learn about the Qubit.

# # Qubit Touchdown: A Quantum Computing Board Game

- An interesting board game by
*Thomas Wong*that uses the mechanics from Quantum Computing. Qubit Touchdown (thegamecrafter.com)

# # Superposition

## # Zero or One

- A Qubit is both similar and different from classical bits. Just like a classical bit, it can take two values $\ket 0$ and $\ket 1$ (represented using the Dirac Notation). These distinct states can be visualized as the north and south poles of a unit sphere called Bloch sphere.

## # Superposition

- Unlike classical bits, the laws of
*quantum mechanics*allow a Qubit to be a combination of $\ket0$ and $\ket 1$, called a Superposition of $\ket 0$ and $\ket 1$. - Some frequently occurring states are: $$\displaylines{

\ket + = \frac{1}{\sqrt 2}(\ket 0 + \ket 1), \newline

\ket - = \frac{1}{\sqrt 2}(\ket 0 - \ket 1), \newline

\ket i = \frac{1}{\sqrt 2}(\ket 0 + i\ket 1), \newline

\ket -i = \frac{1}{\sqrt 2}(\ket 0 - i\ket 1), \newline

}$$ - A Qubit can be any point on the Bloch sphere ^24d3f6

## # Review of Complex Numbers

- A complex number $z$ is a number with a real part $x$ plus an imaginary part $y$ : $z = x + iy$. This form is called the Cartesian form of a complex number. ^67e598
- In quantum computing, it is often useful to write a complex number as its length $r$ times its complex phase $e^{i\theta}$ : $z = re^{i\theta}$. This is called the Polar form of a complex number. ^bb988d
- To convert from the Cartesian form $x + iy$ to the Polar form $re^{iθ}$ , we use the following equations: $$\displaylines{

r = \sqrt{x^2 + y^2}, \newline

\theta = \tan^{-1}\left(\frac{y}{x}\right).

}$$ - To convert from the Polar form $re^{iθ}$ to the Cartesian form $x+iy$, we use the following equations: $$\displaylines{

x = r\cos \theta, \newline

y = r\sin \theta.

}$$ - The Complex Conjugate of a complex number is the complex number obtained by negating its imaginary part. We denote the complex conjugate of $z$ as $z^∗$, so if $z = x + iy = re^{iθ}$ , then $z^∗ = x − iy = re^{−iθ}$ . ^f7cc5b
- The Norm of a Complex Number $z$, which we denote $|z|$, is simply its length $r$: $|z| = r$. ^bf51a5
- The norm-square of a complex number $z$, which we denote $|z|^2$, is simply the square of its norm, so it is $r^2$ : $|z|^2 = r^2$.

# # Measurement

## # Measurement in the Z-Basis

- Although the laws of quantum mechanics permit the superposition of $\ket 0$ and $\ket 1$ during computation, it also demands that we get a single definite value, either $\ket 0$ or $\ket 1$, based on some probability, when we read/measure the qubit.
- The probability is given by the
*norm-square*of the amplitude. Amplitudes are the coefficients of $\ket 0$ and $\ket 1$. - Measuring collapses the qubit. It is then no longer in a superposition.

## # Normalization

- A Quantum State is normalized if its total probability is $1$.
- If a Quantum State isn’t normalized, we must find an overall normalization constant to make it so. e.g. If a qubit is in the state $$A \left(\sqrt 2 \ket 0 + i\ket 1\right),$$then we can normalize it by finding the normalization constant $A$ that ensures the total probability is $1$. $$\displaylines{

(A \sqrt 2)(A \sqrt 2)^* + (Ai)(Ai)^* = 1\newline

2|A|^2 + |A|^2 = 1 \newline

3|A|^2 = 1\newline

|A|^2 = \frac13 .

}$$So, the normalized state is: $$\frac13 \left(\sqrt 2 \ket 0 + i\ket 1\right).$$

## # Measurement in Other Bases

- A set of distinct measurement outcomes, located opposite to each other, is called a
*basis*. - ${\ket 0, \ket 1}$ is called the
*$Z$-basis*because they lie on the*$z$-axis*. - ${\ket +, \ket -}$ is called the
*$X$-basis*because they lie on the*$x$-axis*. - ${\ket i, \ket {-i}}$ is called the
*$Y$-basis*because they lie on the*$y$-axis*. - We can measure with respect to any of these basis.

## # Consecutive Measurements

- Measuring in alternating measurement basis gives rise to some unique characterizes. e.g. If a qubit is in the state $\ket 0$ and we measure it in the $X$-basis ${\ket +, \ket -}$ and then measure it again in the $Z$-basis ${\ket 0, \ket 1}$, it can now either be $\ket 0$ or $\ket 1$ with equal probability.

# # Bloch Sphere Mapping

## # Global and Relative Phases

- Global phases are physically irrelevant, i.e. if a qubit is multiplied by an overall global phase: $$e^{i\theta} \left(\alpha \ket 0 + \beta \ket 1\right),$$ for some angle $\theta$, it has no effect on the outcome of the measurement. The probability of getting a certain state after measurement would be the same as it were without the global phase. This is true no matter what measurement basis we use. Because of this,
*Global phases can be dropped*. ^9c24bd - On the other hand, a
*Relative phase is physically significant*. e.g. $$\ket + = \frac{1}{\sqrt2}(\ket 0 + \ket 1)$$ vs $$\ket i = \frac{1}{\sqrt 2}(\ket 0 + i\ket 1) = \frac{1}{\sqrt 2}(\ket 0 + e^{i\frac\pi2}\ket 1).$$These correspond to different points on the Bloch sphere, and they can be distinguished by measurements in appropriate bases.

## # Bloch Sphere

- We write a generic Qubit as $$\ket \psi = \alpha \ket 0 + \beta \ket 1,$$where $|\alpha|^2 + |\beta|^2 = 1$ for Normalization. Here, $\ket \alpha$ and $\ket \beta$ are amplitudes, where $\ket \alpha$ is assumed to be a positive real number and $\ket \beta$ may be complex.
- To determine the location of a qubit on the Bloch sphere, we first write $\alpha$ and $\beta$ in terms of two angles $\theta$ and $\phi$ : $$\alpha = cos\left(\frac\theta2\right), \beta = e^{i\phi}sin\left(\frac\theta2\right).$$ With $0 ≤ \theta ≤ \pi$ and $0 ≤ \phi < 2\pi$, this captures all the properties we need: $α$ is real and positive, $β$ is complex, and the state is normalized. So, the Qubit now can be represented as: $$\ket \psi = cos\left(\frac\theta2\right) \ket 0 + e^{i\phi}sin\left(\frac\theta2\right) \ket 1.$$ ^b627cf
- Here, $θ$ measures the angle down from the north pole, called the Polar angle, and $\phi$ measures the angle across from the $x$-axis in the $xy$ plane, called the Azimuthal angle.
- We can convert from spherical coordinates to Cartesian coordinates using the following formulas: $$\displaylines{

x = sin \theta cos \phi, \newline

y = sin \theta sin \phi, \newline

z = \cos \theta.

}$$

# # Physical Qubits

- Physically, any quantum system with two distinct states can be used as a qubit.
- Some examples include:
*Photons*, or quantum particles of light, have a property called polarization, which can be vertical or horizontal, or a superposition of both, and we can use this as a qubit.**Trapped ions**. Individual*ion*can be trapped in space using electric fields. Two energy levels of an ion can be used as a qubit.*Cold atoms*. Neutral atoms can be trapped at low temperatures using a magnetooptical trap, which uses magnetic fields and lasers to cool and trap the atoms. Another approach is using an optical lattice constructed by laser beams. One trapped, two energy levels of an atom can be used as a qubit.*Nuclear magnetic resonance*. The nuclei of atoms and molecules have a quantum property called spin, which can be used as a qubit.*Quantum dots*. An electron can be bound to a small semiconductor device, where the spin of an electron, which can be “spin up” or “spin down,” can be used as a qubit.*Defect qubits*. A diamond crystal may have a missing carbon atom, and if a we replace a carbon atom next to this vacancy with a nitrogen atom, we get a “spin triplet” that can be used for quantum computing. This is called a nitrogen-vacancy center in diamond.*Superconductors*. In a superconducting circuit, charge flows with zero resistance. The magnetic flux across an inductor and the charge on a capacitor cause a harmonic potential energy with equally spaced, discrete energy levels. A*Josephson junction*is a thin insulating layer and changes the potential energy so that the energy levels become unequally spaced. Then, the energy levels can be distinguished, and two of them can be used as a qubit.

- The Qubit Zoo qubitzoo.com, collects a list of different ways to build qubits.

# # Quantum Gate

- Quantum gates act on qubits just like logic gates act on bits. It transforms the state of a qubit into other states. It is often denoted by the capital letter $U$.

## # Linear Maps

- A quantum gate must be linear, i.e. we can distribute it across superpositions: $$U(\alpha \ket 0 + \beta \ket 1) = \alpha U \ket 0 + \beta U \ket 1.$$
- Quantum gates are linear maps that keep the total probability equal to 1.

## # Classical Reversible Gates

- Any classical reversible gate simply permutes (shuffles) the amplitudes around.
- Classical reversible logic gates are valid quantum gates, while irreversible gates aren’t.

## # Common One-Qubit Quantum Gates

- The identity gate turns $\ket 0$ into $\ket 0$ and $\ket 1$ into $\ket 1$, hence it does nothing: $$\displaylines{

I\ket0 = \ket 0, \newline

I\ket1 = \ket 1.

}$$ ^736c4b - The Pauli X-gate, or NOT Gate, turns $\ket 0$ into $\ket 1$, and $\ket 1$ into $\ket 0$: $$\displaylines{

X\ket0 = \ket 1, \newline

X\ket1 = \ket 0.

}$$

If we apply the X-gate twice, we rotate around the $x$-axis of the Bloch sphere by $360^\circ$, which does nothing. Then, $X^2 = I$. ^21234b - The Pauli Y-Gate turns $\ket 0$ into $i\ket 1$, and $\ket 1$ into $-i\ket 0$: $$\displaylines{

Y\ket0 = i\ket 1, \newline

Y\ket1 = -i\ket 0.

}$$

If we apply the Y-gate twice, we rotate around the $y$-axis of the Bloch sphere by $360^\circ$, so $Y^2 = I$ ^9c6e17 - The Pauli Z-Gate keeps $\ket 0$ as $\ket 0$, and turns $\ket 1$ into $-\ket 1$: $$\displaylines{

Z\ket0 = \ket 0, \newline

Z\ket1 = -\ket 1.

}$$ It is a rotation of $180^\circ$ about the $z$-axis, so $Z^2 = I$. ^d74a45 - Phase gate is the square root of the Z-gate. $$\displaylines{

S\ket0 = \ket 0, \newline

S\ket1 = i\ket 1.

}$$ It is a rotation of $90^\circ$ about the $z$-axis, so $S^2 = Z$ and $S^4 = I$. ^9ec18c - T-gate is the square root of the S-gate. $$\displaylines{

T\ket0 = \ket 0, \newline

T\ket1 = e^{i\frac\pi4}\ket 1.

}$$ It is a rotation of $45^\circ$ about the $z$-axis, so $T^2 = S$ and $T^4 = Z$. ^56ad05 - The Hadamard Gate turns $\ket 0$ into $\ket +$, and $\ket 1$ into $\ket -$: $$\displaylines{

H\ket0 = \frac{1}{\sqrt 2}(\ket 0 + \ket 1), \newline

H\ket1 = \frac{1}{\sqrt 2}(\ket 0 - \ket 1), \newline

H\ket+ = \ket 0, \newline

H\ket- = \ket 1, \newline

H\ket i = \ket {-i}, \newline

H\ket{-i} = \ket i.

}$$ It is a rotation of $180^\circ$ about the $x+z$-axis. Applying $H$ twice rotates by $360^\circ$, which does nothing. So, $H^2 = I$. ^62f82e - #to/do

## # General One-Qubit Gates

- One-Qubit Quantum Gates are rotations on the Bloch sphere
- A rotation by angle $\theta$ about axis $\hat n = (n_x, n_y, n_z)$, where $\hat n$ is a unit vector, can be written in terms of $I, X, Y,$ and $Z$ : $$U = e^{i\gamma}\left[\cos \left( \frac \theta 2 I - i \sin\left(\frac \theta 2 \right) (n_xX + n_yY + n_zZ) \right) \right]$$ where $\gamma$ is a global phase which can be
*dropped*.

# # Quantum Circuits

- Just like
*classical circuits*diagrams, which consist of bits and logic gates, we can draw*Quantum Circuit*diagrams consisting of qubits and quantum gates. - A great web-based tool for simulating quantum circuits is Quirk at [https://al gassert.com/quirk](https://al gassert.com/quirk).

# # Summary

- Qubit is the smallest unit of
*Quantum Information*. - Besides the two orthogonal states $\ket 0$ and $\ket 1$, a Qubit can be a Superposition of them with complex amplitudes.
- The norm-square of the amplitudes gives the probability of measuring the qubit as a $0$ or $1$.
- Qubits can also be measured in other orthonormal bases, and can be visualized by a Bloch sphere.
- Qubits are operated on by Quantum Gate, which are linear maps that keep the total probability equal to $1$. A single-qubit gate is a rotation on the Bloch sphere.
- A quantum circuit is a drawing to depict what quantum gates act on a qubit.