Quantum Gates and Circuits Explained
Gates change qubits
A normal logic gate takes bits in and gives bits out. A quantum gate acts on the state of a qubit. Unlike many classical gates, quantum gates are reversible, meaning you can always run them backward.
Gates you will hear about
- X gate: flips a qubit between 0 and 1, like a NOT gate.
- Hadamard (H) gate: puts a qubit into an even superposition of 0 and 1.
- CNOT gate: works on two qubits and flips the second only if the first is 1. Combined with a Hadamard gate, it creates entanglement.
- Phase gates: change the internal phase of a qubit, which is what lets interference work.
What a circuit looks like
A circuit diagram shows one horizontal line per qubit, running left to right in time. Gates sit on the lines. At the end, measurement gates turn the quantum state into ordinary 0s and 1s. Because results are probabilistic, a circuit is usually run many times and the outcomes are counted.
Gate errors matter
Every gate on real hardware has a small chance of error. Deep circuits pile those errors up, which is why error correction is so important. Fewer, better gates beat many noisy ones.
Why this matters outside the lab
Every quantum algorithm, including those that threaten some cryptography, is built from circuits of gates. See quantum algorithms explained for how they are used.
Worked example: making a Bell pair
Start with two qubits, both set to 0. Apply a Hadamard gate to the first, which gives it an even blend of 0 and 1. Then apply a CNOT with the first qubit as control and the second as target. The pair is now in an entangled state: measure them and you get 00 half the time and 11 half the time, never 01 or 10 on a perfect machine. Only two gates were needed. Real devices give a few stray results because of noise, which is how you can see the error rate directly.
More gates worth knowing
| Gate | Qubits | What it does |
|---|---|---|
| X | 1 | Flips 0 and 1 |
| Z | 1 | Flips the phase of the 1 part |
| H (Hadamard) | 1 | Makes or undoes an even superposition |
| S and T | 1 | Small phase turns. T is the costly one in error corrected machines |
| CNOT | 2 | Flips the target if the control is 1 |
| Toffoli | 3 | Flips the target if both controls are 1 |
A small set of gates, for example Hadamard, T and CNOT, can be combined to approximate any quantum operation as closely as you like. That is why a hardware maker only has to build a few gates very well.
Common mistakes
- Reading a circuit right to left. Diagrams run left to right in time.
- Thinking measurement is just another gate. It ends the superposition and cannot be undone.
- Counting only gates, not depth. Depth is how many steps are done in sequence, and it drives how much noise builds up.
- Judging a machine by qubit count alone. Gate quality and connectivity matter as much.
Why T gates matter in 2026
In error corrected designs, T and Toffoli gates are the expensive ones, so resource estimates for big algorithms are quoted in these gate counts. Google's 2026 elliptic curve estimate, for example, quotes roughly 70 to 90 million Toffoli gates. Fewer expensive gates means a smaller, faster machine. See T gates and logical qubits and the surface code.
How to check this yourself
Build the Bell pair in a free simulator and a real device, then compare the counts. The difference is your first hands-on measurement of noise. Frameworks are compared in this guide.
Sources and further reading
- Google Quantum AI and collaborators 2026: Toffoli gate counts for secp256k1 (IACR ePrint 2026/625)
- Preskill 2018: Quantum Computing in the NISQ era and beyond (arXiv)
- IBM Quantum Platform: plans overview
Checked 2026-10-09. Research and standards change often, so check the primary documents. Nothing here is financial advice. The QNT memecoin is independent of Quantinuum Ltd, the real company, and of every lab, company and standards body named on this page.
Frequently asked questions
What is a Hadamard gate?
The Hadamard gate puts a qubit that starts at 0 or 1 into an even blend of both. It is often the first step of a quantum circuit.
What does a CNOT gate do?
It acts on two qubits and flips the second qubit only when the first is 1. It is a key way to create entanglement.
What is a quantum circuit?
It is an ordered series of quantum gates applied to qubits, ending with measurement. It is the standard way to describe a quantum program.
Are quantum gates reversible?
Yes. Ideal quantum gates can always be undone, unlike many classical logic gates. Measurement is the step that is not reversible.
What is a Toffoli gate?
It is a three qubit gate that flips the target qubit only when both control qubits are 1. It is a building block for quantum arithmetic.
Why are T gates expensive?
On error corrected machines they need special prepared states, so they cost far more than simpler gates. Resource estimates therefore count them closely.
How many gates does a useful program need?
It varies. Small demos use tens of gates. Large algorithms like factoring real keys are estimated at tens of millions or more of expensive gates.
What is circuit depth?
Depth is the number of sequential layers of gates. Deeper circuits give noise more time to build up.
Keep reading
- What Is a Qubit? Superposition and Measurement Explained
A qubit is the basic unit of a quantum computer. Learn how qubits work, how they are built, and why they are fragile. - Quantum Algorithms Explained for Beginners
What is a quantum algorithm? Learn how Shor's, Grover's and other quantum algorithms work in plain English, and which ones matter for cryptography and crypto. - Gate Model vs Quantum Annealing: What Is the Difference?
Gate model quantum computers run circuits of gates; quantum annealers solve optimization problems. Learn the difference in plain English and why it matters. - NISQ Explained: Noisy Intermediate-Scale Quantum Computers
What does NISQ mean? Learn why today's noisy, mid-size quantum computers are limited, what they can do, and how the field plans to move past them.
All Quantum computing guides | Back to top | Search the site
Main pages: Quantum computing explained | Quantum and crypto | Companies | Quantum news | Glossary