Double Gate Identity Audit
Finite gate loops are checked by applying the gate twice and comparing the exact output state with the starting state.
Calculate the baseline
One X swaps 3/5 and 4/5; the second X returns them. Compare full amplitudes, not just the final probability.
Apply gate X twice to (0.6, 0.8). What is the final zero probability?
- X² = I — Each of these ideal gates is its own inverse.
- First output = (0.8, 0.6) — Apply the first matrix to the signed amplitudes.
- Second output = (0.6, 0.8) — Apply the same matrix again.
- P0 = 0.36 1 — Square the restored zero amplitude.
- ✓ — Independent check: The identity must preserve the original complementary probability.
Enable JavaScript to control the model and practise.
Compare a second case
The basis-one case tests the other direction of the swap. A closed loop must work for each input.
Apply gate X twice to (0, 1). What is the final zero probability?
- X² = I — Each of these ideal gates is its own inverse.
- First output = (1, 0) — Apply the first matrix to the signed amplitudes.
- Second output = (0, 1) — Apply the same matrix again.
- P0 = 0 1 — Square the restored zero amplitude.
- ✓ — Independent check: The identity must preserve the original complementary probability.
Enable JavaScript to control the model and practise.
Test the boundary and practise
Two Z operations return an initially negative relative sign. The calculated final vector is the evidence for the identity claim.
Apply gate Z twice to (0.6, -0.8). What is the final zero probability?
- Z² = I — Each of these ideal gates is its own inverse.
- First output = (0.6, 0.8) — Apply the first matrix to the signed amplitudes.
- Second output = (0.6, -0.8) — Apply the same matrix again.
- P0 = 0.36 1 — Square the restored zero amplitude.
- ✓ — Independent check: The identity must preserve the original complementary probability.
Enable JavaScript to control the model and practise.
Recap
- Audit both gate applications.
- Retain signed amplitudes throughout.
- Each checked loop preserves the original state.