The Hadamard gate
Create and recombine a superposition.
Intuition
H turns |0⟩ into |+⟩ and |1⟩ into |−⟩. Applying it again reverses the transformation. It is not a measurement or a random-number instruction.
The minus sign in H is essential. When H acts twice, amplitudes interfere: one outcome cancels and the other remains. Try H, H and inspect each step before returning to the challenge.
The mathematics
Look a little deeper
H exchanges the x and z directions on the Bloch sphere and reverses y. It can be represented as a π rotation about the (x+z)/√2 axis, up to global phase.
Use it
Prepare |+⟩ from |0⟩ with one H.
This exercise uses the same server-side state and circuit checks as its linked practice problem.
Build your circuit
Click a gate to append it, or drag it onto a wire. CX uses the selected control; SWAP uses it as the second operand. Basis order: |qₙ … q₀⟩.
Returned logical circuit · before transpilation · q0 on top
Connect to code
qc.h(0)
These operations go inside a circuit-building program. Practice problems provide a complete solve() template.
Check your understanding
First complete the circuit exercise successfully.