k›ketwise.
FUNDAMENTALS / 09 / GATES

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

H=12[111−1],H2=IH=\frac1{\sqrt2}\begin{bmatrix}1&1\\1&-1\end{bmatrix},\quad H^2=I
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₀⟩.

q0

Returned logical circuit · before transpilation · q0 on top

0 / 32 gates · terminal measurement of all qubits

Connect to code

qc.h(0)

These operations go inside a circuit-building program. Practice problems provide a complete solve() template.

Solve the linked Qiskit problem →

Check your understanding

H followed by H on |0⟩ gives…

First complete the circuit exercise successfully.