Reproduction code — When can maximum entropy production select a branch? Two entropy productions and exact counterexamples

Published: 14 July 2026| Version 6 | DOI: 10.17632/pgstrtnwj8.6
Contributor:

Description

Reproduction code for the manuscript "When can maximum entropy production select a branch? Two entropy productions and exact counterexamples" (S. Kaneko). What an MEP rule maximizes is the branch conditional entropy-production rate; what sets the quasi-potential, and hence the selected branch, is the transition-path entropy production of the tubes connecting the branches. These are distinct large-deviation objects and do not even carry the same units; relating them is an explicit closure assumption (the bridge condition), not a theorem, and far from equilibrium it fails. Two thermodynamically consistent finite-state Markov counterexamples make the failure exact: a single-gate cut-balance identity fixes the occupation ratio at every finite parameter value, with no metastability assumption, and the two break the bridge from opposite poles of the decomposition S = C - Sigma/2 + B. Contents. reproduce_finite_state.py regenerates the generators of Models 1, 2 and 2b, verifies local detailed balance on every reversible edge, checks single-gate cut-balance exactness, evaluates the driven-ring lemma, and writes manuscript Fig. 2; make_counterexample_figure.py writes manuscript Fig. 1. mep_simulation_mendeley.py and ra_scan_mendeley.py reproduce the stochastic Boussinesq quench and Rayleigh-number scan of SM Sec. S3 and print five validation checks: the discrete dissipation returns the exact conductive value 4.000; it satisfies the exact steady-state identity Sigma = Lx*Nu to 2%; it is grid-converged to 0.5%; the measured critical-mode growth rate matches linear stability (17.61 vs 17.68); and a deterministic control (D = 0) leaves the plateaus unchanged to four digits. Their reference outputs (mep_summary.json, scan_summary.json) and the three figures they generate (SM Figs. S1-S3) are deposited, so a re-run can be diffed without re-deriving anything. MEP_reproduce_all_colab.ipynb runs both parts in one notebook. spectral_RB_DNS.zip holds the pseudo-spectral DNS of SM Sec. S7, which tests the one route by which the criterion predicts anti-MEP selection: a released convective mean flow suppresses the heat flux transiently by 85% at Ra = 1e5 but does not sustain itself, so the higher-dissipation roll branch is selected. It contains the executed notebook, the operator, onset and resolution checks, and the recorded checkpoint of the high-Ra run, with a script (verify_highRa.py) that re-derives every DNS value quoted in the paper from that checkpoint in about a second, without a GPU. Requirements: Python 3 with numpy and matplotlib (minimum versions in requirements.txt); the DNS notebook uses CuPy on GPU and falls back to NumPy. Licences: code MIT; data and figures CC BY 4.0. Preprint: Zenodo, doi:10.5281/zenodo.20684041 (all versions).

Files

Steps to reproduce

Requirements: Python 3 with numpy and matplotlib (see requirements.txt); verified on Python 3.12.3, NumPy 2.4.4, Matplotlib 3.10.8. Only the DNS benefits from a GPU. (A) Core finite-state results (deterministic, ~1 min). Run "python3 reproduce_finite_state.py" then "python3 make_counterexample_figure.py". The first verifies local detailed balance on EVERY reversible edge of Models 1, 2 and 2b (7, 7 and 11 edges; assert-based), checks single-gate cut-balance exactness, evaluates the driven-ring lemma, and writes fig_mechanism_scans.{pdf,png} (Fig. 2); the second writes fig_counterexamples.{pdf,png} (Fig. 1) into figures/. Expected: sigma_B/sigma_A = 4.00 / 1.41 / 2.33; pi_B/pi_A = 0.1353 / 0.9013 / 0.6460; net gate currents at machine roundoff; in-basin distributions match isolated-basin ones to ~1e-15. (B) Stochastic Boussinesq illustration, SM Sec. S3 (seeded). Run "pip install -r requirements.txt", then "python mep_simulation_mendeley.py --outdir outputs --seed 7" and "python ra_scan_mendeley.py --outdir outputs --seed 11". The deposited mep_summary.json, scan_summary.json and fig1-fig3 are the reference outputs of exactly these two commands; diff against them. Expected quench values: conductive plateau Sigma_cond = 4.000 (the exact analytic value for T = 1 - y), convective plateau Sigma_conv = 12.02, ratio 3.00, Nu = 2.98. The script prints its own validation: Sigma = Lx*Nu (12.02 vs 11.9-12.2) and the critical-mode growth rate 17.61 vs linear stability 17.68. Add "--D 0" for a deterministic control (plateaus unchanged to four digits). Expected scan values: Sigma = 4.000 below Ra_crit = 657.51, across-seed spread below 2.1e-5; the spread peaks just above onset (Ra = 950-1200) and falls below 0.1% by Ra = 1600. Wall-clock: quench ~25 s, scan ~8-12 min; "--quick" is far shorter. (C) One-click reproduction of A and B: upload the four Python scripts to the Colab working directory, open MEP_reproduce_all_colab.ipynb and choose Runtime > Run all (~10-15 min). The deposited copy carries its executed outputs, so it can also be read without re-running. (D) Pseudo-spectral DNS, SM Sec. S7 (in spectral_RB_DNS.zip; unzip first). "python verify_highRa.py" re-derives every DNS value quoted in the paper from the deposited checkpoint of the high-Ra run in about a second, with no GPU: suppressed baseline Nu = 9.204, transient minimum Nu = 1.348 (85.4% suppression), recovered Nu = 11.778. "python spectral_RB_dns.py" runs the operator self-test only; "--mode validation" runs the full probe suite (GPU recommended). Across Ra <= 1e5, Gamma in {2,4}, Pr in {0.05,1}, no mean flow self-sustains. Scope: the central results are the exact finite-state counterexamples and the action-level diagnostic of part A; the Boussinesq (B) and DNS (D) runs are illustrative anti-teleological checks of the restricted conditional case, not proofs of universal MEP or CFD validations.

Categories

Computational Physics, Fluid Dynamics, Non-Equilibrium Statistical Physics

Licence