make_notebook.py — src/28-flavour

The script src/28-flavour/make_notebook.py of the validation package of the paper 28-flav, rendered with an anchor per line. ▶ run the predicates on Google Colab.

28-flavour ledgersrc/28-flavour/make_notebook.py · 6.5 KBmake_notebook.pyColab
1"""Builds 28-flavour-main.ipynb (the Colab driver of the 28-flavour validation package). Run: python3 make_notebook.py"""2import json, re3import flvcommon as gc45NB = "28-flavour-main.ipynb"6PKG = "28-flavour"7COLAB = f"https://colab.research.google.com/github/gamayos/finite-ring-space/blob/main/src/{PKG}/{NB}"8cells = []9def md(s): cells.append({"cell_type": "markdown", "metadata": {}, "source": s})10def code(s): cells.append({"cell_type": "code", "metadata": {}, "execution_count": None, "outputs": [], "source": s})1112GROUPS = [13    ("The float-free core", ["exact_core", "framed_koide"],14     "The Koide and circulant identities in Q(ω, √2) and over framed rationals in F_{p²}/F_p; the π/12 boundary; the cubic Gauss sums as integer group-ring identities; the trimaximal magic matrix with maximal Jarlskog; the amplitude diagonal N(1 − ζ_n) = 2, 3 as integers in F_p."),15    ("The charged sectors: Koide, the winding kernel, the phase lock", ["tier_b", "m10", "delta", "revision_checks"],16     "The Tier-A/B figures against data; the circulant winding kernel with δ_LO = π/12 and the per-sector extraction; the cross-sector phase lock 1 : 1/2 : 1/3 and the small-shell quantisation; the revision identities (J, δ_LO = 1/24, the signed Koide, the cube invariant) with their labelled confrontations."),17    ("The quark sector: amplitudes, doubling, the spurion, the reactor angle", ["quark_amp", "up_doubling", "spurion", "theta13"],18     "The colour dressing of the quark amplitudes (r_u ≈ √3, Q_u = 5/6 in framed arithmetic); the up-sector doubling from 10·10; the Cabibbo spurion folded onto the winding kernel; θ₁₃ = θ_C/√2 as a leading-order estimate."),19    ("The neutrino sector and leptonic CP", ["neutrino", "pmns_cp", "tm2_jointfit"],20     "The seesaw of circulants; Q_ν = 2/3 solved on both orderings with the boundary branch selecting normal, Σm_ν = 59.1 meV; the magic matrix and maximal Jarlskog; the TM2 relation locking δ_CP to θ₂₃, its band and the joint-fit status."),21    ("The scales: transmutation, the coupling anchor, the fine-structure ledger", ["scale_a", "coupling_anchor", "alpha_probe"],22     "The overall scale as a transmutation exponent with y_t ≈ 1; the bare 1/4π against the unified continuum coupling; the α ledger — the 4π anchor, the electroweak decomposition, 3/8 at unification, the one-loop fermion sum, the 10³⁶ hierarchy."),23]2425md(f"""[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)]({COLAB})2627## Fermion Flavour Sector over Finite Relational Substrate (Akhtman & Voether, 2026)2829**Validation Package.** `finite-ring-space/src/{PKG}` — the paper's sixteen validation scripts as written, run through one registry: a30family check is one script (`flv.<stem>`), its micro-checks the script's own verdict lines (twelve of the sixteen print one per check)31together with the registry's predicates, which decide the stated values explicitly where a script prints without asserting32(`framed_koide`, `theta13`, `scale_a`, `coupling_anchor`) and pin the headline numerals elsewhere; each family names the row(s) of the33paper's predicate ledger it witnesses (the paper's Appendix "Predicate ledger", rows cited as `28:XN`; public copy at34`docs/28-flavour/28-flavour-ledger.html`), and the ledger's source column cites the family ids in return. Master-ledger rows of the35corpus reached through the paper rows: `00:K2`, `00:K3`, `00:K4`, `00:J2`, `00:J4`, `00:D2`, `00:D8`, `00:Z6`, `00:Z8`, `00:C7`, `00:B5`.3637**Kinds** — the suite's own three classes, recorded per family. `EXACT`: integer, F_p, F_{{p²}} or cyclotomic arithmetic throughout, no38float in any asserted claim. `MIXED`: the script carries its own exact check for at least one claim, the continuum confined to39labelled [approx] comparisons. `APPROX`: continuum/numerical by construction — a numerical reconfirmation of an identity proven40exactly in `exact_core`, a comparison with measured data, or an Ω-hard reading.4142**Run.** Cell by cell, or *Runtime → Run all*; ≈ 1 minute on Colab (`pmns_cp` is the long one; `tm2_jointfit` needs scipy). The last43cell writes `results.json` and fails loudly if any family fails.""")4445code(f"""# --- environment: clone the package if this notebook is not already running inside it (Colab). numpy, sympy and scipy are present on Colab.46import os47if not os.path.exists("flvcommon.py"):48    if not os.path.exists("finite-ring-space"):49        !git clone --filter=blob:none --sparse https://github.com/gamayos/finite-ring-space.git50        os.chdir("finite-ring-space")51        !git sparse-checkout set src/{PKG}52        os.chdir("src/{PKG}")53    else:54        os.chdir("finite-ring-space/src/{PKG}")55print("working directory:", os.path.join(*os.getcwd().split(os.sep)[-3:]))""")5657code("""import importlib, flvcommon as gc58importlib.reload(gc)         # a fresh registry if the notebook is re-run59print("families registered:", len(gc.LABELS))""")6061def rowkey(r):62    lab = r.split(":")[1]63    return (lab[0], int(re.sub(r"[^0-9]", "", lab) or 0), lab)64for title, stems, desc in GROUPS:65    ids = ["flv." + s for s in stems]66    rows = sorted({r.strip() for i in ids for r in gc.LEDGER[i].split(",")}, key=rowkey)67    table = "| id | script | kind | claim | ledger rows |\n|---|---|---|---|---|\n" + "\n".join(f"| `{i}` | `{gc.script_of(i)}.py` | {gc.KIND[i]} | {gc.LABELS[i]} | {gc.LEDGER[i]} |" for i in ids)68    md(f"## {title}\n{desc}\n\n{table}\n\nLedger rows witnessed: {', '.join(rows)}.")69    code("for fam in " + json.dumps(ids) + ":\n    print(f\"\\n— {gc.script_of(fam)}.py\"); gc.run_block(fam)")7071md("""## Summary72Writes `results.json` (one record per family: id, the ledger row(s) witnessed, script, kind, claim, PASS/FAIL, the micro-check count) and raises if any family failed.""")73code("""ok = gc.summary(write=True)74failed = [r["id"] for r in gc.RESULTS if not r["ok"]]75assert ok, f"FAILED families: {failed}"76print(f"all {len(gc.RESULTS)} families pass ({len(gc.MICRO)} micro-checks); records in results.json")""")7778for k, c in enumerate(cells):79    c["id"] = f"cell-{k}"80nb = {"cells": cells, "nbformat": 4, "nbformat_minor": 5,81      "metadata": {"kernelspec": {"display_name": "Python 3", "language": "python", "name": "python3"},82                   "language_info": {"name": "python"}, "colab": {"provenance": [], "toc_visible": True}}}83try:84    import nbformat85    nbf = nbformat.from_dict(nb); nbformat.validate(nbf); nbformat.write(nbf, NB)86except ImportError:87    with open(NB, "w") as f:88        json.dump(nb, f, indent=1, ensure_ascii=False)89print(f"wrote {NB} with {len(cells)} cells")90