TN
Tensor-network contraction and ML decoding
11/11 passed in 89803ms
| Test | What it does | Result |
|---|---|---|
test_beats_mwpm_with_correlations | With depolarizing Y-correlations MLD beats MWPM, which decodes X/Z apart. | ✅ pass |
test_bond_cap_on_toric | On a toric network chi=1 changes the class weights and reports dropped weight, while chi=64 restores the exact contraction and drops nothing. | ✅ pass |
test_contract_matches_einsum | Contracting a small star network agrees with a direct numpy einsum. | ✅ pass |
test_knobs_match_exact_batch | On sampled rotated-surface d=3 shots a bond cap of 16 and a memory budget of 64 both decode every shot like the exact contraction. | ✅ pass |
test_matches_brute_force | MLD, bond-capped MLD and sliced MLD each reproduce brute-force maximum likelihood on every repetition-code syndrome. | ✅ pass |
test_memory_budget_bounds_the_peak | A budget below the exact peak slices, and the largest intermediate then fits the budget, which a bond cap alone does not promise. | ✅ pass |
test_never_worse_than_mwpm | On a graphlike surface code MLD is never worse than MWPM (it is optimal). | ✅ pass |
test_parity_matches_oracle | The dense XOR node and, past 8 legs, the chained factorisation both equal an independent XOR table at either target. | ✅ pass |
test_truncated_runs_at_distance_five | A bonded MLD decodes rotated-surface d=5, where the exact contraction's treewidth would explode. | ✅ pass |
test_truncation_and_slicing | A bond cap covering the cut and slicing a shared leg leave a random network's contraction exact, while chi=1 below the cut's rank changes it. | ✅ pass |
test_truncation_drop_is_no_bound | truncation_drop is a diagnostic, not a bound on the contraction's error: on a doubled amplitude-damping network a chi=2 cap moves the class weights by more than the weight it reports dropping. | ✅ pass |