Skip to content

Commit 963325d

Browse files
author
TNFR AI Agent
committed
feat(riemann): P40 - chi-twisted node-aware gauge sweep
Structural extension of P20 (node-aware gauge sweep) to primitive real Dirichlet L-functions. Sweeps alpha_chi(sigma; f, g) = W_chi[sigma; f] / E_TNFR^chi[sigma; f, g] across DEFAULT_TEST_FAMILIES (P19, 3 admissible Schwartz-even families) crossed with DEFAULT_NODEAWARE_GAUGES (P20, 4 node-aware gauges activating per-node normalised nu_f and log p channels). W_chi computed once per (family, sigma) via P35 enumerator; canonical TNFR test state built via build_twisted_test_state_nodeaware on P34 chi-twisted bundle. Empirical verification: 3/3 PASS for chi_3, chi_4, chi_5 across 3 families x 4 node-aware gauges x 5 widths (180 cells per character). alpha_min at (sigma=1.0, gaussian, nuf_phase) for chi_3 (+1.25e-14) and chi_4 (+2.69e-08); at (sigma=1.0, gaussian, nuf_pressure) for chi_5 (+2.60e-10). Honest scope: does NOT prove GRH for any L(s, chi) and does NOT advance G4 = RH. Closes node-aware canonical-mapping robustness gap on the L-function track, achieving structural parity with the zeta-track through P20. Files: src/tnfr/riemann/twisted_nodeaware_gauge_sweep.py (~330 lines), src/tnfr/riemann/__init__.py (docstring + import + __all__), examples/67_twisted_nodeaware_gauge_sweep_demo.py (~220 lines), theory/TNFR_RIEMANN_RESEARCH_NOTES.md (section 13noniesdecies + section 19.1 P40 row).
1 parent ecc4e91 commit 963325d

4 files changed

Lines changed: 641 additions & 0 deletions

