Skip to main content

Plain-Language Intuition

Mode: Simple / School
Quantum algorithms often need a number like "how much does this operation change this state?" It is called an expectation value and lies between −1 and +1. The Hadamard test measures it with one helper qubit: 1. Put the helper in superposition. 2. Apply the operation to the state only if the helper is 1. 3. Apply a Hadamard to the helper and measure it. The helper compares two versions of the state: untouched and operated on. If they are the same, it always reads 0 (value +1). If they are exactly opposite, it always reads 1 (value −1). If they are unrelated, it reads 0 or 1 at random (value 0). This small circuit is the measuring stick inside variational algorithms, phase estimation and many quantum machine-learning methods.

Expectation Estimation

The Hadamard Test: quick reference

Estimates the expectation value of a unitary by interfering "apply U" with "do nothing" on one ancilla qubit.

Topic
Expectation Estimation
Level
Intermediate
Circuit size
2 Qubits
Key result
Measures ⟨ψ|U|ψ⟩ with a single ancilla

Concepts covered: Hadamard Test, Expectation Values, Controlled Unitaries, Interference

How the Hadamard Test works, step by step

  1. Prepare the State. Prepare the state to examine on Q1. Here it is 1.
  2. Superpose the Ancilla. A Hadamard on the helper (Q0) creates the two branches to compare.
  3. Controlled-U. Apply Z to the state only when the helper is 1.
  4. Interfere. A second Hadamard on the helper compares the two branches.
  5. Read the Expectation Value. The helper always reads 1, which means the expectation value is −1.

Frequently asked questions

What is the Hadamard Test?

Estimates the expectation value of a unitary by interfering "apply U" with "do nothing" on one ancilla qubit. It is a intermediate-level topic in expectation estimation.

How many qubits does the Hadamard Test circuit use?

The QuanBit tutorial uses a 2 qubits circuit. Key result: Measures ⟨ψ|U|ψ⟩ with a single ancilla.

Can I simulate Hadamard Test online for free?

Yes. The interactive Hadamard Test tutorial at https://www.quanbit.tech/learn/hadamard-test runs free in the browser with nothing to install. You can step through the circuit gate by gate, watch the probabilities, statevector and Bloch spheres update, build the circuit yourself and take a short quiz.