egtry / Quantum States & Qubits Step by Step

H Gate Superposition

The H gate creates equal amplitudes using exact one over square root of two.

Calculate the baseline

H sends the zero basis state to equal positive amplitudes 1/√2. Each outcome has probability one half.

Apply an ideal H gate to the normalized real amplitudes (1, 0). What is the output probability of zero?

  1. H: (1, 0) → (0.7071067812, 0.7071067812) — Apply the ideal gate to amplitudes before squaring.
  2. a′ = (a+b)/√2; b′ = (a−b)/√2 — Keep the signs: interference happens at the amplitude level.
  3. P0 = (0.7071067812)² = 0.5 1; P1 = 0.5 — Read the two computational-basis probabilities.
  4. ✓ — Independent check: Unitary gate conserves norm; independently reconstruct the complementary probability.

Enable JavaScript to control the model and practise.

Compare a second case

H sends the one basis state to equal magnitudes with opposite signs. Direct probabilities still give one half each.

Apply an ideal H gate to the normalized real amplitudes (0, 1). What is the output probability of zero?

  1. H: (0, 1) → (0.7071067812, -0.7071067812) — Apply the ideal gate to amplitudes before squaring.
  2. a′ = (a+b)/√2; b′ = (a−b)/√2 — Keep the signs: interference happens at the amplitude level.
  3. P0 = (0.7071067812)² = 0.5 1; P1 = 0.5 — Read the two computational-basis probabilities.
  4. ✓ — Independent check: Unitary gate conserves norm; independently reconstruct the complementary probability.

Enable JavaScript to control the model and practise.

Test the boundary and practise

H applied to the positive equal superposition produces the zero basis state. This comparison reveals why signs must be retained.

Apply an ideal H gate to the normalized real amplitudes (0.7071067812, 0.7071067812). What is the output probability of zero?

  1. H: (0.7071067812, 0.7071067812) → (1, 0) — Apply the ideal gate to amplitudes before squaring.
  2. a′ = (a+b)/√2; b′ = (a−b)/√2 — Keep the signs: interference happens at the amplitude level.
  3. P0 = (1)² = 1 1; P1 = 0 — Read the two computational-basis probabilities.
  4. ✓ — Independent check: Unitary gate conserves norm; independently reconstruct the complementary probability.

Enable JavaScript to control the model and practise.

Recap