Skip to main content

First public implementation of the Connes-van Suijlekom Galerkin matrix for the Riemann Hypothesis.

Reason this release was yanked:

Superseded by 0.2.2; internal connes_cvs.__version__ string was stuck at 0.2.0 in this wheel

Project description

connes-cvs

The first public implementation of the Connes–van Suijlekom Galerkin matrix for the Riemann Hypothesis.

PyPI version Python 3.9+ License: MIT Zenodo DOI arXiv Tests

The Riemann Hypothesis has resisted proof for over 140 years. Connes and van Suijlekom (2025) proposed a spectral route: construct a truncated Weil operator whose ground-state eigenvalue encodes how close the Riemann zeros come to satisfying Weil's positivity criterion. This package is the only publicly available code that builds and diagonalizes that operator, and reports convergence across 113 orders of magnitude in the first-zero error.

Cutoff range Eigenvalue span Precision Speedup (v0.2.0) Published paper
c = 13 … 67 10⁻⁵⁹ → 10⁻¹⁷³ 80–200 decimal digits (tested) 1.83× total wall Zenodo 10.5281/zenodo.19546514

Table of contents


At a glance

What is this? An arbitrary-precision Python implementation of the Galerkin matrix $Q(c)$ from Proposition 4.1 of Connes–van Suijlekom 2025. Its ground-state eigenvalue $\lambda_{\min}(c)$ tracks the spectral positivity condition that implies the Riemann Hypothesis.

Why does it matter? Until now, no independent public code existed for this construction. Connes (2026) reported numerical data for the first 50 zeros at $c = 13$; Connes–Consani–Moscovici (2025) reported the same construction at $c = 13$ and $c = 14$ with $N=120$ at 200-digit precision. This package provides the third independent measurement at $c=13$, an independent cross-check at $c=14$, and thirteen first-in-literature cutoffs ($c=17$ through $c=67$), extending the dataset to fifteen cutoffs spanning 113 orders of magnitude in the first-zero error.

Convergence at a glance (15 prime cutoffs, $T = 800$, $\mathrm{dps} = 150$–$200$):

c=13  ████████                                                               -55
c=14  █████████                                                              -60
c=17  ███████████                                                            -76
c=19  █████████████                                                          -86
c=23  ███████████████                                                       -102
c=29  ██████████████████                                                    -119
c=31  ██████████████████                                                    -124
c=37  ████████████████████                                                  -135
c=41  █████████████████████                                                 -142
c=43  █████████████████████                                                 -145
c=47  ██████████████████████                                                -149
c=53  ███████████████████████                                               -156
c=59  ████████████████████████                                              -161
c=61  ████████████████████████                                              -163
c=67  █████████████████████████                                             -168
                                                                         log₁₀|γ₁ err|

Each step adds one prime. The convergence is monotone but not smooth (nine parametric models tested; all fail to capture the shape at residual ≤ 0.5 OOM).


Installation

pip install connes-cvs

For the optional 11× speedup on the archimedean integral via Arb's arbitrary-precision digamma:

pip install 'connes-cvs[fast]'

To install from source (recommended for development):

git clone https://github.com/akivag613/connes-cvs-.git
cd connes-cvs-
pip install -e '.[all]'

Requirements

  • Python ≥ 3.9
  • mpmath ≥ 1.3 (arbitrary-precision arithmetic)

Optional dependencies

  • python-flint ≥ 0.5 — Arb-backed digamma (≈ 11× speedup)
  • gmpy2 ≥ 2.1 — GMP-backed mpmath core
  • NumPy / SciPy — for downstream analysis

Quick start

from connes_cvs import build_galerkin_matrix, compute_ground_state, extract_zeros
import math

# Build the CvS Galerkin matrix at cutoff c = 13
Q = build_galerkin_matrix(c=13, N=100, T=400, dps=80)

# Diagonalize
lam_min, eigvec = compute_ground_state(Q)
print(f"λ_min(c=13) = {lam_min:.6e}")
# λ_min(c=13) ≈ 2.077e-59

# Extract the first detected Riemann zero
zeros = extract_zeros(eigvec, L=math.log(13), n_zeros=1)
print(f"γ₁ detected = {zeros[0]['gamma_detected']}")
print(f"|γ₁ error|  = {zeros[0]['error']:.4e}")
# γ₁ detected ≈ 14.1347251417...
# |γ₁ error|  ≈ 1.5e-55

End-to-end: ≈ 60 seconds on a 12-core machine with python-flint installed.

Multi-cutoff sweep (click to expand)
from connes_cvs.sweep import run_sweep

results = run_sweep(
    cutoffs=[13, 17, 19, 23, 29],
    N=100, T=400, dps=80, workers=12,
)

