{
 "schema_version": "0.2",
 "name": "[[30,4,6]] twisted-torus BB code (arXiv:2503.03827)",
 "code_type": "CSS",
 "n": 30,
 "k": 4,
 "checks": {
  "X": [
   [
    0,
    1,
    3,
    15,
    17,
    18
   ],
   [
    1,
    3,
    6,
    16,
    19,
    21
   ],
   [
    2,
    4,
    7,
    17,
    20,
    22
   ],
   [
    3,
    6,
    9,
    18,
    22,
    24
   ],
   [
    4,
    7,
    10,
    19,
    23,
    25
   ],
   [
    5,
    8,
    11,
    15,
    20,
    26
   ],
   [
    5,
    6,
    9,
    20,
    21,
    25
   ],
   [
    7,
    10,
    12,
    22,
    26,
    27
   ],
   [
    8,
    11,
    13,
    16,
    23,
    28
   ],
   [
    5,
    8,
    9,
    23,
    24,
    27
   ],
   [
    0,
    10,
    12,
    15,
    25,
    28
   ],
   [
    11,
    13,
    14,
    18,
    26,
    29
   ],
   [
    0,
    1,
    12,
    16,
    27,
    29
   ],
   [
    2,
    13,
    14,
    17,
    21,
    28
   ],
   [
    2,
    4,
    14,
    19,
    24,
    29
   ]
  ],
  "Z": [
   [
    0,
    5,
    10,
    15,
    25,
    27
   ],
   [
    1,
    8,
    12,
    15,
    16,
    27
   ],
   [
    0,
    2,
    13,
    17,
    28,
    29
   ],
   [
    0,
    3,
    11,
    15,
    16,
    18
   ],
   [
    1,
    4,
    14,
    17,
    19,
    29
   ],
   [
    2,
    5,
    6,
    20,
    21,
    24
   ],
   [
    1,
    6,
    13,
    16,
    18,
    21
   ],
   [
    2,
    3,
    7,
    17,
    19,
    22
   ],
   [
    4,
    8,
    9,
    20,
    23,
    24
   ],
   [
    3,
    9,
    14,
    18,
    21,
    24
   ],
   [
    4,
    6,
    10,
    19,
    22,
    25
   ],
   [
    5,
    7,
    11,
    20,
    23,
    26
   ],
   [
    7,
    9,
    12,
    22,
    25,
    27
   ],
   [
    8,
    10,
    13,
    23,
    26,
    28
   ],
   [
    11,
    12,
    14,
    26,
    28,
    29
   ]
  ]
 },
 "distance": {
  "d": 6,
  "X": {
   "value": 6,
   "confidence": "upper_bound",
   "witness": [
    1,
    7,
    12,
    13,
    17,
    26
   ]
  },
  "Z": {
   "value": 6,
   "confidence": "upper_bound",
   "witness": [
    3,
    13,
    14,
    16,
    18,
    29
   ]
  }
 },
 "provenance": {
  "authors": [
   "Zijian Liang",
   "Ke Liu",
   "Hao Song",
   "Yu-An Chen"
  ],
  "construction": "Twisted-torus bivariate-bicycle code from Generalized toric codes on twisted tori for quantum error correction (PRX Quantum 6, 020357, 2025). Stabilizers f(x,y)=1+x+x^2, g(x,y)=1+y+x^2 on the abelian quotient group Z^2/L with twist basis a_1=[0, 3], a_2=[5, 1] (n=2|det[a_1,a_2]|=2*15). Reconstructed from the published polynomials and twist; CSS form H_X=[f|g], H_Z=[gbar|fbar].",
  "references": [
   "arXiv:2503.03827"
  ],
  "date": "2025",
  "notes": "Reconstructed baseline from Liang, Liu, Song, Chen, Generalized toric codes on twisted tori for quantum error correction (PRX Quantum 6, 020357, 2025), arXiv:2503.03827. The [[n,k,d]] parameter set and stabilizer polynomials are published in that paper; this entry reproduces them. Distance is an upper bound per the paper (probabilistic for d>20); the witness is the surrogate logical of that weight. Seeded to fill a board coverage gap at this block size, not a discovery.\n\nLayout certification: a verifier-accepted honest bilayer layout (stacked 3x5 grid, 2 qubits per site, layers=2, measured interaction radius ~4.472) was found by @mathysrennela (Aug 2026). It earns the code the local-2d-bilayer class and makes the site's geometric efficiency g = 4kd^2/(n rho^2 r^4) computable. Code authorship unchanged; layout credit to @mathysrennela.",
  "origin": "baseline",
  "novelty": "known_parameters"
 },
 "family": "bivariate-bicycle",
 "locality": {
  "coordinates": [
   [
    0.0,
    0.0
   ],
   [
    1.0,
    0.0
   ],
   [
    2.0,
    0.0
   ],
   [
    0.0,
    1.0
   ],
   [
    1.0,
    1.0
   ],
   [
    2.0,
    1.0
   ],
   [
    0.0,
    2.0
   ],
   [
    1.0,
    2.0
   ],
   [
    2.0,
    2.0
   ],
   [
    0.0,
    3.0
   ],
   [
    1.0,
    3.0
   ],
   [
    2.0,
    3.0
   ],
   [
    0.0,
    4.0
   ],
   [
    1.0,
    4.0
   ],
   [
    2.0,
    4.0
   ],
   [
    0.0,
    0.0
   ],
   [
    1.0,
    0.0
   ],
   [
    2.0,
    0.0
   ],
   [
    0.0,
    1.0
   ],
   [
    1.0,
    1.0
   ],
   [
    2.0,
    1.0
   ],
   [
    0.0,
    2.0
   ],
   [
    1.0,
    2.0
   ],
   [
    2.0,
    2.0
   ],
   [
    0.0,
    3.0
   ],
   [
    1.0,
    3.0
   ],
   [
    2.0,
    3.0
   ],
   [
    0.0,
    4.0
   ],
   [
    1.0,
    4.0
   ],
   [
    2.0,
    4.0
   ]
  ],
  "layers": 2
 },
 "circuit": {
  "d_circ": {
   "X": {
    "value": 6,
    "confidence": "upper_bound",
    "witness": [
     0,
     10,
     37,
     155,
     181,
     185
    ]
   },
   "Z": {
    "value": 6,
    "confidence": "upper_bound",
    "witness": [
     245,
     263,
     365,
     407,
     763,
     932
    ]
   }
  },
  "rounds": 6,
  "stim_version": "1.16.0",
  "notes": "Flag-qubit sequential two-block extraction: one ancilla and one flag qubit per check, X checks then Z checks each round with joint reset/measure layers. Each check's 6 CNOTs occupy 6 slot layers (a proper edge coloring of its Tanner graph); the flag (|0> for X checks, |+> for Z checks) is coupled to the ancilla after the check's CNOT 1 and again after CNOT 5, and measured every round as a single-record detector, so an ancilla hook in that window also fires the flag. 8 X + 8 Z CX layers per round, schedule seed 0. Hook-aware orders: every proper suffix S_j of a check's CNOT order needs >= d-1 further data errors if unflagged and >= d-2 if flagged, and every same-ancilla pair of hooks needs >= d-2 (or d-3 when exactly one is flagged) further errors to complete a logical; layered by min-conflicts search. Screened by RIS on ker(H_dem) and an observable-constrained seeded BP+OSD search; witnesses validated in GF(2).",
  "contributed_by": {
   "by": [
    "@vprusso"
   ],
   "date": "2026-09-18",
   "method": "generic CSS memory schedule with one flag qubit per check: CX layers from a bipartite edge coloring, the flag coupled to the ancilla after the first and the fifth CNOT and measured every round, CNOT orders filtered by a single- and pair-hook cost criterion; screened by RIS on ker(H_dem) and an observable-constrained seeded BP+OSD search"
  }
 }
}
