MIVORA Start learning free

Quantum Gates

Gates are the reversible “verbs” you apply to qubits — one makes a superposition, one makes entanglement, and a sequence is a circuit.

Quantum Computing · Lesson 7 · 10 min read

You now own the big ideas — superposition, interference, entanglement — but here’s the practical gap: how do you actually do anything to a qubit? You can’t just type a number into it. A quantum program is built the way a classical one is: from a small kit of basic operations applied in order. For qubits those operations are gates. Astonishingly, just two of them are enough to take two plain qubits and build the entangled pair from L05. Hold the question: what are the basic “verbs” for programming a qubit, and what must they do that ordinary computer instructions don’t?

Gates are the verbs — and they are reversible

A gate is an operation that transforms a qubit’s state — the quantum cousin of classical logic gates like NOT. The simplest is the X gate (“quantum NOT”): it flips 0 to 1 and 1 to 0. The crucial twist is that quantum gates are reversible — every gate can be undone, because it merely rotates the qubit’s state rather than throwing information away. Classical AND, by contrast, takes two bits to one and loses the inputs forever. Until the final measurement, a quantum computer never destroys information; it only rotates it.

The Hadamard gate: how you enter superposition

The workhorse of quantum computing is the Hadamard gate (H). Apply it to a definite 0 and you get a perfect 50/50 superposition of 0 and 1 — the doorway out of the classical world and into the blend. And because gates are reversible, applying H again turns that blend right back into a clean 0. Almost every quantum algorithm opens by Hadamard-ing its qubits to spread amplitude across all possibilities — the raw material interference then sculpts.

Worked example
Start with a qubit at definite 0. Apply H → it’s now an equal blend of 0 and 1; measure many copies and you’d see ~50% each. But don’t measure — instead apply H a second time. The blend rotates exactly back to 0, and now you’d measure 0 every time. That clean round-trip is reversibility in action.

Two-qubit gates entangle; circuits chain it all

To link qubits you need a two-qubit gate. The key one is CNOT (controlled-NOT): it flips a target qubit only if a control qubit is 1. On its own it’s a conditional flip — but feed it a superposition and it creates entanglement. A quantum circuit is just a sequence: take some qubits, apply gates (Hadamards to make superposition, CNOTs to entangle, more gates to drive interference), then measure. Gates sculpt the amplitudes; measurement reads out the result. That’s the entire anatomy of a quantum program.

An everyday analogy

Quantum gates are rotations, not blenders. A classical AND gate is like cracking two eggs and whisking them into batter: two things go in, one comes out, and you can never recover the original eggs — information is gone. A quantum gate is like turning the hand of a clock by a precise angle: whatever you turn, you can always turn back, so nothing is lost. The Hadamard is the special turn that points the hand exactly “halfway,” putting a definite 0 into a perfect 50/50 blend — and turning it once more brings the hand right back to 0.

Worked example
Building the L05 entangled pair from just two gates:
1. Start with two qubits, both at 0 — the pair is in state “00”.
2. Apply a Hadamard to qubit A. Now A is a 50/50 blend, so the pair is an equal blend of “00” and “10”.
3. Apply CNOT with A as control and B as target: it flips B wherever A is 1. So “00” stays “00”, and “10” becomes “11”.
4. Result: an equal blend of “00” and “11” — exactly the “they match” entangled pair from L05.
5. Two gates — one for superposition, one for entanglement — and you’ve built a genuinely quantum state. Add gates to create interference, then measure. That sequence is a quantum circuit.

This is the reading. The interactive version — active-recall quiz, a hands-on experiment you run in your own AI, and an earned mastery check — is free in the app.

Start this lesson free →