You are reading without signing in. Sign in or continue as guest to take quizzes and climb the ranks.
Superposition and the Hadamard gate
Where superpositions come from, what phase is, and why H twice does nothing.
- 01Apply H to |0⟩ and |1⟩ by hand.
- 02Distinguish |+⟩ from |−⟩ even though both give 50/50 outcomes.
- 03Predict the result of H·H.
Superposition is not a mystery word; it is a direction in the vector space that is neither |0⟩ nor |1⟩. The Hadamard gate rotates the basis states onto two such directions.
01Phase: the sign you cannot see directly
|+⟩ and |−⟩ both measure 0 or 1 with probability one half. The minus sign is a relative phase. It is invisible to a measurement in the computational basis but it decides what happens next: H|+⟩ = |0⟩ while H|−⟩ = |1⟩. Interference is just phases adding or cancelling.
See phase on the Q-sphere
Open the State tab. Both amplitudes have probability 0.5, yet the point for |1⟩ carries phase π (shown by its colour). Remove the Z gate and the phase disappears while the bars stay identical.
OPENQASM 3.0;
include "stdgates.inc";
qubit[1] q;
h q[0];
z q[0];
02H twice
Interference, step by step
The circuit opens with the Debug tab ready. Press the Debug button to start, then the Step over button (the arrow) to apply one gate at a time. After the first H the probabilities are 50/50; after the second they are back to 100% on |0⟩.
OPENQASM 3.0;
include "stdgates.inc";
qubit[1] q;
h q[0];
h q[0];
2 questions · one try each counts
What is H|−⟩?
Sign in to answer and climb the ranks; you will come back to this lesson.
Two states give identical measurement statistics in the computational basis. Can they still differ?
Sign in to answer and climb the ranks; you will come back to this lesson.