Codes
Lattice code families, variants and blind noise
14/14 passed in 41005ms
| Test | What it does | Result |
|---|---|---|
test_bad_arguments | ValueError for an unknown pattern / start / edge / memory / deform name, an off-grid deform qubit, a bias with no Pauli set or axis, a wrong argument count, distance or rounds out of range, and a non-commuting or non-CSS build_circuit check set (the message names CSS). | ✅ pass |
test_blind_axis_table | blind_axis names the basis a channel is invisible in from its live branches: Z_ERROR and pz-only PAULI_CHANNEL_1 are Z-blind, RZ / RX keep their axis, mixed and zero-rate channels are blind to nothing. | ✅ pass |
test_blind_warning | A builder warns once when its noise commutes with every check and logical it reads (same-axis Pauli, rotation or pz-only channel), and not for the other basis, an xzzx or all-H deformed patch, mixed noise, Bacon-Shor, or p=0. | ✅ pass |
test_colourings | The start="Z" and "X" colourings agree under depolarizing noise at 2x2 and under amplitude damping at 3x3 (a grid rotation maps one onto the other), but split under amplitude damping at 2x4 (mat count 4). AD is decoded exactly (chi TN). | ✅ pass |
test_decode_below_trivial | Under depolarizing noise every rotated (pattern, start, edge) variant decodes (exact MLD) far below the always-zero predictor: distance is preserved. | ✅ pass |
test_deform_map_reproduces_xzzx | pattern="xzzx" is H on the (r+c)-even sublattice, so the same explicit deform map emits a bit-identical circuit. | ✅ pass |
test_dem_warnings | The DEM backstops the builders: every family warns under Z noise it cannot see; Bacon-Shor under Z noise warns once, since detectors fire but no fault reaches the logical; the dual basis and p=0 warn nothing. | ✅ pass |
test_detector_coords | The rotated code records one distinct half-integer (x, y, t) per detector, t over 0..rounds and one (x, y) per Z plaquette; the toric code records none. | ✅ pass |
test_families | Every family at d=3 over 3 rounds has the expected qubit / detector / observable counts, is silent at p=0 in both memory bases, sees Z noise in its X memory, and has a graphlike DEM except the hex color code. | ✅ pass |
test_hook_order | On the even edge, X faces read N order (NW, SW, NE, SE) and Z faces Z order, so hooks run across the logical; reading both alike cuts the circuit distance to ceil((d+1)/2). Faces keep distinct qubits and weight 2 or 4. | ✅ pass |
test_logical_weight | Every derived surface and toric logical at d=3 and d=4 has weight d. | ✅ pass |
test_memory_mirror | A Z memory is blind to Z noise while its X memory sees it; the X memory under Z noise matches the Z memory under X noise; raising the Z bias raises the X memory's LER and pins the Z memory's at zero. | ✅ pass |
test_triangular_kagome_dual | Triangular and kagome are medial duals, so triangular's X memory under Z noise and kagome's Z memory under X noise give bit-identical records per seed. | ✅ pass |
test_variants_silent | Every rotated (pattern, start, edge, memory) and unrotated (pattern, start, memory) variant, and random per-qubit deformations with prep, is silent at p=0 and keeps the default's qubit / detector / observable counts. | ✅ pass |