A quantum logic gate, often shortened to quantum gate, is a reversible operation described by a unitary matrix that transforms the state of one or more qubits. In quantum computing, gates play the role that AND, OR and NOT play in classical digital logic, and the study of Quantum gates & circuits treats them as the elementary instructions from which every quantum program is assembled.
Unlike a classical gate, a quantum gate acts on complex probability amplitudes rather than on definite bits, so it can create superposition, generate entanglement and steer interference between computational paths. A gate never measures or copies the state it acts on; it only rotates that state within the space of possible quantum states.
How a quantum logic gate transforms qubit states
A quantum gate acting on n qubits is represented by a 2^n × 2^n unitary matrix U, which satisfies U†U = I. Applying the gate multiplies the state vector by U, so a single-qubit gate is a 2 × 2 matrix and a two-qubit gate is a 4 × 4 matrix. Because unitary matrices preserve the norm of a vector, the total probability of all measurement outcomes stays exactly 1 after every gate.
Unitarity also makes every gate logically reversible: the inverse operation U† always exists and is itself a valid gate. This is a sharp contrast with classical AND or OR gates, which discard information because two inputs map to one output. Reversibility is why quantum circuits often need extra qubits, called ancilla qubits, to hold intermediate results that a classical circuit would simply overwrite.
Geometrically, a single-qubit gate is a rotation of the Bloch sphere, the unit sphere on which every pure single-qubit state can be drawn. The following table lists the main mathematical properties that define a gate and what each one guarantees in practice.
| Property | Mathematical form | Practical consequence |
|---|---|---|
| Unitarity | U†U = I | Probabilities always sum to 1 |
| Reversibility | Inverse U† exists | No information is erased by the gate |
| Linearity | U(a|0⟩ + b|1⟩) = aU|0⟩ + bU|1⟩ | Gates act on all superposed branches at once |
| Dimension | 2^n × 2^n for n qubits | Matrix size grows exponentially with qubits |
| Global phase freedom | U and e^(iφ)U act identically | Overall phase factors are physically unobservable |
Common single-qubit and multi-qubit gates
Quantum gates fall into families by the number of qubits they act on and by their algebraic structure. Single-qubit gates change the amplitudes and relative phase of one qubit, while two-qubit gates such as CNOT and controlled-Z are the only way to create entanglement between qubits. Three-qubit gates like Toffoli and Fredkin are usually decomposed into one- and two-qubit gates before execution.
The table below summarizes the gates that appear most often in textbooks, compilers and hardware documentation, together with their typical role in a circuit.
| Gate | Qubits | Effect | Typical role |
|---|---|---|---|
| Pauli X | 1 | Swaps |0⟩ and |1⟩ | Quantum analog of NOT |
| Hadamard (H) | 1 | Maps |0⟩ to an equal superposition | Creating superposition, basis changes |
| Phase (S) | 1 | Adds a 90-degree phase to |1⟩ | Clifford phase adjustment |
| T gate | 1 | Adds a 45-degree phase to |1⟩ | Non-Clifford resource for universality |
| Rotation gates | 1 | Rotate by a continuous angle θ | Parameterized and variational circuits |
| CNOT | 2 | Flips target if control is |1⟩ | Generating entanglement |
| SWAP | 2 | Exchanges two qubit states | Routing on limited connectivity |
| Toffoli | 3 | Flips target if both controls are |1⟩ | Reversible classical arithmetic |
Controlled gates follow a general pattern: a control qubit decides whether a chosen operation is applied to a target qubit. Because the control can itself be in superposition, the result is not a branch in the classical sense but an entangled joint state.
How quantum gates differ from classical logic gates
Quantum and classical gates share the idea of composing simple operations into larger computations, but they differ in almost every physical and mathematical detail. The comparison below highlights the differences that matter most when translating an algorithm from classical to quantum form.
| Aspect | Classical logic gate | Quantum logic gate |
|---|---|---|
| Input | Definite bits 0 or 1 | Complex amplitudes over basis states |
| Reversibility | Usually irreversible | Always reversible |
| Mathematical model | Boolean function | Unitary matrix |
| Copying inputs | Fan-out is free | Forbidden by no-cloning theorem |
| Error behavior | Discrete bit flips | Continuous drift in amplitude and phase |
| Reading the result | Output visible at any time | Only measurement reveals information |
One misconception deserves emphasis: a quantum gate does not evaluate all answers in parallel and report them. It transforms amplitudes, and only a carefully designed sequence of gates makes constructive interference amplify the correct outcome before measurement.
Universal gate sets and native hardware gates
A universal gate set is a finite collection of gates whose combinations can approximate any unitary operation to arbitrary precision. A widely used example is {H, S, T, CNOT}, also called Clifford+T. The Clifford gates alone are not universal, and the Gottesman–Knill theorem shows that circuits built only from them can be simulated efficiently on a classical computer.
The Solovay–Kitaev theorem guarantees that approximating an arbitrary single-qubit gate to precision ε needs only a number of gates that grows polylogarithmically in 1/ε, which makes discrete gate sets practical. Physical processors, however, execute a native gate set determined by their hardware, and a compiler must translate abstract gates into these native operations.
| Platform | Common native two-qubit gate | Single-qubit control method |
|---|---|---|
| Superconducting qubits | CZ, iSWAP or cross-resonance | Microwave pulses |
| Trapped ions | Mølmer–Sørensen (XX) gate | Laser or microwave pulses |
| Neutral atoms | Rydberg-blockade CZ | Laser pulses |
| Photonic systems | Measurement-induced fusion | Phase shifters and beam splitters |
Gate fidelity, errors and practical limits
Real gates are never perfect, and their quality is expressed as gate fidelity, the overlap between the intended and the actual operation. On leading current hardware, single-qubit gates commonly reach about 99.9% fidelity or better, while two-qubit gates usually range from roughly 99% to 99.9%, depending on platform, calibration and qubit pair. Two-qubit gates are therefore the dominant error source in most circuits.
Errors arise from decoherence, imprecise control pulses, crosstalk between neighboring qubits and leakage out of the computational subspace. Gate duration matters as well: superconducting gates take tens to hundreds of nanoseconds, while trapped-ion gates often take tens to hundreds of microseconds but benefit from longer coherence times.
| Error source | Effect on the gate | Typical mitigation |
|---|---|---|
| Decoherence | Loss of phase and energy information | Shorter gates, better materials |
| Control miscalibration | Over- or under-rotation | Frequent recalibration, pulse shaping |
| Crosstalk | Unwanted action on idle qubits | Frequency allocation, scheduling |
| Leakage | Population outside |0⟩ and |1⟩ | Leakage-reduction operations |
- Circuit depth multiplies small gate errors, so shallow circuits succeed far more often.
- Limited connectivity forces extra SWAP gates, which add two-qubit errors.
- Fault-tolerant computing requires error-corrected logical gates, which cost many physical gates each.
In plain words
A quantum logic gate is a single step in a quantum program. A qubit can be pictured as an arrow pointing somewhere on a globe, and a gate turns that arrow to a new direction. Some gates flip it, some tilt it halfway between two answers and some link two qubits so that they behave as one system.
The important point is that a gate only turns the arrow and never looks at it. Looking happens at the end, in a measurement. Good quantum programs arrange the turns so that wrong answers cancel out and the right answer becomes the likely result.
A real-world example
A research team preparing a chemistry simulation writes its algorithm using Hadamard, rotation and CNOT gates. The target processor is a superconducting chip whose native gates are single-qubit microwave rotations and a controlled-Z two-qubit gate, with qubits connected only to their nearest neighbors.
The compiler rewrites each CNOT as a controlled-Z surrounded by Hadamard gates and inserts SWAP gates where two interacting qubits are not adjacent. The first compiled version contains about 120 two-qubit gates. With a two-qubit fidelity near 99.5%, the expected success rate is roughly 0.995^120, or about 55%.
By choosing a better initial qubit layout and merging consecutive single-qubit rotations, the team cuts the count to about 70 two-qubit gates, raising the estimated success rate to roughly 70%. The example shows why gate counts and native gate sets matter as much as the abstract algorithm.