Quantum logic gate

Also known as: quantum gate

On this page 7

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.

PropertyMathematical formPractical consequence
UnitarityU†U = IProbabilities always sum to 1
ReversibilityInverse U† existsNo information is erased by the gate
LinearityU(a|0⟩ + b|1⟩) = aU|0⟩ + bU|1⟩Gates act on all superposed branches at once
Dimension2^n × 2^n for n qubitsMatrix size grows exponentially with qubits
Global phase freedomU and e^(iφ)U act identicallyOverall phase factors are physically unobservable
Defining properties of a quantum gate

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.

GateQubitsEffectTypical role
Pauli X1Swaps |0⟩ and |1⟩Quantum analog of NOT
Hadamard (H)1Maps |0⟩ to an equal superpositionCreating superposition, basis changes
Phase (S)1Adds a 90-degree phase to |1⟩Clifford phase adjustment
T gate1Adds a 45-degree phase to |1⟩Non-Clifford resource for universality
Rotation gates1Rotate by a continuous angle θParameterized and variational circuits
CNOT2Flips target if control is |1⟩Generating entanglement
SWAP2Exchanges two qubit statesRouting on limited connectivity
Toffoli3Flips target if both controls are |1⟩Reversible classical arithmetic
Frequently used quantum gates

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.

AspectClassical logic gateQuantum logic gate
InputDefinite bits 0 or 1Complex amplitudes over basis states
ReversibilityUsually irreversibleAlways reversible
Mathematical modelBoolean functionUnitary matrix
Copying inputsFan-out is freeForbidden by no-cloning theorem
Error behaviorDiscrete bit flipsContinuous drift in amplitude and phase
Reading the resultOutput visible at any timeOnly measurement reveals information
Classical gates compared with quantum gates

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.

PlatformCommon native two-qubit gateSingle-qubit control method
Superconducting qubitsCZ, iSWAP or cross-resonanceMicrowave pulses
Trapped ionsMølmer–Sørensen (XX) gateLaser or microwave pulses
Neutral atomsRydberg-blockade CZLaser pulses
Photonic systemsMeasurement-induced fusionPhase shifters and beam splitters
Typical native gates by hardware platform

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 sourceEffect on the gateTypical mitigation
DecoherenceLoss of phase and energy informationShorter gates, better materials
Control miscalibrationOver- or under-rotationFrequent recalibration, pulse shaping
CrosstalkUnwanted action on idle qubitsFrequency allocation, scheduling
LeakagePopulation outside |0⟩ and |1⟩Leakage-reduction operations
Gate error sources and mitigation approaches
  • 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.