for c, r in results.items():
    print(f"c={c:2d}  λ_min = {r['lambda_min']:.4e}  |γ₁ err| = {r['gamma1_error']:.4e}")

Reproduce the paper

To replicate the full 15-cutoff sweep from Groskin 2026 (113 orders of magnitude in $|\gamma_1,\mathrm{err}|$):

from connes_cvs.sweep import run_sweep
import json

CUTOFFS = [13, 14, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67]

results = run_sweep(
    cutoffs=CUTOFFS,
    N=100,
    T=800,
    dps=150,            # use dps=200 for c >= 41
    workers=12,
)

with open("my_sweep.json", "w") as f:
    json.dump(
        {str(c): {"lambda_min":   str(r["lambda_min"]),
                  "gamma1_error": str(r["gamma1_error"]),
                  "wall_time":    r["wall_time"]}
         for c, r in results.items()},
        f, indent=2,
    )

Expected wall time on a 12-core modern machine (v0.2.0): ~48 minutes. The result is bit-identical in $\lambda_{\min}$ to the reference dataset in data/results_15pt_T800.json.


Validation

This implementation reproduces the published benchmarks from Connes (2026) and Connes–Consani–Moscovici (2025), which are the only independent measurements of the CvS Galerkin spectrum in the literature prior to this work.

Cutoff Published This package Agreement
$c = 13$ $2.6 \times 10^{-55}$ (Connes 2026) $\mathbf{2.005 \times 10^{-55}}$ factor 1.3
$c = 13$ $2.44 \times 10^{-55}$ (CCM §6, $N=120$, 200-digit) $\mathbf{2.005 \times 10^{-55}}$ factor 1.2
$c = 14$ $1.07 \times 10^{-60}$ (CCM §6) $\mathbf{3.541 \times 10^{-61}}$ factor 3 (first independent $c=14$ measurement)

All four numbers compute the same mathematical object — the truncated Weil minimizer $Q(c)$ — using the trigonometric basis, with different $N$, $T$, and precision settings. The factor-of-1.3 spread reflects differences in those settings (and in normalization conventions), not a correctness gap. (Correction 2026-04-19: an earlier version of this README and of the accompanying paper attributed a prolate-spheroidal basis to the CCM Galerkin computation; this was an error. The CCM Galerkin matrix is defined via a trigonometric kernel $\sin(2\pi n y/L)$ in CCM 2025 Lemma 5.1, and Connes 2026 §6 likewise describes the computation on a trigonometric basis. Prolate spheroidal wave functions appear in a distinct role in the program, as the approximation construction for the limit $k_\lambda$ (Connes 2026 §6.3–§6.4). The revised paper, Zenodo Version 2 (DOI 10.5281/zenodo.19655106, 2026-04-19), carries the correction throughout; the concept DOI 10.5281/zenodo.19546514 resolves to Version 2.)

New in this work: 13 of the 15 cutoffs tested here ($c \geq 17$) have no prior published measurement in the literature; $c = 14$ is the first independent cross-check of that datum. Full dataset in data/results_15pt_T800.json.


Performance

Version 0.2.0 is 2.06× faster on the dominant archimedean-integral phase and 1.83× faster end-to-end, with bit-identical output to v0.1.0.

Apples-to-apples A/B test ($c=13$, $N=80$, $T=400$, $\mathrm{dps}=80$, 12-way Pool)

Phase v0.1.0 v0.2.0 Speedup
Archimedean integral (cache) 57.55 s 27.94 s 2.06×
Matrix assembly 0.11 s 0.12 s unchanged
Symmetric eigensolver 6.11 s 6.19 s unchanged
Root extraction 1.16 s 1.15 s unchanged
Total wall time 64.94 s 35.40 s 1.83×
$\lambda_{\min}$ 2.52826614019657560…e-59 2.52826614019657560…e-59 bit-identical (80 digits)

At the published reference workload ($c=13$, $N=100$, $T=800$, $\mathrm{dps}=150$)

Historical (v0.1.0) v0.2.0
Wall time 214.8 s 127.3 s (1.69× faster)
$\lambda_{\min}$ (paper Table 18: $2.865 \times 10^{-59}$) 2.8654536149302802951…e-59 2.8654536149302802951…e-59matches paper to all reported precision

See benchmarks/AB_VERIFIED_2026-04-14.md for the full A/B protocol and raw timings. Reproduce on your hardware:

python benchmarks/win1_pool_benchmark.py 13 80 400 80

How it works

The truncated Weil quadratic form decomposes into three arithmetically transparent pieces:

$$ Q(c) = D_\infty + D_{\text{pole}} + D_{\text{prime}} $$

  • $D_\infty$ — archimedean Mellin multiplier $h_+(\tau) = \mathrm{Re},\psi(\tfrac{1}{4} + i\tfrac{\tau}{2}) - \log\pi$
  • $D_{\text{pole}}$ — rank-one correction from the pole of $\zeta(s)$ at $s=1$
  • $D_{\text{prime}}$ — finite von-Mangoldt sum over primes $p \leq c$

