Gate Library
A gate name specifies a unitary only after basis, tensor order, angle, and phase conventions have been fixed. This library records exact representatives for calculation. Single-Qubit Gates, Multi-Qubit Gates, and Controlled Operations explain their actions and synthesis.
Single-qubit matrices
Section titled “Single-qubit matrices”Use column vectors in the basis ; in a matrix product the rightmost factor acts first. Angles are in radians. These are the conventional representatives used by Nielsen and Chuang.
| Gate | Exact matrix | Useful relation |
|---|---|---|
| Identity | ||
| Pauli X | ||
| Pauli Y | ||
| Pauli Z | ||
| Hadamard | ||
| Phase S | ||
| Phase T | ||
| General phase |
For , define . Writing and gives
Thus and . The phase factor disappears from an isolated unitary channel, but may become a relative phase when that unitary is controlled. In particular, is not exact matrix equality to .
Gates on two and three qubits
Section titled “Gates on two and three qubits”Use the two-qubit basis , with the first bit the left tensor factor. Here and denotes addition modulo two.
| Gate | Action and qualification |
|---|---|
| CNOT, first qubit controls second | Reverse control direction is a different matrix. |
| CZ | Symmetric under exchange of the qubits. |
| Controlled phase | Equal to CZ at . |
| SWAP | Exchanges tensor factors without entangling product inputs. |
| iSWAP | , Leaves and fixed; differs from SWAP by conditional phases. |
| Toffoli | Two controls and one target. |
| Fredkin | , Controlled SWAP. |
More generally,
The tensor order in this equation defines which subsystem is the control. A software bit-order convention must be translated to this order before comparing arrays.
Native interactions and a phase check
Section titled “Native interactions and a phase check”A native gate is an operation directly supported by a control implementation. Common mathematical families include , , and exchange-type rotations. Their calibrated phase offsets, signs, and local rotations are part of the definition; the family name alone does not specify the implemented gate. See Gate Decomposition and Pulse-Level Control.
For a useful diagnostic, compare with on . The former yields , whereas the latter yields . These differ by a relative phase. Multiplying the control by after the latter restores the former output. This is why dropping a one-qubit global phase before adding a control changes a circuit.
References
Section titled “References”- Nielsen, Michael A., and Isaac L. Chuang, Quantum Computation and Quantum Information, 10th anniversary edition, Cambridge University Press, 2010, doi:10.1017/CBO9780511976667 — conventional gates, controlled operations, and universal circuit constructions.