Source code and data for the paper "A heralded entanglement factory for modular qLDPC codes via memory fusion of low-weight primitives"
Source code and data for the paper "A heralded entanglement factory for modular qLDPC codes via memory fusion of low-weight primitives"
Description
A heralded entanglement factory for modular qLDPC codes — simulation code
This dataset contains the simulation software accompanying the manuscript "A heralded entanglement factory for modular qLDPC codes via memory fusion of low-weight primitives" (S. Singh, D. Bhatti, D. Elkouss Coronas). The code, a single self-contained Python script (entanglement_factory.py), implements a branch-level Monte Carlo model that compares two strategies for generating a weight-w GHZ state shared across the modules of a distributed quantum computer, as needed for stabilizer readout of quantum error-correcting codes (surface, bivariate-bicycle, and other qLDPC codes, w = 2–8): (i) a GHZ₄-seeded "factory" that assembles the target state from heralded Bell pairs and weight-4 GHZ primitives using at most two deterministic memory fusions, and (ii) the standard Bell-pair fusion baseline using w−2 fusions. Both routes are purified to a common fault-tolerance fidelity threshold (F_th = 0.98) by nested entanglement pumping — a Werner-depolarizing distillation whose resource, latency, and memory costs are accounted recursively across nesting levels, and in which the stored state decoheres over its full production time — and the code determines which route delivers the target state at lower total cost (memory exposure, raw resources, and latency) across the hardware parameter space: photon transmission η, emitter brightness α, indistinguishability μ_I, memory coherence time, and gate/measurement error and duration.
The study is run at two hardware operating points defined in the manuscript: a realistic reference, at which decoherence caps the deliverable fidelity below the threshold beyond weight 2, and an improved point, at which the factory reaches the threshold at every weight — at roughly 10–35× lower cost where the Bell-pair baseline is also feasible, and as the only feasible route for weight ≥ 6.
The dataset comprises the simulation script (entanglement_factory.py), two documentation files (README.md and a code and data-flow map, CODE_MAP.md), and the two main figures of the manuscript included as reference outputs: crossover.pdf (the cost-crossover map over the α–η plane for weights 4, 6, and 8) and baseline_vs_weight.pdf (the per-weight infidelity and cost comparison). Running the script reproduces these figures together with the per-weight data tables it writes alongside them (branch_selection.csv and results.csv) and all quantitative results of the manuscript; the run is deterministic (fixed random seed, 40 000 Monte Carlo samples per branch) and completes in about a minute on a standard laptop.
Software: Python 3 (tested with 3.13), requiring NumPy, pandas, and Matplotlib. Run with python3 entanglement_factory.py.