Leakage
Leakage model, simulator and sampler
15/15 passed in 11929ms
| Test | What it does | Result |
|---|---|---|
test_arg_validation | Rates outside [0, 1] and unknown kick names are refused at construction. | ✅ pass |
test_kick_channels | One partner channel per axis; only the twirled arm is Pauli. | ✅ pass |
test_leaked_is_inert | A leaked qubit takes no gate while its neighbours do, and measuring it still adds one record bit. | ✅ pass |
test_matches_plain_sim | At leak=0 the leaky simulator tracks a plain one gate for gate, with weight 1. | ✅ pass |
test_readout_bias | readout pins P(measure 1 | leaked): 1.0 always reads 1, 0.0 always reads 0. | ✅ pass |
test_reset_clears_flag | A reset is the leakage-reduction unit: both MR and R clear the flag. | ✅ pass |
test_seep_returns_excited | Seeping back returns the qubit in |1>, where the |2> level decays to. | ✅ pass |
test_ideal_when_off | With no Pauli noise and no leakage every detector and observable stays 0. | ✅ pass |
test_leak_damages | Leakage alone damages a noiseless surface code (its X ancillas sit in |+>), and the detection rate rises with the leak rate. | ✅ pass |
test_needs_excitation | Leakage cannot fire where the gate pair is never both-excited. | ✅ pass |
test_twirl_weights_unit | The twirled arm carries unit weights; the coherent arm carries real ones. | ✅ pass |
test_zero_rate_identical | At leak=0 the leaky sampler reproduces the plain Python sampler bit for bit. | ✅ pass |
test_kick_keeps_support | Twirling the kick changes the damage, not which syndromes escape col(H). | ✅ pass |
test_leakage_outside_colspace | Leakage syndromes leave col(H), so no DEM at any priors can explain them. | ✅ pass |
test_pauli_inside_colspace | Every Pauli syndrome lies in the column space of the DEM check matrix. | ✅ pass |