File tree

Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
"""Demo 67: P40 chi-twisted node-aware gauge sweep for primitive real
2+
Dirichlet L-functions.
3+
4+
Structural analogue of Demo 49 (P20 node-aware gauge sweep for zeta)
5+
extended to L(s, chi) via the P34 chi-twisted prime-ladder
6+
Hamiltonian, the P35 chi-twisted Weil-Guinand zero-side enumerator,
7+
and the P37 chi-twisted Weil-TNFR positivity bridge.
8+
9+
Whereas Demo 66 (P39) audited the canonical scalar-h gauges
10+
DEFAULT_GAUGES (P18), Demo 67 (P40) sweeps the **node-aware** gauges
11+
DEFAULT_NODEAWARE_GAUGES (P20) -- gauges of the form
12+
``(d, phi, eps) = g(h(E_n), hat nu_f(n), hat w(n))`` --
13+
across the same three admissible Schwartz-even test families
14+
(gaussian, gaussian_mixture, hermite2_gaussian, inherited from P19).
15+
16+
The demo executes:
17+
18+
1. **Detailed (family, node_gauge) chart for chi_3 at sigma=2.0**.
19+
20+
2. **Aggregate sweep across chi_3, chi_4, chi_5** -- reports
21+
aggregate positivity flags and the [alpha_min, alpha_max] range
22+
for each character together with the (sigma, family, node_gauge)
23+
coordinates of the minimum.
24+
25+
3. **Certificate summaries and honest scope**.
26+
27+
Honest scope
28+
------------
29+
This demo numerically probes alpha_chi(sigma; f, g) > 0 across three
30+
admissible Schwartz-even test families, four canonical node-aware
31+
gauges, and a finite Gaussian-width grid for three primitive real
32+
characters. Positive results strengthen the P37 / P38 / P39
33+
numerical evidence under joint test-profile + node-aware mapping
34+
ambiguity but **do not prove** GRH for any L(s, chi). This demo
35+
also does NOT advance G4 = RH or the arithmetic obstruction of GRH.
36+
"""
37+
38+
from __future__ import annotations
39+
40+
import sys
41+
42+
try:
43+
sys.stdout.reconfigure(encoding="utf-8") # type: ignore[attr-defined]
44+
except AttributeError:
45+
pass
46+
47+
from tnfr.riemann import (
48+
build_twisted_prime_ladder_hamiltonian,
49+
real_character_mod_3,
50+
real_character_mod_4,
51+
real_character_mod_5,
52+
sweep_twisted_nodeaware_gauge,
53+
)
54+
55+
# --------------------------------------------------------------------
56+
# Configuration
57+
# --------------------------------------------------------------------
58+
59+
SIGMAS = (1.0, 1.5, 2.0, 2.5, 3.0)
60+
61+
N_PRIMES = 25
62+
MAX_POWER = 6
63+
COUPLING = 0.0
64+
65+
CHARACTERS = (
66+
("chi_3", real_character_mod_3),
67+
("chi_4", real_character_mod_4),
68+
("chi_5", real_character_mod_5),
69+
)
70+
71+
72+
def banner(title: str, char: str = "=") -> None:
73+
print(char * 72)
74+
print(title)
75+
print(char * 72)
76+
77+
78+
def fmt_signed(x: float, width: int = 12, prec: int = 4) -> str:
79+
if x != x: # NaN
80+
return f"{'nan':>{width}}"
81+
if x == float("inf"):
82+
return f"{'+inf':>{width}}"
83+
if x == float("-inf"):
84+
return f"{'-inf':>{width}}"
85+
return f"{x:+{width}.{prec}e}"
86+
87+
88+
# --------------------------------------------------------------------
89+
# Block 1: detailed chart for chi_3
90+
# --------------------------------------------------------------------
91+
92+
93+
def block_detailed_chi3() -> None:
94+
banner(
95+
"BLOCK 1: detailed (family, node_gauge) chart for chi_3 "
96+
"across sigma grid"
97+
)
98+
chi = real_character_mod_3()
99+
bundle = build_twisted_prime_ladder_hamiltonian(
100+
chi,
101+
n_primes=N_PRIMES,
102+
max_power=MAX_POWER,
103+
coupling=COUPLING,
104+
)
105+
cert = sweep_twisted_nodeaware_gauge(chi, bundle, SIGMAS)
106+
107+
print(f" character : {cert.character_name} "
108+
f"(q={cert.character_modulus})")
109+
print(f" n_sigma : {len(cert.sigmas)}")
110+
print(f" families : {cert.families}")
111+
print(f" node_gauges : {cert.node_gauges}")
112+
print()
113+
114+
print(" W_chi[sigma; family] (gauge-independent):")
115+
header = " " + f"{'family':<22}" + " ".join(
116+
f"sigma={s:>5.2f}" for s in cert.sigmas
117+
)
118+
print(header)
119+
for i, fname in enumerate(cert.families):
120+
row = " " + f"{fname:<22}" + " ".join(
121+
fmt_signed(float(cert.weil_table[i, j]), width=11, prec=3)
122+
for j in range(len(cert.sigmas))
123+
)
124+
print(row)
125+
print()
126+
127+
j_target = len(cert.sigmas) // 2
128+
sigma_target = float(cert.sigmas[j_target])
129+
print(f" alpha_chi(sigma={sigma_target:.3f}; family, node_gauge):")
130+
header = " " + f"{'family\\node_gauge':<22}" + " ".join(
131+
f"{gn[:13]:>14}" for gn in cert.node_gauges
132+
)
133+
print(header)
134+
for i, fname in enumerate(cert.families):
135+
row = " " + f"{fname:<22}" + " ".join(
136+
fmt_signed(float(cert.alpha_table[i, k, j_target]),
137+
width=14, prec=4)
138+
for k in range(len(cert.node_gauges))
139+
)
140+
print(row)
141+
print()
142+
143+
144+
# --------------------------------------------------------------------
145+
# Block 2: aggregate sweep
146+
# --------------------------------------------------------------------
147+
148+
149+
def block_aggregate_sweep() -> list:
150+
banner("BLOCK 2: aggregate sweep across chi_3, chi_4, chi_5")
151+
certs = []
152+
print(
153+
f" {'character':<12} {'q':>3} {'W>=0':>6} {'a>0':>6} "
154+
f"{'alpha_min':>14} {'@(sigma,fam,node_gauge)':<48} "
155+
f"{'alpha_max':>14}"
156+
)
157+
print(" " + "-" * 116)
158+
for name, factory in CHARACTERS:
159+
chi = factory()
160+
bundle = build_twisted_prime_ladder_hamiltonian(
161+
chi,
162+
n_primes=N_PRIMES,
163+
max_power=MAX_POWER,
164+
coupling=COUPLING,
165+
)
166+
cert = sweep_twisted_nodeaware_gauge(chi, bundle, SIGMAS)
167+
certs.append(cert)
168+
loc = (
169+
f"({cert.alpha_min_sigma:.3f}, "
170+
f"{cert.alpha_min_family}, "
171+
f"{cert.alpha_min_node_gauge})"
172+
)
173+
print(
174+
f" {cert.character_name:<12} "
175+
f"{cert.character_modulus:>3} "
176+
f"{str(cert.weil_all_positive):>6} "
177+
f"{str(cert.alpha_all_positive):>6} "
178+
f"{fmt_signed(cert.alpha_min, width=14, prec=4)} "
179+
f"{loc:<48} "
180+
f"{fmt_signed(cert.alpha_max, width=14, prec=4)}"
181+
)
182+
print()
183+
return certs
184+
185+
186+
# --------------------------------------------------------------------
187+
# Block 3: summaries + scope
188+
# --------------------------------------------------------------------
189+
190+
191+
def block_summaries(certs: list) -> None:
192+
banner("BLOCK 3: certificate summaries")
193+
for cert in certs:
194+
print(" " + cert.summary())
195+
print()
196+
banner("HONEST SCOPE", char="-")
197+
print(
198+
" P40 numerically verifies alpha_chi(sigma; f, g) > 0\n"
199+
" across a finite Gaussian-width grid, three admissible\n"
200+
" Schwartz-even test families (P19) and four canonical\n"
201+
" node-aware gauges DEFAULT_NODEAWARE_GAUGES (P20) for three\n"
202+
" primitive real Dirichlet characters (chi_3, chi_4, chi_5).\n"
203+
" Positive results strengthen the P37 / P38 / P39 numerical\n"
204+
" evidence under joint test-profile + node-aware mapping\n"
205+
" ambiguity but do NOT prove GRH for any L(s, chi) and do\n"
206+
" NOT advance G4 = RH. Like P20 / P39, this is an\n"
207+
" RH-equivalent robustness audit on a finite grid, not a\n"
208+
" theorem on family-uniform positivity."
209+
)
210+
211+
212+
def main() -> None:
213+
block_detailed_chi3()
214+
certs = block_aggregate_sweep()
215+
block_summaries(certs)
216+
217+
218+
if __name__ == "__main__":
219+
main()

