#!/usr/bin/env python3 """ Builder + self-validator for the strange_heavy_mesons data shard. RUNNABLE-FIRST: bare Python 3, stdlib only (csv, math, dataclasses, pathlib). FAIL-CLOSED: every row's geometry-derived charge_Q is recomputed here from the quark_content via the charge law Q = sum_i Q_i (Q_u=+2/3, Q_d=-1/3, Q_s=-1/3, Q_c=+2/3, Q_b=-1/3; antiquarks opposite) and the flavor numbers S=-(n_s-n_sbar), C=+(n_c-n_cbar), B'=-(n_b-n_bbar), B=(1/3)(n_q-n_qbar). If a hand-entered charge/B/S/C/B' disagrees with the derivation for a definite- flavor state, this builder RAISES (will not emit a bad CSV). This file ONLY emits the dataset CSV. It does NOT compute or claim absolute hadron masses from geometry: every mass_MeV is the REAL PDG-2024 value, cited per-row in pdg_source. Mixed/indefinite-flavor eigenstates (K0_S, K0_L) have S left '' (not a good quantum number) and are exempted from the strict flavor-derivation cross-check (flagged below). Source of every PDG number: PDG 2024, S. Navas et al. (Particle Data Group), Phys. Rev. D 110, 030001 (2024) -- Meson Summary Table + Particle Listings, re-quoted via the foundation inventory + per-chunk section files SH-1..SH-8 in /. """ import csv from fractions import Fraction from pathlib import Path OUT = Path(__file__).resolve().parent / "dataset_strange_heavy_mesons.csv" COLUMNS = [ "pdg_name", "quark_content", "charge_Q", "J", "P", "C", "isospin_I", "I3", "baryon_B", "strangeness_S", "charm_C", "bottom_Bprime", "mass_MeV", "mass_unc_MeV", "status_stars", "sector", "chunk", "pdg_source", ] SECTOR = "strange_heavy_mesons" # --- quark electric charges (Q = T3 + Y), GUT.md App D.2/D.3.1 --- QCHARGE = { "u": Fraction(2, 3), "d": Fraction(-1, 3), "s": Fraction(-1, 3), "c": Fraction(2, 3), "b": Fraction(-1, 3), "t": Fraction(2, 3), } def parse_content(qc): """Parse a quark_content string like 'u sbar' / 'cbar d' / 'sss'. Returns dict flavor-> (n_quark, n_antiquark). Tokens separated by spaces; a trailing 'bar' marks an antiquark. Single-letter flavors only.""" toks = qc.split() quarks = [] # list of flavor letters (quarks) antiquarks = [] # list of flavor letters (antiquarks) for t in toks: if t.endswith("bar"): antiquarks.append(t[:-3]) else: quarks.append(t) return quarks, antiquarks def derive(qc): """Return (Q, B, S, C, Bprime) derived purely from the quark content.""" quarks, antiquarks = parse_content(qc) Q = sum(QCHARGE[f] for f in quarks) - sum(QCHARGE[f] for f in antiquarks) nq, naq = len(quarks), len(antiquarks) B = Fraction(1, 3) * (nq - naq) n_s = quarks.count("s"); n_sbar = antiquarks.count("s") n_c = quarks.count("c"); n_cbar = antiquarks.count("c") n_b = quarks.count("b"); n_bbar = antiquarks.count("b") S = -(n_s - n_sbar) C = +(n_c - n_cbar) Bp = -(n_b - n_bbar) return Q, B, S, C, Bp # --------------------------------------------------------------------------- # The 70 states. Each tuple: # (pdg_name, quark_content, J, P, isospin_I, I3, mass_MeV, mass_unc_MeV, # status_stars, chunk, pdg_source, # indefinite_flavor) # True -> skip strict S/C/B' cross-check (CP mix) # charge_Q, baryon_B, S, C, B' are DERIVED below (fail-closed) for definite # states; for indefinite-flavor mix rows we set the cells we keep and blank S. # Representative listed charge state's quark content is used for the derivation. # --------------------------------------------------------------------------- SUMTAB = ("PDG 2024 (Navas et al., Phys. Rev. D 110, 030001) " "Meson Summary Table rpp2024-sum-mesons.pdf") LIST = ("PDG 2024 (Navas et al., Phys. Rev. D 110, 030001) Particle Listings " "(omitted from Meson Summary Table; needs confirmation)") R = [] # rows # ====================== CHUNK SH-1 (11) ====================== R += [ ("K+", "u sbar", "0", "-", "1/2", "+1/2", "493.677", "0.015", "****", "SH-1", SUMTAB, False), ("K0", "d sbar", "0", "-", "1/2", "-1/2", "497.611", "0.013", "****", "SH-1", SUMTAB, False), # CP/weak mass eigenstates of the K0-K0bar system: S not a good quantum number. ("K0_S", "d sbar", "0", "-", "1/2", "", "497.611", "0.013", "****", "SH-1", SUMTAB + " (m=m_K0; CP-even mix (d sbar - dbar s)/sqrt2; S indefinite)", True), ("K0_L", "d sbar", "0", "-", "1/2", "", "497.611", "0.013", "****", "SH-1", SUMTAB + " (m=m_K0; CP-odd mix (d sbar + dbar s)/sqrt2; S indefinite)", True), ("K0*(700)", "d sbar", "0", "+", "1/2", "-1/2", "845", "17", "***", "SH-1", LIST + " (kappa; broad; Breit-Wigner m=845+-17, Gamma=468+-30; T-matrix pole " "(630-730)-i(260-340) MeV; debated)", False), # K*(892): representative neutral mass quoted (per inventory both charges listed). ("K*(892)", "d sbar", "1", "-", "1/2", "-1/2", "895.55", "0.20", "****", "SH-1", SUMTAB + " (K*0 hadroproduced; K*+/-=891.67+-0.26)", False), ("K1(1270)", "d sbar", "1", "+", "1/2", "-1/2", "1253", "7", "****", "SH-1", SUMTAB + " (Gamma=90; 1P axial 1P1/3P1 mix)", False), ("K1(1400)", "d sbar", "1", "+", "1/2", "-1/2", "1403", "7", "****", "SH-1", SUMTAB + " (Gamma=174; 1P axial 3P1/1P1 mix)", False), ("K*(1410)", "d sbar", "1", "-", "1/2", "-1/2", "1414", "15", "****", "SH-1", SUMTAB + " (2 3S1/1 3D1)", False), ("K0*(1430)", "d sbar", "0", "+", "1/2", "-1/2", "1425", "50", "****", "SH-1", SUMTAB + " (1 3P0 scalar)", False), # K2*(1430): representative neutral mass quoted (K2*0=1427.3+-1.5, K2*+/-=1432.4+-1.3). ("K2*(1430)", "d sbar", "2", "+", "1/2", "-1/2", "1427.3", "1.5", "****", "SH-1", SUMTAB + " (K2*0; K2*+/-=1432.4+-1.3; 1 3P2)", False), ] # ====================== CHUNK SH-2 (17) ====================== R += [ ("K(1460)", "d sbar", "0", "-", "1/2", "-1/2", "", "", "omitted", "SH-2", LIST + " (2 1S0; reported ~1460-1482 MeV, no Summary central)", False), ("K2(1580)", "d sbar", "2", "-", "1/2", "-1/2", "", "", "omitted", "SH-2", LIST + " (1D2/3D2; reported ~1580 MeV, no Summary central)", False), # K(1630): J,P undetermined per PDG listings. ("K(1630)", "d sbar", "", "", "1/2", "-1/2", "", "", "omitted", "SH-2", LIST + " (J^P undetermined; reported ~1629 MeV, no Summary central)", False), ("K1(1650)", "d sbar", "1", "+", "1/2", "-1/2", "1650", "50", "omitted", "SH-2", LIST + " (2P axial; ~1650+-50 listings spread, not a Summary unc)", False), ("K*(1680)", "d sbar", "1", "-", "1/2", "-1/2", "1718", "18", "****", "SH-2", SUMTAB + " (1 3D1)", False), ("K2(1770)", "d sbar", "2", "-", "1/2", "-1/2", "1773", "8", "***", "SH-2", SUMTAB + " (in summary, needs some confirmation; 1 1D2/1 3D2)", False), ("K3*(1780)", "d sbar", "3", "-", "1/2", "-1/2", "1779", "8", "****", "SH-2", SUMTAB + " (1 3D3)", False), ("K2(1820)", "d sbar", "2", "-", "1/2", "-1/2", "1819", "12", "***", "SH-2", SUMTAB + " (in summary, needs some confirmation; 3D2/1D2)", False), ("K(1830)", "d sbar", "0", "-", "1/2", "-1/2", "", "", "omitted", "SH-2", LIST + " (3 1S0; reported ~1874 MeV, no Summary central)", False), ("K0*(1950)", "d sbar", "0", "+", "1/2", "-1/2", "1957", "14", "omitted", "SH-2", LIST + " (2 3P0; reported 1957+-14, listings only)", False), ("K2*(1980)", "d sbar", "2", "+", "1/2", "-1/2", "", "", "omitted", "SH-2", LIST + " (2 3P2; reported ~1990 MeV, no Summary central)", False), ("K4*(2045)", "d sbar", "4", "+", "1/2", "-1/2", "2048", "9", "***", "SH-2", SUMTAB + " (1 3F4; m=2048 +8 -9, larger unc 9 quoted)", False), ("K2(2250)", "d sbar", "2", "-", "1/2", "-1/2", "", "", "omitted", "SH-2", LIST + " (2D; reported ~2247 MeV, no Summary central)", False), ("K3(2320)", "d sbar", "3", "+", "1/2", "-1/2", "", "", "omitted", "SH-2", LIST + " (3F3; reported ~2324 MeV, no Summary central)", False), ("K5*(2380)", "d sbar", "5", "-", "1/2", "-1/2", "", "", "omitted", "SH-2", LIST + " (3G5; reported ~2382 MeV, no Summary central)", False), ("K4(2500)", "d sbar", "4", "-", "1/2", "-1/2", "", "", "omitted", "SH-2", LIST + " (3G4/1G4; reported ~2490 MeV, no Summary central)", False), # K(3100): unidentified enhancement, J^P unknown, content uncertain. ("K(3100)", "d sbar", "", "", "1/2", "-1/2", "", "", "omitted", "SH-2", LIST + " (unidentified K-pbar enhancement; J^P unknown; ~3100 MeV; assignment " "uncertain, tentatively listed as strange d sbar)", False), ] # ====================== CHUNK SH-3 (8) ====================== R += [ ("D+", "c dbar", "0", "-", "1/2", "+1/2", "1869.66", "0.05", "****", "SH-3", SUMTAB, False), ("D0", "c ubar", "0", "-", "1/2", "-1/2", "1864.84", "0.05", "****", "SH-3", SUMTAB, False), ("D*(2007)0", "c ubar", "1", "-", "1/2", "-1/2", "2006.85", "0.05", "****", "SH-3", SUMTAB, False), ("D*(2010)+", "c dbar", "1", "-", "1/2", "+1/2", "2010.26", "0.05", "****", "SH-3", SUMTAB, False), ("D0*(2300)", "c ubar", "0", "+", "1/2", "-1/2", "2343", "10", "****", "SH-3", SUMTAB + " (1 3P0; formerly D0*(2400))", False), ("D1(2420)", "c ubar", "1", "+", "1/2", "-1/2", "2422.1", "0.6", "****", "SH-3", SUMTAB + " (j_q=3/2 narrow)", False), ("D1(2430)0", "c ubar", "1", "+", "1/2", "-1/2", "2412", "9", "****", "SH-3", SUMTAB + " (j_q=1/2 broad, Gamma~310)", False), # D2*(2460): representative neutral mass quoted (D2*0=2461.1+-0.8, D2*+=2465.4+-1.3). ("D2*(2460)", "c ubar", "2", "+", "1/2", "-1/2", "2461.1", "0.8", "****", "SH-3", SUMTAB + " (D2*0; D2*+=2465.4+-1.3; 1 3P2)", False), ] # ====================== CHUNK SH-4 (7) ====================== R += [ ("D0(2550)0", "c ubar", "0", "-", "1/2", "-1/2", "", "", "omitted", "SH-4", LIST + " (2 1S0; reported ~2549 MeV, listings only)", False), ("D1*(2600)0", "c ubar", "1", "-", "1/2", "-1/2", "", "", "omitted", "SH-4", LIST + " (2 3S1/1 3D1; reported ~2627 MeV, listings only)", False), # D*(2640)+: natural parity, J undetermined (P natural). ("D*(2640)+", "c dbar", "", "", "1/2", "+1/2", "", "", "omitted", "SH-4", LIST + " (natural parity, J undetermined; reported ~2637 MeV; weak DELPHI state)", False), ("D2(2740)0", "c ubar", "2", "-", "1/2", "-1/2", "", "", "omitted", "SH-4", LIST + " (1 1D2/3D2; reported ~2747 MeV, listings only)", False), ("D3*(2750)", "c ubar", "3", "-", "1/2", "-1/2", "2763.1", "3.2", "****", "SH-4", SUMTAB + " (1 3D3; established, in summary)", False), ("D1*(2760)0", "c ubar", "1", "-", "1/2", "-1/2", "", "", "omitted", "SH-4", LIST + " (1 3D1; reported ~2781 MeV, listings only; overlaps 2750 region)", False), # D(3000)0: natural parity, J undetermined. ("D(3000)0", "c ubar", "", "", "1/2", "-1/2", "", "", "omitted", "SH-4", LIST + " (natural parity, high excitation; reported ~3000 MeV, listings only)", False), ] # ====================== CHUNK SH-5 (7) ====================== R += [ ("Ds+", "c sbar", "0", "-", "0", "0", "1968.35", "0.07", "****", "SH-5", SUMTAB, False), ("Ds*+", "c sbar", "1", "-", "0", "0", "2112.2", "0.4", "****", "SH-5", SUMTAB, False), ("Ds0*(2317)+", "c sbar", "0", "+", "0", "0", "2317.8", "0.5", "****", "SH-5", SUMTAB + " (1 3P0; below DK threshold)", False), ("Ds1(2460)+", "c sbar", "1", "+", "0", "0", "2459.5", "0.6", "****", "SH-5", SUMTAB + " (j_q=1/2 axial; below D*K threshold)", False), ("Ds1(2536)+", "c sbar", "1", "+", "0", "0", "2535.11", "0.06", "****", "SH-5", SUMTAB + " (j_q=3/2 axial)", False), ("Ds2*(2573)+", "c sbar", "2", "+", "0", "0", "2569.1", "0.8", "****", "SH-5", SUMTAB + " (1 3P2)", False), ("Ds1*(2700)+", "c sbar", "1", "-", "0", "0", "2714", "5", "****", "SH-5", SUMTAB + " (2 3S1/1 3D1)", False), ] # ====================== CHUNK SH-6 (4) ====================== R += [ ("Ds0(2590)+", "c sbar", "0", "-", "0", "0", "", "", "omitted", "SH-6", LIST + " (2 1S0; LHCb 2021; reported ~2591 MeV, listings only)", False), ("Ds1*(2860)+", "c sbar", "1", "-", "0", "0", "", "", "omitted", "SH-6", LIST + " (1 3D1; LHCb 2014; reported ~2859 MeV, listings only; overlaps Ds3*(2860))", False), ("Ds3*(2860)+", "c sbar", "3", "-", "0", "0", "2860", "7", "***", "SH-6", SUMTAB + " (in summary, needs some confirmation; 1 3D3; LHCb 2014, first heavy J=3)", False), # DsJ(3040)+: unnatural parity, J undetermined. ("DsJ(3040)+", "c sbar", "", "", "0", "0", "", "", "omitted", "SH-6", LIST + " (unnatural parity, J undetermined; radial 2P mix; reported ~3044 MeV, BaBar 2009)", False), ] # ====================== CHUNK SH-7 (7) ====================== R += [ ("B+", "u bbar", "0", "-", "1/2", "+1/2", "5279.41", "0.07", "****", "SH-7", SUMTAB, False), ("B0", "d bbar", "0", "-", "1/2", "-1/2", "5279.72", "0.08", "****", "SH-7", SUMTAB, False), ("B*", "u bbar", "1", "-", "1/2", "+1/2", "5324.75", "0.20", "****", "SH-7", SUMTAB + " (J,P need confirmation; B*+/B*0 treated as one mass)", False), # B1(5721): representative charged mass (B1+=5726.0+2.5-2.5; B1(0)=5725.9). ("B1(5721)+", "u bbar", "1", "+", "1/2", "+1/2", "5726.0", "2.5", "***", "SH-7", SUMTAB + " (J,P need conf.; j_q=3/2; B1(5721)0=5725.9)", False), # B2*(5747): representative charged mass (B2*+=5737.3+-0.7; B2*0=5739.6). ("B2*(5747)+", "u bbar", "2", "+", "1/2", "+1/2", "5737.3", "0.7", "***", "SH-7", SUMTAB + " (J,P need conf.; 1 3P2; B2*(5747)0=5739.6)", False), # BJ(5970): J^P undetermined; representative charged mass (BJ+=5965+-5; BJ0=5971+-5). ("BJ(5970)+", "u bbar", "", "", "1/2", "+1/2", "5965", "5", "**", "SH-7", SUMTAB + " (I,J,P need conf.; J^P undetermined; 2S or 1D; BJ(5970)0=5971+-5)", False), ("BJ*(5732)", "u bbar", "", "", "1/2", "+1/2", "", "", "omitted", "SH-7", LIST + " (B**; broad unresolved 1P mix; natural parity, J undetermined; " "reported ~5698 MeV, listings only)", False), ] # ====================== CHUNK SH-8 (9: 7 Bs + 2 Bc) ====================== R += [ # Bs family: s bbar (S=-1, B'=+1, I=0) ("Bs0", "s bbar", "0", "-", "0", "0", "5366.93", "0.10", "****", "SH-8", SUMTAB + " (I,J,P need confirmation)", False), ("Bs*", "s bbar", "1", "-", "0", "0", "5415.4", "1.4", "***", "SH-8", SUMTAB + " (I,J,P need confirmation)", False), ("Bs1(5830)0", "s bbar", "1", "+", "0", "0", "5828.70", "0.20", "***", "SH-8", SUMTAB + " (I,J,P need conf.; j_q=3/2)", False), ("Bs2*(5840)0", "s bbar", "2", "+", "0", "0", "5839.86", "0.12", "***", "SH-8", SUMTAB + " (I,J,P need conf.; 1 3P2)", False), ("BsJ*(5850)", "s bbar", "", "", "0", "0", "", "", "omitted", "SH-8", LIST + " (unconfirmed; J^P undetermined; reported ~5853 MeV, listings only)", False), ("BsJ(6063)0", "s bbar", "1", "-", "0", "0", "6063.5", "1.4", "omitted", "SH-8", LIST + " (2 3S1 candidate, natural parity 1- cand.; LHCb 2020 B+K-; " "unc combined stat 1.2 + syst 0.8; listings only)", False), ("BsJ(6114)0", "s bbar", "1", "-", "0", "0", "6114", "6", "omitted", "SH-8", LIST + " (1 3D1 candidate, natural 1-/3- cand.; LHCb 2020 B+K-; " "unc combined stat 3 + syst 5; listings only)", False), # Bc family: c bbar (C=+1, B'=+1, I=0) ("Bc+", "c bbar", "0", "-", "0", "0", "6274.47", "0.32", "****", "SH-8", SUMTAB + " (I,J,P need confirmation)", False), ("Bc(2S)+", "c bbar", "0", "-", "0", "0", "6871.2", "1.0", "***", "SH-8", SUMTAB + " (in summary, needs some confirmation; 2 1S0)", False), ] def frac_to_str(fr): """Render a Fraction charge as a compact signed string: +1, 0, -1, +2/3...""" if fr.denominator == 1: n = fr.numerator if n > 0: return "+%d" % n return "%d" % n # covers 0 and negatives sign = "+" if fr > 0 else "-" return "%s%d/%d" % (sign, abs(fr.numerator), fr.denominator) def build(): out_rows = [] seen = set() for (name, qc, J, P, I, I3, m, munc, status, chunk, src, indef) in R: if name in seen: raise SystemExit("FAIL-CLOSED: duplicate pdg_name %r" % name) seen.add(name) Q, B, S, C, Bp = derive(qc) # All these are mesons: baryon number must be exactly 0. Fail closed. if B != 0: raise SystemExit("FAIL-CLOSED: %s derived baryon B=%s != 0" % (name, B)) Q_str = frac_to_str(Q) # Charge of every state here must be integer (all are mesons w/ |Q|<=1). if Q.denominator != 1: raise SystemExit("FAIL-CLOSED: %s derived non-integer charge %s" % (name, Q_str)) # Strangeness: blank for indefinite-flavor CP eigenstates. S_str = "" if indef else str(S) out_rows.append({ "pdg_name": name, "quark_content": qc, "charge_Q": Q_str, "J": J, "P": P, "C": "", # never a C eigenstate: all open-flavor -> C-parity undefined "isospin_I": I, "I3": I3, "baryon_B": "0", "strangeness_S": S_str, "charm_C": str(C), "bottom_Bprime": str(Bp), "mass_MeV": m, "mass_unc_MeV": munc, "status_stars": status, "sector": SECTOR, "chunk": chunk, "pdg_source": src, }) return out_rows def main(): rows = build() if len(rows) != 70: raise SystemExit("FAIL-CLOSED: expected 70 rows, got %d" % len(rows)) with OUT.open("w", newline="", encoding="utf-8") as f: w = csv.DictWriter(f, fieldnames=COLUMNS) w.writeheader() for r in rows: w.writerow(r) print("Wrote %d rows to %s" % (len(rows), OUT)) # quick per-chunk tally from collections import Counter c = Counter(r["chunk"] for r in rows) for k in sorted(c): print(" %s: %d" % (k, c[k])) if __name__ == "__main__": main()