In a Quantum Computer, “gates” are unitary operations. The words gate and operator are used interchangebly in this context.
Recall that a unitary operator $U$ is one where the adjoint is equal to the inverse, meaning $U^\dagger = U^{-1}$, giving us the defining relation for a unitary operator:
$UU^\dagger = U^\dagger U = I$
We also remember that, if $H$ is a hermitian opertator, then $U = e^{-iHt}$ is unitary.
A quantum gate with $n$ inputs and outputs, can be represented by a matrix of degree $2^n$. Thus, for a single qubit, we require $2^1 = 2$ degree unitary matrices to reperesent our gates.
THE NOT GATE (X Pauli Matrix)
Represented as $X$ or $U_{NOT}$:
$X = U_{NOT} = \begin{pmatrix}0 & 1 \\ 1 & 0\end{pmatrix}$
Further, recall the effect of this matrix on the standard computational basis:
$\begin{matrix}U_{NOT}\ket{0} = \ket{1} & U_{NOT}\ket{1} = \ket{0}\end{matrix}$
This action on an arbitray state $\ket{j}$ can be summarized as follows using $XOR$ operation: $U_{NOT}\ket{j} = \ket{j \oplus 1}$
THE HADAMARD MATRIX
Given by
$H = \frac{1}{\sqrt2} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}$
This matrix, helps transform a given state from the $\ket{0}-\ket{1}$ basis to the $\ket{\pm}$ basis.
$\begin{matrix}H\ket{0} = \ket{+} & H\ket{1} = \ket{-} \end{matrix}$
APPLICABLE QUANTUM GATES:
Pauli Matrices:
$\begin{matrix}X = \begin{pmatrix}0 & 1 \\ 1 & 0 \end{pmatrix} & Y = \begin{pmatrix}0 & -i \\ i & 0 \end{pmatrix}\end{matrix}$
The $Z$ Pauli Operator, is also referred to as the PHASE FLIP GATE:
$Z = \begin{pmatrix}1 & 0 \\ 0 & -1 \end{pmatrix}$
Its operation on a given state $\ket{j}$, is given by:
$\begin{matrix}Z\ket{j} = (-1)^j\ket{j} & j \in \{0, 1\}\end{matrix}$
The Hadamard Gate ($H$), Phase Gate ($S$) & $\pi/8$ Gate ($T$):
$\begin{matrix}H = \frac{1}{\sqrt2}\begin{pmatrix}1 & 1 \\ 1 & -1 \end{pmatrix} & S = \begin{pmatrix}1 & 0 \\ 0 & i \end{pmatrix}\end{matrix}$
$T = \begin{pmatrix}1 & 0 \\ 0 & e^{\large\frac{i\pi}{4}} \end{pmatrix} = e^{\large\frac{i\pi}{8}}\begin{pmatrix}e^{\large\frac{-i\pi}{8}} & 0 \\ 0 & e^{\large\frac{i\pi}{8}} \end{pmatrix}$
Square Root of NOT Gate ($\sqrt{NOT}$)
$\sqrt{NOT} = \frac{1}{\sqrt2}\begin{pmatrix}1 & -1 \\ 1 & 1 \end{pmatrix}$
note that:
$\sqrt{NOT} \ne \sqrt{NOT}^\dagger$
CIRCUIT IDENTITIES:
Derivation of the Canonical Representation
To Summarize, the Canonical Representation of a qubit is:
$\ket{\psi} = cos(\large\frac{\theta}{2}\normalsize)\ket{0} + e^{i\phi}sin(\large\frac{\theta}{2}\normalsize)\ket{1}$
Here,
$\begin{matrix}\theta \in (0, \pi) & \phi \in (0, 2\pi)\end{matrix}$
We also, note the following:
The $Z$ basis:
$\theta = 0 \implies \ket{0}$
$\theta = \pi \implies \ket{1}$
The $X$ basis:
$\begin{matrix}\theta = \large \frac{\pi}{2} & \phi = 0 \end{matrix} \implies \ket{+}$
$\begin{matrix}\theta = \large \frac{\pi}{2} & \phi = \large -\pi \end{matrix} \implies \ket{-}$