egtry / Quantum States & Qubits Step by Step

H Then H Interference

Applying H again shows constructive and destructive interference in a finite qubit state.

Calculate the baseline

Start in zero and apply H twice. At the final zero output, the two path contributions add; at the one output they cancel.

Apply gate H twice to (1, 0). What is the final zero probability?

  1. H² = I — Each of these ideal gates is its own inverse.
  2. First output = (0.7071067812, 0.7071067812) — Apply the first matrix to the signed amplitudes.
  3. Second output = (1, 0) — Apply the same matrix again.
  4. P0 = 1 1 — Square the restored zero amplitude.
  5. ✓ — Independent check: The identity must preserve the original complementary probability.

Enable JavaScript to control the model and practise.

Compare a second case

Start in one. The signs now select the opposite final basis state. H followed by H restores both inputs.

Apply gate H twice to (0, 1). What is the final zero probability?

  1. H² = I — Each of these ideal gates is its own inverse.
  2. First output = (0.7071067812, -0.7071067812) — Apply the first matrix to the signed amplitudes.
  3. Second output = (0, 1) — Apply the same matrix again.
  4. P0 = 0 1 — Square the restored zero amplitude.
  5. ✓ — Independent check: The identity must preserve the original complementary probability.

Enable JavaScript to control the model and practise.

Test the boundary and practise

A non-basis input returns to its initial amplitudes too. Inspect both intermediate and final states before squaring.

Apply gate H twice to (0.6, 0.8). What is the final zero probability?

  1. H² = I — Each of these ideal gates is its own inverse.
  2. First output = (0.9899494937, -0.1414213562) — Apply the first matrix to the signed amplitudes.
  3. Second output = (0.6, 0.8) — Apply the same matrix again.
  4. P0 = 0.36 1 — Square the restored zero amplitude.
  5. ✓ — Independent check: The identity must preserve the original complementary probability.

Enable JavaScript to control the model and practise.

Recap