The Galerkin matrix entries are $$ q_{m,n} = \frac{\psi(m) - \psi(n)}{m - n}, \qquad q_{n,n} = \psi'(n), $$ where $\psi(x) = \tfrac{1}{\pi} \int_0^L \sin\bigl(2\pi x(1-y/L)\bigr), D(y), dy$ and $L = \log c$.

The bottleneck is the archimedean integral: evaluating the digamma function at ~11,000 adaptive quadrature nodes for each of $2N{+}1 = 201$ basis indices. Version 0.2.0 exploits two observations to halve the cost:

  1. $h_+$ is even in $\tau$ and mpmath's tanh-sinh rule is deterministic per (interval, precision), so psi_arch and psi_arch_deriv share quadrature nodes. A dict keyed on $|\tau|$ gives a 4× hit rate on digamma calls.
  2. A fused real-arithmetic kernel computes $\mathrm{Re},\hat{S}_x(\tau)$ and $\mathrm{Re},\partial_x \hat{S}_x(\tau)$ in one pass, sharing all sub-expressions ($\sin(\beta L)$, $\sin(\beta L/2)$, $1/\beta$, etc.).

Precision management is transparent. Eigenvalues shrink super-exponentially (at $c = 67$ the ground-state error reaches $10^{-168}$), so the published sweep threads 80–200 decimal digits of mpmath precision end-to-end (dps = 80 for the primary $c \leq 37$ cells; dps = 150 for the $c \in \{13, 17, 19\}$ retest; dps = 200 for $c \geq 41$). mpmath supports arbitrary precision beyond 200 digits; the paper notes that reaching $c \approx 97$ cleanly would require dps = 300, but such runs are not included in the published dataset.


Further reading

  • Our paper (computational study, 15 cutoffs, 113 OOM) — Groskin 2026, Zenodo DOI 10.5281/zenodo.19546514
  • CvS (mathematical foundation) — Connes & van Suijlekom, Quadratic forms, real zeros and echoes of the spectral action, arXiv:2511.23257
  • CCM (trigonometric-basis companion, $N=120$, 200-digit) — Connes, Consani & Moscovici, Zeta spectral triples, arXiv:2511.22755
  • Connes 2026 (context) — The Riemann Hypothesis: Past, Present and a Letter Through Time, arXiv:2602.04022

Citation

If you use this package in academic work, please cite both the software and the accompanying paper:

@software{connes_cvs_package,
  title   = {connes-cvs: First public implementation of the
             {C}onnes--van {S}uijlekom {G}alerkin matrix},
  author  = {Groskin, Akiva},
  year    = {2026},
  version = {0.2.0},
  url     = {https://github.com/akivag613/connes-cvs-},
  doi     = {10.5281/zenodo.19546514},
}

@article{groskin2026connes_cvs,
  title   = {Structural Properties of the {C}onnes--van {S}uijlekom
             Truncated {W}eil Minimizer: {S}obolev Scaling,
             Multi-Zero Universality, and {L}-Function Extension},
  author  = {Groskin, Akiva},
  year    = {2026},
  doi     = {10.5281/zenodo.19546514},
  url     = {https://doi.org/10.5281/zenodo.19546514},
}

Contributing

Issues and pull requests are welcome. See CONTRIBUTING.md for developer-setup instructions, the test-running protocol, and the bit-identicality contract any performance PR must respect. Version history is in CHANGELOG.md.


License

MIT License. Copyright (c) 2026 Akiva Groskin.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

connes_cvs-0.2.1.tar.gz (34.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

connes_cvs-0.2.1-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

Details for the file connes_cvs-0.2.1.tar.gz.

File metadata

  • Download URL: connes_cvs-0.2.1.tar.gz
  • Upload date:
  • Size: 34.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for connes_cvs-0.2.1.tar.gz
Algorithm Hash digest
SHA256 fa92542f58df5d254590ad0605d9c0afc8b00b04a9a54f44abb7bdb68f6fe8a0
MD5 af61e63b9e3a91834ac758c496d4efd9
BLAKE2b-256 06e45bdc01c301ea9f3137ac939ec0dedfbae255be09284842f33ed4131887a4

See more details on using hashes here.

File details

Details for the file connes_cvs-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: connes_cvs-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for connes_cvs-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ce50fd4007f19b52038c38e4ab3b7418bfe8a7afb5c4b4e216334fe98e12e153
MD5 5b6ffad9771c18161e6ab9e7d6a2cf85
BLAKE2b-256 634cc6cc503050e3b1079fd806fded60503e293940ffecf1911d87c89b5446d5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page