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
- Prepare the State. Prepare the state to examine on Q1. Here it is 1.
- Superpose the Ancilla. A Hadamard on the helper (Q0) creates the two branches to compare.
- Controlled-U. Apply Z to the state only when the helper is 1.
- Interfere. A second Hadamard on the helper compares the two branches.
- 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.