Gates & circuits

quantum gate

A quantum gate is an operation that transforms the state of one or more qubits. Think of it as the quantum cousin of a classical logic gate like AND or NOT — but with two important differences. First, a quantum gate is always reversible: from the output you can always recover the input, because the gate is a unitary operation (it rotates the qubit's state without ever erasing information). Second, a quantum gate can do things a classical gate cannot, like put a qubit into a superposition of 0 and 1, or link two qubits into an entangled state where their outcomes are correlated.

Gates come in small pieces that you chain together to build a circuit, much like wiring logic gates into a larger function. Single-qubit gates rotate one qubit's state — for example, the Hadamard gate turns a definite 0 into an equal mix of 0 and 1. Two-qubit gates, like the controlled-NOT (CNOT), let one qubit influence another, which is how entanglement is created. A small set such as {H, T, CNOT} is universal, meaning you can approximate any quantum computation by composing enough of these gates. Crucially, the gate only reshapes the amplitudes inside the state; you still learn nothing until you measure, and measurement gives a single 0 or 1 with a probability set by the Born rule.

The power of a quantum algorithm does not come from a gate magically testing every possibility at once. It comes from carefully chosen sequences of gates that steer the amplitudes so that wrong answers cancel out and right answers reinforce — interference — before the final measurement. Designing useful gate sequences is hard, and on today's NISQ hardware gates are noisy and imperfect, which is why running deep circuits reliably remains a major challenge.

H|0> = (|0> + |1>)/sqrt(2)

The Hadamard gate H acting on |0> produces an equal superposition — a definite input becomes a balanced mix, ready to interfere with later gates.

Gates manipulate amplitudes, not stored answers — the speedup of a quantum algorithm depends entirely on whether its gate sequence makes the right outcomes interfere constructively, which only happens for certain structured problems.

Also called
quantum logic gateunitary gate量子逻辑门量子邏輯閘酉门酉閘幺正门