Quantum Gates and Circuits
Quantum gates are the basic operations of a quantum computer, and a quantum circuit is a sequence of those operations applied to qubits. They play the role that logic gates (AND, OR, NOT) play in ordinary computers, but they obey the rules of quantum mechanics, which makes them fundamentally different from their classical counterparts.
Gates are reversible rotations
A qubit's state can be pictured as an arrow on a sphere (the Bloch sphere). A quantum gate rotates that arrow, and every such rotation is described by a unitary matrix — a transformation that preserves total probability and can always be undone. This reversibility is a strict requirement: unlike a classical AND gate, which discards information, a quantum gate never erases the state it acts on.
Common single-qubit gates include the X gate (a bit flip, the quantum NOT), the Z gate (a phase flip), and the Hadamard gate, which turns a definite 0 or 1 into an equal superposition of both. The key two-qubit gate is the controlled-NOT (CNOT), which flips a target qubit only when a control qubit is 1. CNOT is what creates entanglement between qubits.
Universality and circuits
Just as a handful of classical gates can build any logic function, a small set of quantum gates is universal: combinations of single-qubit rotations together with CNOT can approximate any quantum operation to arbitrary precision. A quantum circuit is read left to right, with horizontal lines representing qubits and symbols marking the gates applied in sequence. The circuit ends with measurement, which collapses each qubit to a definite 0 or 1 and yields the computation's classical output.
A common misconception
A quantum circuit does not simply try all answers at once and hand back the right one. Superposition lets the computation explore many possibilities in parallel, but measurement returns only a single outcome. The art of quantum algorithm design is arranging gates so that interference amplifies the probability of useful answers and cancels the rest before measurement.
Related reading
References and further reading
- Nielsen, M. A. & Chuang, I. L. Quantum Computation and Quantum Information. Cambridge University Press, 2010.
- Griffiths, D. J. & Schroeter, D. F. Introduction to Quantum Mechanics, 3rd ed. Cambridge University Press, 2018.