egtry / Quantum States & Qubits Step by Step

Hardware Idealizations

The finite-state diagrams are idealized prepare, gate, and measure boxes, not a full hardware model.

Calculate the baseline

Use two ideal X operations as a testable state-map contract. The input must return exactly up to numerical roundoff.

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

  1. X² = I — Each of these ideal gates is its own inverse.
  2. First output = (0.8, 0.6) — 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.

Compare a second case

Two ideal Z operations restore the initial relative signs. This is an algebraic check, not a prediction of real gate fidelity.

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

  1. Z² = I — Each of these ideal gates is its own inverse.
  2. First output = (0.6, -0.8) — 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.

Test the boundary and practise

Two H operations restore the input through interference. Isolation, pulse shapes, coherence times and calibration errors lie outside all three ideal maps.

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