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 _{\textrm{SWAP}}=\begin{bmatrix} 1 & 0 & 0 & 0 \ 0 & 0 & 1 & 0 \ 0 & 1 & 0 & 0 \ 0 & 0 & 0 & 1 \end{bmatrix}
### General controlled gate\sigma _{\textrm{SWAP}}=\begin{bmatrix} I & 0 \ 0 & U \end{bmatrix}
Where $U$ is an arbitrary gate in multiplevariables. Given two gates $A=(a_{i,j}); B=(b_{i,j})$ of sizes m and n, then the [[tensor product]]A\otimes B=\begin{bmatrix} a_{i,j} B \end{bmatrix}
Essentially multiplying $B$ by the scalar $a_{i.j}$ for all $i,j$. Another way to thing about it is that it's creating a multiple dimension matrix, or a [[tensor]].