‎src/tnfr/riemann/__init__.py‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,21 @@
265265
Implemented for primitive real characters (chi_3, chi_4, chi_5).
266266
Diagnostic only; does NOT prove GRH for any L(s, chi) and does
267267
NOT advance G4 = RH.
268+
twisted_nodeaware_gauge_sweep
269+
P40 chi-twisted node-aware gauge sweep of
270+
alpha_chi(sigma; f, g) = W_chi[sigma; f] / E_TNFR_chi[sigma; f, g]
271+
where g varies over the node-aware gauges DEFAULT_NODEAWARE_GAUGES
272+
inherited unchanged from the zeta-track P20 (nuf_pressure,
273+
nuf_phase, weight_pressure, mixed_affine). Each gauge depends on
274+
the per-node normalised structural frequency hat nu_f(n) and
275+
normalised node-weight hat w(n) = log p / max log p of the P34
276+
chi-twisted prime-ladder graph. Structural analogue of P20 for
277+
primitive real Dirichlet L-functions: probes robustness of the
278+
P37 chi-twisted positivity bridge under node-aware canonical-
279+
mapping ambiguity crossed with the admissible-family sweep (P19).
280+
Implemented for primitive real characters (chi_3, chi_4, chi_5).
281+
Diagnostic only; does NOT prove GRH for any L(s, chi) and does
282+
NOT advance G4 = RH.
268283
oscillatory_correction
269284
P31 Branch B1 retry: prime-ladder oscillatory correction of the
270285
P28 / P30 smooth targets. Reconstructs S(T) = pi^{-1} arg zeta(1/2
@@ -766,6 +781,12 @@
766781
build_twisted_test_state_from_test_function,
767782
sweep_twisted_admissible_family,
768783
)
784+
from .twisted_nodeaware_gauge_sweep import (
785+
# P40: chi-twisted node-aware gauge sweep (diagnostic)
786+
TwistedNodeAwareGaugeSweepCertificate,
787+
build_twisted_test_state_nodeaware,
788+
sweep_twisted_nodeaware_gauge,
789+
)
769790
from .spectral_emergence import (
770791
# P29: Spectral universality emergence under canonical UM+RA coupling
771792
CANONICAL_COUPLING_LAWS,
@@ -1144,6 +1165,10 @@
11441165
"TwistedAdmissibleFamilySweepCertificate",
11451166
"build_twisted_test_state_from_test_function",
11461167
"sweep_twisted_admissible_family",
1168+
# P40: chi-twisted node-aware gauge sweep (diagnostic)
1169+
"TwistedNodeAwareGaugeSweepCertificate",
1170+
"build_twisted_test_state_nodeaware",
1171+
"sweep_twisted_nodeaware_gauge",
11471172
# P29: Spectral universality emergence under canonical UM+RA coupling
11481173
"CANONICAL_COUPLING_LAWS",
11491174
"InterPrimeCoupling",

0 commit comments

Comments
 (0)