mtft 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
mtft-0.3.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Roger Tano
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
mtft-0.3.0/PKG-INFO ADDED
@@ -0,0 +1,170 @@
1
+ Metadata-Version: 2.2
2
+ Name: mtft
3
+ Version: 0.3.0
4
+ Summary: Modular Time Field Theory — core data structures, modular geometry, gauge-Higgs unification, dark sector, and information geometry
5
+ Author: Roger Tano
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/roger/mtft
8
+ Project-URL: Documentation, https://github.com/roger/mtft#readme
9
+ Keywords: physics,modular-forms,gauge-theory,dark-matter,information-geometry
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: Topic :: Scientific/Engineering :: Physics
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Requires-Python: >=3.9
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: numpy>=1.22
22
+ Provides-Extra: full
23
+ Requires-Dist: scipy>=1.9; extra == "full"
24
+ Requires-Dist: matplotlib>=3.5; extra == "full"
25
+ Provides-Extra: viz
26
+ Requires-Dist: matplotlib>=3.5; extra == "viz"
27
+ Requires-Dist: plotly>=5.0; extra == "viz"
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest>=7.0; extra == "dev"
30
+ Requires-Dist: pytest-cov; extra == "dev"
31
+ Requires-Dist: ruff; extra == "dev"
32
+
33
+ # MTFT — Modular Time Field Theory
34
+
35
+ [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
36
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
37
+
38
+ A Python library implementing the core data structures and computational tools for **Modular Time Field Theory (MTFT)**.
39
+
40
+ ## Overview
41
+
42
+ MTFT proposes a modular time field **τ(x) = t_R / t_U** mapping spacetime to the upper half-plane **ℍ**, unifying dark matter, particle masses, and cosmic structure through:
43
+
44
+ - **Modular symmetry** — SL(2,ℤ) acting on τ
45
+ - **Gauge-Higgs unification** — Higgs = A_τ holonomy via the Hosotani mechanism
46
+ - **τ-vortex dark matter** — logarithmic τ-profiles give flat rotation curves with no dark particles
47
+ - **Information geometry bridge** — Fisher-Rao curvature of the logistic map connects chaos → geometry → dynamics
48
+
49
+ ### The Three-Layer Architecture
50
+
51
+ ```
52
+ Counting → Logistic map orbits, figurate-number degeneracies
53
+ Geometry → Fisher-Rao metric, Ricci curvature R_core
54
+ Dynamics → SM masses, dark matter halos, decay rates, cosmology
55
+ ```
56
+
57
+ Connected by the **spectral determinant identity**:
58
+
59
+ ```
60
+ det(1 − q^{1/m} P_m) = η(τ)^{−1/m} θ₃(0,τ)^{1/m}
61
+ ```
62
+
63
+ linking Fredholm determinants (chaos/RG) to CFT partition functions.
64
+
65
+ ## Installation
66
+
67
+ ```bash
68
+ pip install -e . # minimal (numpy only)
69
+ pip install -e ".[full]" # with scipy + matplotlib
70
+ pip install -e ".[dev]" # with pytest + ruff
71
+ ```
72
+
73
+ ## Quick Start
74
+
75
+ ```python
76
+ import mtft
77
+
78
+ # ── Modular forms ─────────────────────────────────────
79
+ tau = 0.1 + 1.5j
80
+ eta = mtft.dedekind_eta(tau)
81
+ j = mtft.forms.j_invariant(tau)
82
+ print(f"η(τ) = {eta:.6f}")
83
+ print(f"j(τ) = {j:.2f}")
84
+
85
+ # Verify the spectral determinant identity
86
+ result = mtft.forms.verify_spectral_identity(tau, m=2)
87
+ print(f"Spectral identity relative error: {result['relative_error']:.2e}")
88
+
89
+ # ── Hosotani mechanism ────────────────────────────────
90
+ hp = mtft.HosotaniPotential(fermion_fraction=0.4, kappa_ew=0.05)
91
+ theta0 = hp.find_vacuum()
92
+ masses = hp.gauge_masses()
93
+ print(f"Vacuum θ₀ = {theta0:.4f}")
94
+ print(f"m_W = {masses['m_W']:.2f} GeV (PDG: 80.37)")
95
+ print(f"m_Z = {masses['m_Z']:.2f} GeV (PDG: 91.19)")
96
+
97
+ # ── Particle spectrum ─────────────────────────────────
98
+ sm = mtft.StandardModel()
99
+ top = sm.by_name("Top")
100
+ print(f"Top quark: m = {top.mass_GeV} GeV, κ = {top.kappa}")
101
+
102
+ # Full κ-hierarchy
103
+ for name, kappa in sm.kappa_hierarchy():
104
+ print(f" {name:15s} κ = {kappa:.2e}")
105
+
106
+ # ── Dark sector ───────────────────────────────────────
107
+ import numpy as np
108
+ halo = mtft.TauVortexHalo(A=1e20, r0=1e30)
109
+ r = np.logspace(31, 35, 100)
110
+ v = halo.v_circular(r)
111
+ print(f"v_∞ = {halo.v_infinity:.4e} (flat rotation velocity)")
112
+
113
+ # ── Information geometry ──────────────────────────────
114
+ R = mtft.info_geometry.R_core()
115
+ print(f"R_core (Feigenbaum) = {R:.4f}")
116
+
117
+ # ── Cosmology ─────────────────────────────────────────
118
+ cosmo = mtft.FriedmannMTFT(Omega_tau=0.25)
119
+ hist = cosmo.expansion_history()
120
+ ```
121
+
122
+ ## Package Structure
123
+
124
+ ```
125
+ mtft/
126
+ ├── constants.py # PDG masses, SM parameters, physical constants
127
+ ├── modular.py # τ-field, SL(2,ℤ), hyperbolic geometry
128
+ ├── forms.py # Dedekind η, Jacobi θ₃, Eisenstein, spectral det
129
+ ├── hosotani.py # Effective potential, vacuum finder, EWSB
130
+ ├── particles.py # SM particle database with κ-couplings
131
+ ├── dark_sector.py # τ-vortex halos, rotation curves, Tully-Fisher
132
+ ├── info_geometry.py # Fisher-Rao metric, Ricci curvature, logistic map
133
+ └── cosmology.py # Modified Friedmann, perturbations, G(t) oscillation
134
+ ```
135
+
136
+ ## Key Equations
137
+
138
+ | Component | Equation |
139
+ |-----------|----------|
140
+ | Modular time field | τ(x) = t_R(x)/t_U(x) ∈ ℍ |
141
+ | Hyperbolic metric | ds² = (dx² + dy²)/y², K = −1 |
142
+ | W mass | m_W = κ_EW \|sin θ_H\| / (2R_τ) |
143
+ | Fermion mass | m_f = κ_f \|sin θ₀\| / R_τ |
144
+ | τ-vortex density | ρ_τ(r) = A²/(2r²) |
145
+ | Flat rotation | v²_∞ = 2πGA² |
146
+ | Tully-Fisher | v⁴ ∝ M_BH ∝ M_baryonic |
147
+ | R_core bridge | m_τ² = c_m \|R_core\| |
148
+
149
+ ## Testing
150
+
151
+ ```bash
152
+ pytest tests/ -v
153
+ ```
154
+
155
+ ## License
156
+
157
+ MIT
158
+
159
+ ## Citation
160
+
161
+ If you use this package in research, please cite:
162
+
163
+ ```bibtex
164
+ @software{mtft2025,
165
+ title = {MTFT: Modular Time Field Theory Python Package},
166
+ author = {Roger},
167
+ year = {2025},
168
+ url = {https://github.com/roger/mtft}
169
+ }
170
+ ```
mtft-0.3.0/README.md ADDED
@@ -0,0 +1,138 @@
1
+ # MTFT — Modular Time Field Theory
2
+
3
+ [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+
6
+ A Python library implementing the core data structures and computational tools for **Modular Time Field Theory (MTFT)**.
7
+
8
+ ## Overview
9
+
10
+ MTFT proposes a modular time field **τ(x) = t_R / t_U** mapping spacetime to the upper half-plane **ℍ**, unifying dark matter, particle masses, and cosmic structure through:
11
+
12
+ - **Modular symmetry** — SL(2,ℤ) acting on τ
13
+ - **Gauge-Higgs unification** — Higgs = A_τ holonomy via the Hosotani mechanism
14
+ - **τ-vortex dark matter** — logarithmic τ-profiles give flat rotation curves with no dark particles
15
+ - **Information geometry bridge** — Fisher-Rao curvature of the logistic map connects chaos → geometry → dynamics
16
+
17
+ ### The Three-Layer Architecture
18
+
19
+ ```
20
+ Counting → Logistic map orbits, figurate-number degeneracies
21
+ Geometry → Fisher-Rao metric, Ricci curvature R_core
22
+ Dynamics → SM masses, dark matter halos, decay rates, cosmology
23
+ ```
24
+
25
+ Connected by the **spectral determinant identity**:
26
+
27
+ ```
28
+ det(1 − q^{1/m} P_m) = η(τ)^{−1/m} θ₃(0,τ)^{1/m}
29
+ ```
30
+
31
+ linking Fredholm determinants (chaos/RG) to CFT partition functions.
32
+
33
+ ## Installation
34
+
35
+ ```bash
36
+ pip install -e . # minimal (numpy only)
37
+ pip install -e ".[full]" # with scipy + matplotlib
38
+ pip install -e ".[dev]" # with pytest + ruff
39
+ ```
40
+
41
+ ## Quick Start
42
+
43
+ ```python
44
+ import mtft
45
+
46
+ # ── Modular forms ─────────────────────────────────────
47
+ tau = 0.1 + 1.5j
48
+ eta = mtft.dedekind_eta(tau)
49
+ j = mtft.forms.j_invariant(tau)
50
+ print(f"η(τ) = {eta:.6f}")
51
+ print(f"j(τ) = {j:.2f}")
52
+
53
+ # Verify the spectral determinant identity
54
+ result = mtft.forms.verify_spectral_identity(tau, m=2)
55
+ print(f"Spectral identity relative error: {result['relative_error']:.2e}")
56
+
57
+ # ── Hosotani mechanism ────────────────────────────────
58
+ hp = mtft.HosotaniPotential(fermion_fraction=0.4, kappa_ew=0.05)
59
+ theta0 = hp.find_vacuum()
60
+ masses = hp.gauge_masses()
61
+ print(f"Vacuum θ₀ = {theta0:.4f}")
62
+ print(f"m_W = {masses['m_W']:.2f} GeV (PDG: 80.37)")
63
+ print(f"m_Z = {masses['m_Z']:.2f} GeV (PDG: 91.19)")
64
+
65
+ # ── Particle spectrum ─────────────────────────────────
66
+ sm = mtft.StandardModel()
67
+ top = sm.by_name("Top")
68
+ print(f"Top quark: m = {top.mass_GeV} GeV, κ = {top.kappa}")
69
+
70
+ # Full κ-hierarchy
71
+ for name, kappa in sm.kappa_hierarchy():
72
+ print(f" {name:15s} κ = {kappa:.2e}")
73
+
74
+ # ── Dark sector ───────────────────────────────────────
75
+ import numpy as np
76
+ halo = mtft.TauVortexHalo(A=1e20, r0=1e30)
77
+ r = np.logspace(31, 35, 100)
78
+ v = halo.v_circular(r)
79
+ print(f"v_∞ = {halo.v_infinity:.4e} (flat rotation velocity)")
80
+
81
+ # ── Information geometry ──────────────────────────────
82
+ R = mtft.info_geometry.R_core()
83
+ print(f"R_core (Feigenbaum) = {R:.4f}")
84
+
85
+ # ── Cosmology ─────────────────────────────────────────
86
+ cosmo = mtft.FriedmannMTFT(Omega_tau=0.25)
87
+ hist = cosmo.expansion_history()
88
+ ```
89
+
90
+ ## Package Structure
91
+
92
+ ```
93
+ mtft/
94
+ ├── constants.py # PDG masses, SM parameters, physical constants
95
+ ├── modular.py # τ-field, SL(2,ℤ), hyperbolic geometry
96
+ ├── forms.py # Dedekind η, Jacobi θ₃, Eisenstein, spectral det
97
+ ├── hosotani.py # Effective potential, vacuum finder, EWSB
98
+ ├── particles.py # SM particle database with κ-couplings
99
+ ├── dark_sector.py # τ-vortex halos, rotation curves, Tully-Fisher
100
+ ├── info_geometry.py # Fisher-Rao metric, Ricci curvature, logistic map
101
+ └── cosmology.py # Modified Friedmann, perturbations, G(t) oscillation
102
+ ```
103
+
104
+ ## Key Equations
105
+
106
+ | Component | Equation |
107
+ |-----------|----------|
108
+ | Modular time field | τ(x) = t_R(x)/t_U(x) ∈ ℍ |
109
+ | Hyperbolic metric | ds² = (dx² + dy²)/y², K = −1 |
110
+ | W mass | m_W = κ_EW \|sin θ_H\| / (2R_τ) |
111
+ | Fermion mass | m_f = κ_f \|sin θ₀\| / R_τ |
112
+ | τ-vortex density | ρ_τ(r) = A²/(2r²) |
113
+ | Flat rotation | v²_∞ = 2πGA² |
114
+ | Tully-Fisher | v⁴ ∝ M_BH ∝ M_baryonic |
115
+ | R_core bridge | m_τ² = c_m \|R_core\| |
116
+
117
+ ## Testing
118
+
119
+ ```bash
120
+ pytest tests/ -v
121
+ ```
122
+
123
+ ## License
124
+
125
+ MIT
126
+
127
+ ## Citation
128
+
129
+ If you use this package in research, please cite:
130
+
131
+ ```bibtex
132
+ @software{mtft2025,
133
+ title = {MTFT: Modular Time Field Theory Python Package},
134
+ author = {Roger},
135
+ year = {2025},
136
+ url = {https://github.com/roger/mtft}
137
+ }
138
+ ```
@@ -0,0 +1,44 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68.0,<77", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "mtft"
7
+ version = "0.3.0"
8
+ description = "Modular Time Field Theory — core data structures, modular geometry, gauge-Higgs unification, dark sector, and information geometry"
9
+ readme = "README.md"
10
+ license = {text = "MIT"}
11
+ requires-python = ">=3.9"
12
+ authors = [
13
+ {name = "Roger Tano"},
14
+ ]
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Intended Audience :: Science/Research",
18
+ "Topic :: Scientific/Engineering :: Physics",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.9",
21
+ "Programming Language :: Python :: 3.10",
22
+ "Programming Language :: Python :: 3.11",
23
+ "Programming Language :: Python :: 3.12",
24
+ ]
25
+ keywords = ["physics", "modular-forms", "gauge-theory", "dark-matter", "information-geometry"]
26
+
27
+ dependencies = [
28
+ "numpy>=1.22",
29
+ ]
30
+
31
+ [project.optional-dependencies]
32
+ full = ["scipy>=1.9", "matplotlib>=3.5"]
33
+ viz = ["matplotlib>=3.5", "plotly>=5.0"]
34
+ dev = ["pytest>=7.0", "pytest-cov", "ruff"]
35
+
36
+ [project.urls]
37
+ Homepage = "https://github.com/roger/mtft"
38
+ Documentation = "https://github.com/roger/mtft#readme"
39
+
40
+ [tool.setuptools.packages.find]
41
+ where = ["src"]
42
+
43
+ [tool.ruff]
44
+ line-length = 100
mtft-0.3.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,44 @@
1
+ """
2
+ MTFT — Modular Time Field Theory (v0.3.0)
3
+ ============================================
4
+
5
+ 16 modules covering the complete MTFT framework from arithmetic
6
+ weights through lattice gauge theory and experimental verification.
7
+ """
8
+
9
+ __version__ = "0.3.0"
10
+
11
+ # ── Tier 0: Constants & Arithmetic ───────────────────────────
12
+ from mtft.constants import (
13
+ SM, GAUGE, HIGGS, PDG, PhysicalConstants, CriticalDepths, MassRatios,
14
+ FEIGENBAUM_DELTA, FEIGENBAUM_ALPHA, T_INF, LAMBERT_OMEGA, EULER_GAMMA,
15
+ QUARKS, LEPTONS, ZETA_2, XI,
16
+ )
17
+ from mtft.arithmetic import (
18
+ weight, weight_array, damped_weights,
19
+ S1, stiffness_S, center_stiffness, mass_gap_stiffness,
20
+ su3_hessian_eigenvalues, find_confinement_depth,
21
+ )
22
+
23
+ # ── Tier 1: Modular Geometry & Forms ─────────────────────────
24
+ from mtft.modular import TauField, sl2z_transform
25
+ from mtft.forms import dedekind_eta, jacobi_theta3, eisenstein_E2k, verify_spectral_identity
26
+
27
+ # ── Tier 2: Gauge-Higgs ──────────────────────────────────────
28
+ from mtft.hosotani import HosotaniPotential
29
+ from mtft.particles import Particle, StandardModel
30
+
31
+ # ── Tier 3: Phenomenology ────────────────────────────────────
32
+ from mtft.dark_sector import TauVortexHalo, rotation_curve, tully_fisher
33
+ from mtft.info_geometry import fisher_rao_metric, ricci_scalar_logistic
34
+ from mtft.cosmology import FriedmannMTFT
35
+
36
+ # ── Tier 4: Lattice & Fermions ───────────────────────────────
37
+ from mtft.lattice import LatticeConfig, MTFTAction, metropolis_sweep, avg_plaquette, avg_polyakov
38
+ from mtft.x0_143 import tano_mass_predictions, koide_angle_tano, generation_count, JACOBIAN
39
+ from mtft.koide import koide_ratio, koide_leptons, predict_tau_mass, koide_manifold_point
40
+ from mtft.burning_ship import burning_ship_iterate, ANISOTROPIC
41
+
42
+ # ── Tier 5: Dimensional Bridge & Decay ───────────────────────
43
+ from mtft.dimensional_bridge import electron_mass_from_eta, charge_from_feigenbaum
44
+ from mtft.decay import ModularDecay
@@ -0,0 +1,234 @@
1
+ """
2
+ MTFT Arithmetic Weights and Holonomy Stiffness
3
+ ================================================
4
+
5
+ The arithmetic weights wₙ = Σ_{d|n} (log d)/d are the atoms of MTFT.
6
+ Their Dirichlet series satisfies W(s) = −ζ(s)ζ′(s+1).
7
+
8
+ Key series at modular depth y:
9
+ aₙ(y) = wₙ e^{−2πyn} (damped weights)
10
+ S₁(y) = Σ aₙ(y) (partition function / stiffness action)
11
+ S(y) = Σ n² aₙ(y) (holonomy stiffness)
12
+ C_N(y) = Σ n² aₙ(y) cos(2πn/N) (center-projected stiffness)
13
+ μ_N(y) = min_m Σ n² aₙ(y) (1 − cos(2πnm/N)) (mass gap)
14
+
15
+ The fine-structure constant is α⁻¹ = 2/S₁(y_spec).
16
+ The confinement lock is C_3(y_conf) = 0 (Hessian isotropy).
17
+
18
+ Reference: Papers 5, 7, 9, 13, 24; Dictionary IV–V.
19
+ """
20
+
21
+ from __future__ import annotations
22
+
23
+ import math
24
+ from functools import lru_cache
25
+
26
+ import numpy as np
27
+
28
+
29
+ # ── Arithmetic weight function ───────────────────────────────
30
+
31
+ def weight(n: int) -> float:
32
+ """
33
+ Compute wₙ = Σ_{d|n} (log d)/d.
34
+
35
+ These are rigid number-theoretic objects — not fitted.
36
+ w₁ = 0, w₂ = (log 2)/2, w₃ = (log 3)/3, w₆ = w₂ + w₃ + (log 6)/6, ...
37
+ """
38
+ if n < 1:
39
+ raise ValueError("n must be ≥ 1")
40
+ total = 0.0
41
+ for d in range(1, n + 1):
42
+ if n % d == 0:
43
+ if d > 1:
44
+ total += math.log(d) / d
45
+ return total
46
+
47
+
48
+ @lru_cache(maxsize=8192)
49
+ def _weight_cached(n: int) -> float:
50
+ return weight(n)
51
+
52
+
53
+ def weight_array(n_max: int) -> np.ndarray:
54
+ """Compute wₙ for n = 1, ..., n_max as a NumPy array."""
55
+ return np.array([_weight_cached(n) for n in range(1, n_max + 1)])
56
+
57
+
58
+ # ── Euler-shifted weights (Paper 20) ─────────────────────────
59
+
60
+ def weight_euler(n: int) -> float:
61
+ """
62
+ Euler-shifted weight: w_n^(e) = w_n + σ_{-1}(n).
63
+
64
+ The substitution log k → log(ek) activates w₁ = 0 → w₁^(e) = 1,
65
+ creating the electron as the vacuum's first excitation.
66
+ """
67
+ sigma_minus1 = sum(1.0 / d for d in range(1, n + 1) if n % d == 0)
68
+ return weight(n) + sigma_minus1
69
+
70
+
71
+ # ── Damped coefficients ──────────────────────────────────────
72
+
73
+ def damped_weight(n: int, y: float) -> float:
74
+ """aₙ(y) = wₙ exp(−2πyn)."""
75
+ return _weight_cached(n) * math.exp(-2.0 * math.pi * y * n)
76
+
77
+
78
+ def damped_weights(y: float, n_max: int = 500) -> np.ndarray:
79
+ """Array of aₙ(y) for n = 1..n_max."""
80
+ ns = np.arange(1, n_max + 1)
81
+ ws = weight_array(n_max)
82
+ return ws * np.exp(-2.0 * math.pi * y * ns)
83
+
84
+
85
+ # ── Stiffness series ─────────────────────────────────────────
86
+
87
+ def S1(y: float, n_max: int = 500) -> float:
88
+ """
89
+ Partition function / stiffness action:
90
+ S₁(y) = Σ wₙ e^{−2πyn}
91
+
92
+ The fine-structure constant is α⁻¹ = 2/S₁(y_spec).
93
+ """
94
+ return float(np.sum(damped_weights(y, n_max)))
95
+
96
+
97
+ def stiffness_S(y: float, n_max: int = 500) -> float:
98
+ """
99
+ Holonomy stiffness:
100
+ S(y) = Σ n² wₙ e^{−2πyn}
101
+ """
102
+ ns = np.arange(1, n_max + 1)
103
+ ws = weight_array(n_max)
104
+ return float(np.sum(ns**2 * ws * np.exp(-2 * math.pi * y * ns)))
105
+
106
+
107
+ def center_stiffness(y: float, N: int = 3, n_max: int = 500) -> float:
108
+ """
109
+ Z_N center-projected stiffness:
110
+ C_N(y) = Σ n² wₙ e^{−2πyn} cos(2πn/N)
111
+
112
+ C_3(y_conf) = 0 is the confinement lock.
113
+ """
114
+ ns = np.arange(1, n_max + 1)
115
+ ws = weight_array(n_max)
116
+ cos_terms = np.cos(2.0 * math.pi * ns / N)
117
+ return float(np.sum(ns**2 * ws * np.exp(-2 * math.pi * y * ns) * cos_terms))
118
+
119
+
120
+ def mass_gap_stiffness(y: float, N: int = 3, n_max: int = 500) -> float:
121
+ """
122
+ SU(N) mass gap stiffness (minimum over modes m):
123
+ μ_N(y) = min_{m=1..N-1} Σ n² wₙ e^{−2πyn} (1 − cos(2πnm/N))
124
+
125
+ Theorem: μ_N(y) > 0 unconditionally for all N≥2, y>0.
126
+ """
127
+ ns = np.arange(1, n_max + 1)
128
+ ws = weight_array(n_max)
129
+ damped = ns**2 * ws * np.exp(-2 * math.pi * y * ns)
130
+
131
+ mu_min = float("inf")
132
+ for m in range(1, N):
133
+ gap_terms = 1.0 - np.cos(2 * math.pi * ns * m / N)
134
+ mu_m = float(np.sum(damped * gap_terms))
135
+ mu_min = min(mu_min, mu_m)
136
+ return mu_min
137
+
138
+
139
+ # ── SU(3) Hessian eigenvalues (Paper 5 §24.4, Bridge §4.3) ──
140
+
141
+ def su3_hessian_eigenvalues(y: float, n_max: int = 500) -> tuple[float, float]:
142
+ """
143
+ SU(3) holonomy Hessian eigenvalues:
144
+ λ₁ = (S_N + 2C_N) / 3
145
+ λ₂ = (S_N − C_N) / 3
146
+
147
+ At y_conf ≈ 0.18174: λ₁/λ₂ = 1.000001 (the spectral lock).
148
+ """
149
+ S = stiffness_S(y, n_max)
150
+ C = center_stiffness(y, N=3, n_max=n_max)
151
+ lam1 = (S + 2 * C) / 3.0
152
+ lam2 = (S - C) / 3.0
153
+ return lam1, lam2
154
+
155
+
156
+ def find_confinement_depth(
157
+ y_min: float = 0.10, y_max: float = 0.25, tol: float = 1e-8, n_max: int = 500
158
+ ) -> float:
159
+ """
160
+ Find y_conf where C_3(y) = 0 (SU(3) Hessian isotropy).
161
+
162
+ Uses bisection on C_3(y).
163
+ """
164
+ # C_3 starts positive and crosses zero
165
+ c_lo = center_stiffness(y_min, N=3, n_max=n_max)
166
+ c_hi = center_stiffness(y_max, N=3, n_max=n_max)
167
+
168
+ if c_lo * c_hi > 0:
169
+ # Try a wider scan
170
+ for y_test in np.linspace(y_min, y_max, 200):
171
+ c_test = center_stiffness(y_test, N=3, n_max=n_max)
172
+ if c_test * c_lo < 0:
173
+ y_max = y_test
174
+ c_hi = c_test
175
+ break
176
+
177
+ lo, hi = y_min, y_max
178
+ for _ in range(100):
179
+ mid = (lo + hi) / 2.0
180
+ c_mid = center_stiffness(mid, N=3, n_max=n_max)
181
+ if abs(c_mid) < tol:
182
+ return mid
183
+ if c_mid * c_lo > 0:
184
+ lo = mid
185
+ c_lo = c_mid
186
+ else:
187
+ hi = mid
188
+ return (lo + hi) / 2.0
189
+
190
+
191
+ # ── Lambert series ───────────────────────────────────────────
192
+
193
+ def lambert_series(q: complex, n_max: int = 200) -> complex:
194
+ """
195
+ MTFT Lambert series: W(q) = Σ_{d≥1} (log d)/d · q^d/(1−q^d).
196
+
197
+ This is the q-series feeding the modular holonomy potential.
198
+ """
199
+ total = 0.0 + 0j
200
+ for d in range(2, n_max + 1):
201
+ qd = q ** d
202
+ if abs(1.0 - qd) < 1e-30:
203
+ continue
204
+ total += (math.log(d) / d) * qd / (1.0 - qd)
205
+ return total
206
+
207
+
208
+ # ── Torque flux convergence (Paper 7, §9) ────────────────────
209
+
210
+ def torque_partial_sum(N: int) -> float:
211
+ """
212
+ Partial sum of the normalised torque: (1/N²) Σ_{n=1}^{N} n·wₙ.
213
+
214
+ Converges to T∞ = −ζ′(2)/2 ≈ 0.4688.
215
+ """
216
+ total = 0.0
217
+ for n in range(1, N + 1):
218
+ total += n * _weight_cached(n)
219
+ return total / (N ** 2)
220
+
221
+
222
+ # ── Dirichlet series identity check ──────────────────────────
223
+
224
+ def dirichlet_F(s: complex, n_max: int = 500) -> complex:
225
+ """
226
+ Compute F(s) = Σ f(n)/n^s where f = σ * Λ.
227
+
228
+ Should equal −ζ(s−1)ζ′(s) (the master Dirichlet identity).
229
+ """
230
+ total = 0.0 + 0j
231
+ for n in range(1, n_max + 1):
232
+ f_n = sum(math.log(d) for d in range(1, n + 1) if n % d == 0)
233
+ total += f_n / n ** s
234
+ return total