# Two-qubit gates **Two-qubit gates** are $4 \times 4$ unitary matrices acting on a pair of qubits. Unlike single-qubit gates, they can create **entanglement** between qubits that were previously in a product state. Any two-qubit unitary can be decomposed into at most three [[cx-gate|CX]] gates plus single-qubit gates. The [[cx-gate|CX gate]] is the standard entangling gate. Together with arbitrary single-qubit gates it forms a universal gate set: any $n$-qubit unitary can be approximated to arbitrary precision using only these. The [[swap-gate|SWAP]] and [[iswap-gate|iSWAP]] gates appear in hardware architectures where qubits are not all-to-all connected and logical operations must be routed through physical neighbors. ## Entanglement A two-qubit gate is **entangling** if it can produce a state with non-zero entanglement from a product state input. CX and iSWAP are maximally entangling — a single application maps $\lvert +\rangle\lvert 0\rangle$ to a [[bell-states|Bell state]]. SWAP, by contrast, just permutes qubits and creates no entanglement from product inputs. The local equivalence class of a two-qubit gate is captured by the **Weyl chamber** parameterization: two gates are equivalent up to local single-qubit operations if and only if they share the same three Weyl coordinates $(c_x, c_y, c_z)$. CX, iSWAP, and SWAP all sit at different points in the chamber. ## Gate list - [[cx-gate]] — flips target if control is $\lvert 1\rangle$; standard entangling gate - [[swap-gate]] — exchanges two qubits - [[iswap-gate]] — SWAP with a $\pi/2$ phase on the exchanged amplitude