Skip to content

Leakage ​

Leakage model, simulator and sampler

15/15 passed in 11929ms

TestWhat it doesResult
test_arg_validationRates outside [0, 1] and unknown kick names are refused at construction.✅ pass
test_kick_channelsOne partner channel per axis; only the twirled arm is Pauli.✅ pass
test_leaked_is_inertA leaked qubit takes no gate while its neighbours do, and measuring it still adds one record bit.✅ pass
test_matches_plain_simAt leak=0 the leaky simulator tracks a plain one gate for gate, with weight 1.✅ pass
test_readout_biasreadout pins P(measure 1 | leaked): 1.0 always reads 1, 0.0 always reads 0.✅ pass
test_reset_clears_flagA reset is the leakage-reduction unit: both MR and R clear the flag.✅ pass
test_seep_returns_excitedSeeping back returns the qubit in |1>, where the |2> level decays to.✅ pass
test_ideal_when_offWith no Pauli noise and no leakage every detector and observable stays 0.✅ pass
test_leak_damagesLeakage alone damages a noiseless surface code (its X ancillas sit in |+>), and the detection rate rises with the leak rate.✅ pass
test_needs_excitationLeakage cannot fire where the gate pair is never both-excited.✅ pass
test_twirl_weights_unitThe twirled arm carries unit weights; the coherent arm carries real ones.✅ pass
test_zero_rate_identicalAt leak=0 the leaky sampler reproduces the plain Python sampler bit for bit.✅ pass
test_kick_keeps_supportTwirling the kick changes the damage, not which syndromes escape col(H).✅ pass
test_leakage_outside_colspaceLeakage syndromes leave col(H), so no DEM at any priors can explain them.✅ pass
test_pauli_inside_colspaceEvery Pauli syndrome lies in the column space of the DEM check matrix.✅ pass