A quantum gate is an elementary operation that transforms the state of one or more qubits in a quantum computer. In the ideal circuit model, gates are reversible transformations represented by unitary matrices. They are combined into quantum circuits that process quantum information. Unlike an ordinary classical logic gate, a quantum gate acts on probability amplitudes, including their relative phases, rather than only on definite binary values. Measurement and reset can appear alongside gates in a circuit, but are distinct from unitary gate operations. (quantum.cloud.ibm.com)
Mathematical description
The description of quantum gates follows quantum mechanics and linear algebra. A pure state of qubits is a normalized vector in a -dimensional Hilbert space. Relative to a chosen basis, a gate acting on those qubits is represented by a unitary matrix , and the state changes according to
Here is the conjugate transpose, and is the identity matrix. Unitarity preserves normalization and makes the transformation reversible: applying undoes . (quantum.cloud.ibm.com)
A single qubit has the form , where the amplitudes are complex numbers satisfying . Gates act linearly on this superposition. Sequential gates combine by matrix multiplication; if acts before , the combined transformation is . Operations on separate subsystems are combined using the tensor product. These rules translate circuit diagrams into mathematical expressions. (quantum.cloud.ibm.com)
Common single-qubit gates
Several named gates recur throughout quantum computation:
- Pauli gates: exchanges and , reproducing classical NOT on these basis states. leaves unchanged and reverses the sign of . combines an exchange with phase factors.
- Hadamard gate: maps to , and to .
- Phase gates: and change the relative phase between the two basis-state amplitudes.
- Rotation gates: , , and provide continuously parameterized transformations corresponding to rotations about axes of the Bloch sphere. (quantum.cloud.ibm.com)
For example,
The Hadamard gate is not a randomizing operation: its action is deterministic, and applying it twice returns the original state. Random outcomes arise when the resulting state is measured. Phase changes matter because subsequent gates can turn differences in relative phase into differences in outcome probabilities through interference. (quantum.cloud.ibm.com)
Controlled and multi-qubit gates
The controlled-NOT gate, abbreviated CNOT or CX, has a control qubit and a target qubit. With the control written first, its action on computational basis states is
where denotes exclusive OR. The target flips when the control is . This rule extends linearly to superpositions; it does not require measuring the control. (arxiv.org)
CNOT can generate quantum entanglement. Starting from , applying to the first qubit and then CNOT produces
a Bell state that cannot be expressed as a product of two individual qubit states. Nevertheless, CNOT does not entangle every possible input. (learning.quantum.ibm.com)
Other multi-qubit gates include controlled-, which reverses the sign of ; SWAP, which exchanges two qubits’ states; and the Toffoli gate, which flips a target when both controls are . A controlled- operation generalizes this construction by applying conditionally while retaining quantum coherence. (quantum.cloud.ibm.com)
Universal gate sets and circuit synthesis
A universal quantum gate set can reproduce arbitrary unitary transformations, either exactly with continuously variable gates or approximately with a fixed finite collection. In 1995, Barenco and collaborators established that arbitrary single-qubit gates together with CNOT suffice to express every unitary operation on finitely many qubits. (arxiv.org)
A widely used finite universal collection is Hadamard, , and CNOT. Universality means that arbitrary transformations can be approximated to any desired accuracy; it does not imply that every transformation has a short circuit. Gate count and circuit depth therefore help describe the computational complexity of a quantum algorithm. Depth measures the number of sequential operation layers when compatible gates can run in parallel. (learning.quantum.ibm.com)
Physical implementation and errors
An abstract gate specifies a transformation, not a unique physical mechanism. Implementations manipulate suitable quantum systems with controlled fields and interactions. For example, trapped ion qubits can be entangled using laser beams or engineered microwave fields. Different hardware architectures support different native gates and interaction patterns. (nist.gov)
Compilation, often called transpilation, translates a circuit into the native gate set and connectivity of its target device. Routing may insert SWAP operations to bring interacting states onto connected qubits, increasing execution cost. Optimization consequently considers hardware constraints as well as mathematical equivalence. (quantum.cloud.ibm.com)
Real operations deviate from ideal unitaries because of control errors, unwanted interactions, and quantum decoherence. Quantum error correction encodes information into logical qubits, while fault-tolerant gate constructions limit error propagation during processing. Under suitable noise assumptions and below an appropriate error threshold, fault-tolerant methods permit arbitrarily large computations with controlled failure probability; the threshold depends on the code and implementation. (learning.quantum.ibm.com)