Skip to content
All lessons

Quantum Gates

A comprehensive introduction to quantum gates: what they are, why they are needed, how they transform quantum states, the mathematics of unitary operators, reversibility, matrix representation, gate composition, non-commutativity, and their connection to Bloch-sphere rotations.

Lesson 6: Quantum Gates

Learning Objectives

By the end of this lesson, you will be able to:

  • Define what a quantum gate is and describe it as an operation that transforms a quantum state into another quantum state.
  • Explain why quantum computation requires controlled transformations beyond simply preparing a qubit.
  • Describe how a gate acts on a state vector to produce a new state vector.
  • Explain what a unitary operator is and why unitarity is required for a physically valid quantum gate.
  • Explain why quantum gates are reversible, and contrast this with irreversible classical operations.
  • Represent a single-qubit gate as a 2×2 matrix and apply it to a state vector using matrix-vector multiplication.
  • Apply a sequence of gates to a quantum state and understand how composition works.
  • Understand why gate order matters (non-commutativity).
  • Compute and interpret the inverse of a gate.
  • Connect single-qubit gates conceptually to rotations of the Bloch vector introduced in Lesson 5.

1. Introduction to Quantum Gates

In Lessons 1–5, you learned how to describe a qubit's state, how superposition works, how measurement produces probabilistic outcomes, and how to visualize a qubit as a point on the Bloch sphere. But a qubit sitting in some fixed state does not, by itself, compute anything. To perform a computation, we need a way to deliberately and controllably change a quantum state. That controlled change is what a quantum gate does.

Conceptually, the picture is simple:

Quantum state  →  Quantum operation (gate)  →  New quantum state
        |ψ⟩      →            U             →         |ψ'⟩

A quantum gate takes an input state, applies a well-defined mathematical transformation, and produces an output state. This is analogous, at a very high level, to a classical logic gate (like AND, OR, or NOT) that takes input bits and produces output bits. But the resemblance is only at the level of "input goes in, output comes out." The internal mathematics is fundamentally different, and this difference has deep physical consequences.

Classical logic gates operate on bits (0 or 1) using Boolean logic. Many classical gates, such as AND and OR, are not reversible: given only the output, you cannot always reconstruct the inputs. For example, if an AND gate outputs 0, you cannot tell from that alone whether the inputs were (0,0), (0,1), or (1,0).

Quantum gates operate on the complex probability amplitudes of a quantum state. They must be reversible and unitary — a strict mathematical requirement rooted in the physics of quantum evolution. Every valid quantum gate can, in principle, be undone by applying another quantum gate (its inverse). This reversibility is not optional; it is a direct consequence of how quantum mechanics allows isolated systems to evolve.