A quantum gate is a function of a quantum computer. It can be expressed as a unital matrix:
X-gate
Not gate
Y-gate
rotation.
Z-gate
Reflection along the axis. — check
Hadamard-gate
‘Rotation by ’
Takes superpositions into pure states and vice versa.
TODO: Check the superposition for +, shouldn’t it be a pure state?
Controlled Not (CNOT)
Negate B only if A is .
\begin{aligned} \ket{ 0+ } \mapsto \ket{ 0+ } \\ \ket{ 0- } \mapsto \ket{ 0- } \\ \ket{ 1+ } \mapsto \ket{ 1+ } \\ \ket{ 1- } \mapsto -\ket{ 1- }\\ \end{aligned} $$ On a [[hadamard basis]], CNOT actually work in reverse, switching the A instead of B. See [[Phase Kickback]]. ### SWAP Swaps A and B\sigma _{\mathrm{SWAP}}=\begin{bmatrix}
1 & 0 & 0 & 0 \
0 & 0 & 1 & 0 \
0 & 1 & 0 & 0 \
0 & 0 & 0 & 1
\end{bmatrix}
\sigma _{\mathrm{SWAP}}=\begin{bmatrix}
I & 0 \
0 & U
\end{bmatrix}
A\otimes B=\begin{bmatrix}
a_{i,j} B
\end{bmatrix}