Repository navigation
Phase C compute_zeros_v4
Lien parent : Phase Optimisation v3
Branche :Riemann_Lab_C
Date : 24 mai 2026
Statut : ✅ Complète — v4 opérationnelle, benchmark mesuré
- Contexte — objectif de la Phase C
- Problème mathématique — incohérence Z_RS vs vrais zéros
- Solution choisie — Option B hybride
- Architecture Phase C — fichiers produits
- Benchmark mesuré — gains Illinois C
- Limitations fondamentales connues
- Questions ouvertes — v5 et au-delà
La v3 (compute_zeros_v3.py) utilise la formule de Riemann-Siegel (RS) pour la détection des changements de signe, et mpmath.findroot (Illinois Python) pour l'affinage à 35 dps. L'affinage représente 80–90% du temps total.
Objectif Phase C : porter l'affinage Illinois de Python/mpmath vers C/libmpfr (170 bits ≈ 51 décimales) pour obtenir ×5–10 sur l'affinage.
La formule RS avec terme correctif C₀+C₁ est une série asymptotique dont l'erreur résiduelle (terme C₂ négligé) est d'ordre :
où
| Plage de |
|
Max | |
|---|---|---|---|
| 1 | 12–25 | 6.3 × 10⁻³ | 1.2 × 10⁻² |
| 2 | 25–55 | 4.9 × 10⁻³ | 8.4 × 10⁻³ |
| 3 | 55–100 | 2.7 × 10⁻³ | 4.9 × 10⁻³ |
| 4 | 100–175 | 1.9 × 10⁻³ | 3.3 × 10⁻³ |
| 7 | 300–500 | 9.0 × 10⁻⁴ | 1.5 × 10⁻³ |
Interprétation :
Vrai zéro LMFDB : γ₂ = 21.022 039 638 77
Zéro de Z_RS : γ_RS = 21.011 632 354 16 (décalé de −0.010)
Intervalle mpmath.siegelz : [21.022, 21.027]
Z_double dans cet intervalle : −0.012, −0.017 ← même signe
→ Illinois C ne peut pas converger dans cet intervalle
| Étape | v3 | v4 (Phase C) |
|---|---|---|
| Détection |
Z_fast (RS approx., rapide) |
mpmath.siegelz à dps=15 (vrais zéros garantis) |
| Affinage |
mpmath.findroot (Illinois Python) |
illinois_mpfr C si cohérent, sinon mpmath.findroot
|
| Validation | |Z_double(\gamma)| < 10^{-10} |
|mpmath.siegelz(\gamma)| < 10^{-8} |
| Parallèle | multiprocessing (4 workers) | séquentiel (v5 prévu) |
def affiner_zero(a, b, tol=1e-12):
if Z_double(a) * Z_double(b) < 0: # Z_RS cohérent → Illinois C
gamma_c = illinois_c(a, b, tol)
if abs(mpmath.siegelz(gamma_c)) < 1e-8:
return gamma_c, "illinois_C" # vrai zéro direct
return mpmath.findroot(mpmath.siegelz, gamma_c), "illinois_C→mpmath"
return mpmath.findroot(mpmath.siegelz, mid), "mpmath"| Méthode | Zéros | Condition |
|---|---|---|
illinois_C pur |
0/10 | Jamais : |
illinois_C→mpmath |
3/10 | n=6,7,9 — Z_double cohérent mais RS imprécis |
mpmath.findroot pur |
7/10 | Z_double incohérent (faux zéros RS pour petits t) |
src/calculs/optimisation/
├── compute_zeros_v4.py ← point d'entrée v4 (ce fichier)
└── c_modules/
├── illinois_mpfr.c ← Illinois en libmpfr, PREC=170 bits
├── illinois_mpfr.h ← signature ctypes (IMMUABLE)
├── z_function.c ← Z(t) RS en C float64 (détection)
├── z_function.h
├── Makefile ← cible illinois_mpfr.so
├── test_illinois.py ← validation 10 zéros LMFDB (10/10 ✅)
└── benchmark_illinois.py ← benchmark C vs mpmath sur 100 zéros
cd src/calculs/optimisation/c_modules
make # → illinois_mpfr.so
make test # → python3 test_illinois.py (10/10)lib = ctypes.CDLL("illinois_mpfr.so")
lib.illinois_mpfr.restype = ctypes.c_double
lib.illinois_mpfr.argtypes = [ctypes.c_double, ctypes.c_double, ctypes.c_double]
# Appel : lib.illinois_mpfr(a, b, tol=1e-12) → γConditions : 100 zéros,
| Méthode | Temps moyen | Temps total (100 zéros) |
|---|---|---|
| Illinois C (libmpfr, 170 bits) | 5.5 ms/zéro | 555 ms |
| mpmath.findroot (Python, 35 dps) | 216 ms/zéro | 21 614 ms |
| Gain | ×39 | — |
Note : le gain ×39 dépasse l'objectif initial ×5–10. La raison est que mpmath.findroot(mpmath.siegelz, ...) évalue la série de Dirichlet complète (
L'écart
Convergence réelle (|Z_Riemann(γ)| < 1e-8) : 10/10 ✅
Proximité LMFDB (|Δγ| < 0.5) : 10/10 ✅
| Régime | Illinois C seul fiable ? | Recommandation | |
|---|---|---|---|
|
|
1–2 | ✗ | Fallback mpmath obligatoire |
| 3–6 | ✗ (erreur RS |
Hybride ou fallback | |
| 7–100 | ✗ (erreur RS |
Hybride (Illinois C→mpmath) | |
| > 100 | ✓ | Illinois C pur possible |
La détection avec mpmath.siegelz à dps=15 suffit pour détecter un changement de signe (précision
Coût mesuré : mpmath.siegelz à dps=15,
Le parallel_scanner.py de v3 utilise multiprocessing (processus séparés, pas threads). Chaque processus peut charger sa propre instance de illinois_mpfr.so via ctypes — GMP est safe après fork. Un parallel_scanner_v4.py remplacerait directement v3.
Remplacer le balayage scalaire mpmath.siegelz par une détection vectorisée avec Z_double (C, ~microseconde par appel) + validation mpmath.siegelz uniquement sur les intervalles détectés. Gain estimé : ×10–50 sur la détection.
Pour
Les zéros calculés par v4 permettent d'étudier la distribution des espacements normalisés et de la comparer à la distribution GUE (conjecture de Montgomery). Ce test nécessite
Rapport généré le 24 mai 2026 — Phase C, branche Riemann_Lab_C — hprzeta · MAJ 12 novembre 2026 (ancres du sommaire corrigées) · 192 lignes