Five-layer computational framework for the Riemann Hypothesis. Number Theory + Statistical Models + Data Analysis + ML/AI + HPC = Number Modelling
| Layer | v1.0 | v2.0 |
|---|---|---|
| Number Theory | ζ(s) + zeros | + Connes spectral operator, Dirichlet L-functions |
| Statistical Models | GUE simulators | + Dyson Brownian motion, Log-gas MC, Tracy-Widom MLE |
| Data Analysis | KS test, bootstrap | + Gaussian Process regression, Fredholm determinants |
| ML/AI | — | + VAE spacing generator, Neural β estimator, contrastive detection |
| HPC | Parallel Z(t) | + Adaptive step, LRU memoization, GPU-ready |
| API | 20 endpoints | + 6 advanced endpoints (Connes, Dyson, ML, LMFDB) |
git clone https://github.com/twomathematicians-code/riemann-hypothesis.git
cd riemann-hypothesis
pip install -r rh_services/requirements.txt
# CLI Demo
python -m rh_numerical.main --quick
# Start API Server (26 endpoints)
python -m rh_services.api
# → http://localhost:8420/docs
# Run in browser (no install)
# → https://tinyurl.com/rh-colab (Colab notebooks)Drag a slider to explore the Riemann-Siegel Z(t) function in real-time. Watch zero crossings appear as you increase t.
Interactive 2D view of ζ(s) on the critical strip. See how |ζ(s)| behaves at different σ values.
Side-by-side comparison of Riemann zero spacings vs. GUE random matrix eigenvalues.
Open in browser — no Python required. Works on mobile.
riemann-hypothesis/
├── rh_numerical/ # Python numerical toolkit (6 modules, 3K+ lines)
│ ├── zeta.py # Riemann–Siegel Z(t), θ(t), Euler product
│ ├── zeros.py # Zero finding, Gram points, Gram's law
│ ├── turing.py # Turing verification, S(T), Lehman bounds
│ ├── equivalences.py # Robin, Lagarias, Li coefficients, Mertens
│ ├── correlations.py # Pair correlation, Wigner surmise, GUE stats
│ └── visualization.py # 10+ matplotlib plot types + dashboard
│
├── rh_advanced/ # Advanced computing framework (7 modules)
│ ├── ensembles.py # GUE/GOE/GSE, Tracy–Widom, Dyson β, bootstrap
│ ├── predictive.py # Bayesian RH test, MLE β, anomaly detection
│ ├── ml_layer.py # VAE, Neural β, Gaussian Process regression
│ ├── dyson_brownian.py # Dyson BM simulator, Log-gas MC, TW MLE
│ ├── connes_lmfdb.py # Connes Galerkin matrix, LMFDB, Dirichlet L
│ ├── hpc.py # Parallel Z(t), adaptive steps, memoization
│ └── number_model.py # Unified 5-layer synthesis + auto-reporting
│
├── rh_services/ # Production REST API (8 files)
│ ├── api.py # FastAPI server (26 endpoints)
│ ├── engine.py # 5 computation engines with caching
│ ├── models.py # Pydantic request/response schemas
│ ├── cache.py # Thread-safe TTL+LRU cache
│ └── config.py # Environment-configurable settings
│
├── cpp/ # C++17 high-performance library
│ ├── include/riemann/ # Headers: zeta, theta, zeros, primes
│ ├── src/ # Implementations with OpenMP
│ ├── tests/ # 3 test suites (18 tests)
│ └── benchmarks/ # 15 performance benchmarks
│
├── notebooks/ # 7 Colab/Kaggle interactive notebooks
├── docs/ # GitHub Pages + A4 Handbook
└── .github/workflows/ # CI/CD: test, lint, docker-build
| Function | Module | Description |
|---|---|---|
riemann_siegel_Z(t, M) |
zeta.py | Z(t) with M-term Gabcke remainder |
find_zeros_up_to(T) |
zeros.py | All zeros on critical line up to T |
verify_rh_up_to(T) |
turing.py | Turing verification (RH confirmed to T) |
robin_check(n) |
equivalences.py | Robin's inequality check |
li_criterion_check(n) |
equivalences.py | Li coefficient positivity |
pair_correlation(g) |
correlations.py | Pair correlation vs GUE |
generate_gue(N) |
ensembles.py | GUE random matrix eigenvalues |
estimate_dyson_beta(s) |
ensembles.py | Dyson β from spacings (with CI) |
bayesian_rh_test(g) |
predictive.py | Bayesian P(RH true | data) |
connes_galerkin_matrix(c) |
connes_lmfdb.py | Connes spectral operator eigenvalues |
# Core
GET /zeta/t/{t} # Z(t) on critical line
POST /zeros/verify # Turing RH verification
GET /equivalence/robin?n= # Robin's inequality
GET /stats/gue?t_max= # GUE statistical analysis
GET /primes/pi?x= # Prime counting π(x)
# Advanced (v2.0)
GET /advanced/number-model?t_max=300 # Full 5-layer analysis
GET /advanced/dyson-analysis # Dyson BM + TW + log-gas
GET /advanced/connes-operator # Connes spectral eigenvalues
GET /advanced/ml-beta # Neural β estimation
GET /advanced/lmfdb-zeros # 103B+ verified zeros
GET /advanced/dirichlet-L # Dirichlet L-function L(s,χ)| Metric | Result |
|---|---|
| Zeros found at T=100 | 29 (matches N(100) exactly) |
| Turing verification (T=500) | ✓ Passed |
| Robin/Lagarias (n ≤ 50,000) | No violations |
| Li λ₁…λ₁₀ | All > 0 |
| Dyson β (least squares) | ≈ 2.0 (GUE) |
| Dyson β (MLE, 95% CI) | ≈ 2.0 |
| KS test vs GUE | Fail to reject (D < critical) |
| Bayesian P(RH true | data) | > 0.99 |
| Neural β estimate | ≈ 2.0 |
| C++ speedup vs Python | 10–100× |
| Domain | How This Toolkit Helps |
|---|---|
| Cryptography | Prime distribution audit for RSA/ECC parameter validation |
| Data Science | GUE baseline for eigenvalue-based signal/noise separation |
| Finance | RMT-based covariance matrix cleaning (Marchenko-Pastur) |
| Wireless (5G/6G) | Channel matrix eigenvalue statistics benchmarking |
| Quantum Physics | Energy-level spacing analysis via GUE universality |
| Education | Interactive notebooks + browser simulations for RH exploration |
| Research | Zero verification, Connes operator, anomaly screening |
cd cpp && mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DRIEMANN_USE_OPENMP=ON
make -j$(nproc)
./test_riemann && ./bench_riemann| Operation | Python | C++ | Speedup |
|---|---|---|---|
| Z(100) | 10 µs | 0.3 µs | 30× |
| Z(10⁴) | 3 ms | 30 µs | 100× |
| Zeros to T=100 | 20 ms | 2 ms | 10× |
| Zeros to T=1000 | 500 ms | 40 ms | 12× |
docker build -t rh-services -f rh_services/Dockerfile .
docker run -p 8420:8420 rh-services
# → http://localhost:8420- Edwards, H.M. — Riemann's Zeta Function (Dover, 1974)
- Montgomery, H.L. — The pair correlation of zeros (1973)
- Odlyzko, A.M. — The 10²⁰-th zero and 70 million neighbors (1989)
- Connes, A. — Trace formula in noncommutative geometry (1999)
- Rodgers & Tao — The de Bruijn-Newman constant is non-negative (2018)
- Guth & Maynard — New large value estimates (2024)
- Connes, Consani & Moscovici — Zeta Spectral Triples (2025)
- Platt & Trudgian — RH true up to 3×10¹² (2021)
MIT — Free for research, education, and commercial use.
"The Riemann Hypothesis is the central problem in the theory of prime numbers, and primes are the atoms of arithmetic." — Enrico Bombieri