# Quantum gates

We need to figure out which part goes in evolutions and operations and which goes into computation (eg, the universal section)

A **quantum gate** or **quantum logic gate** is a rudimentary quantum circuit operating on a small number of qubits. They are the analogues for quantum computers to classical logic gates for conventional digital computers. Quantum logic gates are reversible, unlike many classical logic gates. Some universal classical logic gates, such as the Toffoli gate, provide reversibility and can be directly mapped onto quantum logic gates. Quantum logic gates are represented by unitary matrices.

The most common quantum gates operate on spaces of one or two qubits. This means that as matrices, quantum gates can be described by 2 x 2 or 4 x 4 matrices with orthonormal rows.

**Remark**. The investigation of quantum logic gates is unrelated to quantum logic, which is a foundational formalism for quantum mechanics based on a modification of some of the rules of propositional logic.

### Examples

**Hadamard gate**. This gate operates on a single qubit. It is represented by the Hadamard matrix:

$$H = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}$$

Since the rows of the matrix are orthogonal, *H* is indeed a unitary matrix.

**Phase shifter gates**. Gates in this class operate on a single qubit. They are represented by 2 x 2 matrices of the form

$$R(\theta) = \begin{bmatrix} 1 & 0\\ 0 & e^{i \theta} \end{bmatrix}$$

where θ is the *phase shift*.

**Controlled gates**. Suppose *U* is a gate that operates on single qubits with matrix representation

$$U = \begin{bmatrix} x_{00} & x_{01} \\ x_{10} & x_{11} \end{bmatrix}$$

The *controlled-U gate* is a gate that operates on two qubits in such a way that the first qubit serves as a control.

∣00⟩ ↦ ∣00⟩

∣01⟩ ↦ ∣01⟩

∣10⟩ ↦ ∣1⟩*U*∣0⟩ = ∣1⟩(*x*00∣0⟩ + *x*01∣1⟩)

∣11⟩ ↦ ∣1⟩*U*∣1⟩ = ∣1⟩(*x*10∣0⟩ + *x*11∣1⟩)

Thus the matrix of the controlled *U* gate is as follows:

$$\operatorname{C}(U) = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & x_{00} & x_{01} \\ 0 & 0 & x_{10} & x_{11} \end{bmatrix}$$

**Uncontrolled gate**. We note the difference between the controlled-*U* gate and an *uncontrolled* 2 qubit gate *I* ⊗ *U* defined as follows:

∣00⟩ ↦ ∣0⟩*U*∣0⟩

∣01⟩ ↦ ∣0⟩*U*∣1⟩

∣10⟩ ↦ ∣1⟩*U*∣0⟩

∣11⟩ ↦ ∣1⟩*U*∣1⟩

represented by the unitary matrix

$$\begin{bmatrix} x_{00} & x_{01} & 0 & 0 \\ x_{10} & x_{11} & 0 & 0 \\ 0 & 0 & x_{00} & x_{01} \\ 0 & 0 & x_{10} & x_{11} \end{bmatrix}.$$

Since this gate is reducible to more elementary gates it is usually not included in the basic repertoire of quantum gates. It is mentioned here only to contrast it with the previous controlled gate.

### Universal Quantum Gates

A set of universal quantum gates is any set of gates to which any operation possible on a quantum computer can be reduced. One simple set of two-qubit universal quantum gates is the Hadamard gate (*H*), a phase rotation gate $R(\cos^{-1}\begin{matrix} \frac{3}{5} \end{matrix}))$, and the controlled-NOT gate, a special case of controlled-U such that

$$\operatorname{CNOT} = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{bmatrix}$$.

A single-gate set of universal quantum gates can also be formulated using the three-qubit Deutsch gate, *D*(*θ*)

$$\operatorname{D(\theta)}: |i,j,k\rangle \rightarrow \begin{cases} i \cos(\theta) |i,j,k\rangle + \sin(\theta) |i,j,1-k\rangle & \mbox{for }i=j=1 \\ |i,j,k\rangle & \mbox{otherwise}\end{cases}$$

The universal classical logic gate, the Toffoli gate, is reducible to the Deutsch gate, $D(\begin{matrix} \frac{\pi}{2} \end{matrix})$, thus showing that all classical logic operations can be performed on a universal quantum computer.

### References

- M. Nielsen and I. Chuang,
*Quantum Computation and Quantum Information*, Cambridge University Press, 2000