Reproduction code — A circulation bound on the frenetic component of branch selection
Description
Reproduction code for the manuscript "A circulation bound on the frenetic component of branch selection" (S. Kaneko). The scripts verify every claim of the paper and regenerate all fourteen figures. The paper proves a selection inequality, |ΔC| ≤ ½ Σ_cyc, relating the frenetic asymmetry ΔC — the imbalance in time-symmetric dynamical activity (frenesy) between the dominant forward and backward escape tubes — to the entropy production Σ_cyc around the transition cycle those tubes close. The proof uses only tube minimality and reversal parity, and its essential hypothesis is that the comparison class be closed under time reversal. The order parameter η = 2ΔC/Σ_cyc ∈ [−1,1] saturates where the forward tube and the time-reversed backward tube become co-optimal; detailed balance forces ΔC = 0 at every scale (a no-go), so circulation around the selected tubes' transition cycle is necessary — though not sufficient — for frenetic (anti-MEP) selection. The bound is a selection-consistency relation of the minimum-action description, not a new variational principle. Contents. The bound is checked on random directed networks (zero violations), on chemical-reaction-network count lattices, and on Schnakenberg / Hill matrix-tree examples. At the arborescence level the naive pairwise bound breaks (930 violations in 9196 one-edge swaps, while pure re-rooting leaves ΔC = 0) — positive evidence that reversal closure is the essential hypothesis. Further scripts reproduce the coarse-graining check of Table III, the rotational Maier–Stein saddle, the Schüttler–Jack–Cates Escher-cycle instanton via gMAM, a spatial field instanton, and a trajectory diagnostic certifying the selection mechanism from one steady-state trajectory. The Freidlin–Wentzell sector (sfef/) holds the two-channel benchmark reaching saturation (η ≈ 0.97) via a genuine route handover (Table I); the single-channel envelope, which stays at |η| ≲ 0.37, showing saturation is non-generic; and the window-closing suite (Fig. 6, Table II), where the diagnostic runs blind on Langevin data, routes resolved from the trajectories and Σ_cyc estimated prefactor-free. Inside the estimation window — bracketed in the drive as well as the noise — barriers are Arrhenius-de-biased on each point's own ε-ladder, borrowing no calibration from another point, so the blind point stays blind and recovers η = 0.72 against a gMAM truth of 0.725; the walls lie outside the drive band and are reported raw. At saturation the A→B purity collapses to 58.7% while B→A stays at 98.8% — the single-instanton breakdown predicted at the bound's tight locus. Every row of the verification ledger (Table IV) is reproduced by a deposited script, and run_core_checks.py gates on the printed numbers, not exit codes alone. See README.md for the claim-to-script map and expected_outputs.txt for the headline values. Licences: code MIT; data, figures and documentation CC BY 4.0 (LICENSES.md). V4: Fig. 6(a) legend repositioned; values unchanged.
Files
Steps to reproduce
1. Install Python 3.11+ and dependencies: pip install numpy scipy matplotlib networkx (exact reference environment: pip install -r requirements-lock.txt). 2. Unzip the archive. Scripts resolve their data paths relative to themselves, so they run from any working directory; all randomized tests are seeded, so outputs are deterministic. 3. Numerical checks. python run_core_checks.py --smoke runs a fast subset (about a minute); --fast skips the heavy stochastic and gMAM checks; with no flag the full suite runs. The runner gates on the printed numbers, so a script that exits cleanly but reports a violation is still a failure. Compare with expected_outputs.txt. 4. Figures. python make_figures.py regenerates all fourteen figures into figures/ under their manuscript names (fig1_bound.pdf ... fig14_eta_map.pdf); --fast skips the three heavy generators (Figs. 4, 5, 12). Generators: fig_fast.py (Figs. 1, 3, 7), fig_contact.py (Fig. 2), fig_ms.py (Fig. 4), sfef/twochannel_fig.py (Fig. 5, Table I), sfef/window_fig.py (Fig. 6, Table II), langevin.py (Fig. 8, Table III), net/fig_network.py (Fig. 9), crn/fig_crn.py (Fig. 10), crn/fig_escher.py (Fig. 11), sjc/fig_sjc.py (Fig. 12), fld/fig_field.py (Fig. 13), sfef/eta_map_fig.py (Fig. 14). 5. Window-closing experiment (Fig. 6, Table II). sfef/window_suite.py runs the manifest documented in sfef/WINDOW_RUNS.md (M = 512 walkers, dt = 1e-3; nsteps is raised as eps falls, because the crossings become exponentially rarer) and writes sfef/window_results.csv; sfef/window_fig.py then builds the figure and prints the ledger from that CSV. sfef/window_expt.py runs a single operating point. The suite takes hours of CPU; the deposited CSV lets window_fig.py rebuild the figure and table immediately. 6. Verification scripts print to stdout: net/net1_verbatim.py (zero bound violations across the random ensembles), tree_identity.py (the arborescence-level breakdown), crn/crn5d_final.py (frenetic selection under uniform dissipation), diag/diag_demo.py (the four mechanism classes certified from simulated trajectories), and the SFEF sector sfef/verify_bridge.py, sfef/verify_review.py, sfef/verify_identities.py, sfef/verify_twochannel.py, sfef/gmam_benchmark.py. 7. Fig. 13 runs out of the box: fld/fig_field.py reads the bundled fld/cont_rows.npy. To regenerate that data, run fld/step1.py then fld/step2.py (which writes fld/cont_rows.npy) before fld/fig_field.py. fld/step3.py is an independent small-gamma resolution check and is not part of the pipeline. 8. Do not replace the bundled pickle-enabled NumPy files (fld/cont_rows.npy, sfef/geom_cache.npz) with untrusted files.