qldpc.experimental.surgery.cheeger
Cheeger and distance boost transformations for surgery gadgets.
References
- Webster, Smith, Cohen arXiv:2511.15989 — boundary Cheeger constant (§II A Def 1); reaches h = 1
by an O(n)-edge augmentation (Table I’s “+n” column).
Cross et al. arXiv:2407.18393 — Cheeger-based distance preservation (§3.3 Thm 6).
- Williamson & Yoder arXiv:2410.02213 — augmenting the auxiliary graph to preserve
distance: random edges until h(G) ≥ 1 (proof of Thm 3 step 2), with d* ≥ min(h(G), 1)·d (Methods Lemma 2), and BP+OSD-screened random augmentation (Suppl. “BB code examples — Gross code”). That paper has no numbered sections. The greedy worst-cut search here is neither paper’s.
Copyright 2026 The qLDPC Authors
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Functions
|
Single entry point for Cheeger / distance boost. |
|
Exact boundary Cheeger constant h(F) of a gadget's F matrix. |
Module Contents
- qldpc.experimental.surgery.cheeger.boost_gadget(gadget: qldpc.experimental.surgery.gadget.GadgetLayout, *, method: Literal['combinatorial', 'distance'], target: float, seed: int | None = None, max_extra_qubits: int | None = None, num_trials_per_step: int | None = None, decoder_trials: int | None = None) qldpc.experimental.surgery.gadget.GadgetLayout[source]
Single entry point for Cheeger / distance boost.
- Parameters:
gadget – a GadgetLayout from build_gadget.
method – ‘combinatorial’ | ‘distance’.
target – target Cheeger constant (for combinatorial) or target distance (for distance method; cast via int(target)).
seed – RNG seed.
max_extra_qubits – cap on new ancillas. Defaults to 50 for the combinatorial method and 30 for the distance method.
num_trials_per_step – distance-method random augmentations per ancilla count. Defaults to 20.
decoder_trials – distance-method BP+OSD trials per candidate. Defaults to 10.
- Returns:
A NEW GadgetLayout with boosted incidence, gauge, HX_merged, HZ_merged. method=’distance’ screens with a BP+OSD upper bound, so acceptance is a heuristic rather than a proof; confirm it by computing the exact distance of the code HX_merged / HZ_merged define.
- Raises:
ValueError – gadget is already augmented; method is neither ‘combinatorial’ nor ‘distance’; target is not positive; distance-only options are passed to the combinatorial method; or the combinatorial method is used with
|V_0|> 26.RuntimeError – the chosen method could not reach
target. Lower it; raising max_extra_qubits helps only when the budget is what ran out, which the message says. For method=’distance’, retrying can also succeed, since its screen is not seeded.
- qldpc.experimental.surgery.cheeger.cheeger_constant(g: qldpc.experimental.surgery.gadget.GadgetLayout) float[source]
Exact boundary Cheeger constant h(F) of a gadget’s F matrix.
gadget notation: F → incidence; V_0 → support (Webster–Smith–Cohen arXiv:2511.15989 §II A Def 1 / Cross et al. arXiv:2407.18393 Def 3).
Computed exactly by Gray-code subset enumeration, which is tractable only for
|V_0|≤ 26.Cross et al. arXiv:2407.18393 §3.3 Thm 6 concludes d_merged ≥ d_data when an L-layer ancilla system satisfies ceil(L/2) ≥ 1/h, which at the L=1 gadgets built here reduces to h ≥ 1. Below 1 the gadget falls outside the theorem, where distance may degrade; consider
boost_gadget(g, method="combinatorial", target=1.0).Reaching h ≥ 1 is a screen, not a distance guarantee. The theorem bounds the merged code distance; chained through Thm 11 that gives a phenomenological logical fault distance ≥ d, but nothing in the paper bounds the circuit fault distance. Thm 6 also inherits the irreducibility assumption declared in §3.1 and stated in Thm 1 — no other logical of the same type has support inside the measured logical’s support — which
build_gadgetdoes not check, and nothing here verifies its conclusion. Nor does h track circuit fault distance, so a higher h is not a reason to expect a better circuit.- Raises:
ValueError – if
|V_0|> 26, beyond which the exact enumeration is infeasible.