by cahlen in-progress

Hardware

8× NVIDIA B200 (183 GB VRAM each, 1.43 TB total) 2× Intel Xeon Platinum 8570 (112 cores / 224 threads) 2 TB DDR5 RAM
algebraic-number-theoryclass-groupscohen-lenstra-heuristics b200dgxnvlink cuda-kernelbsgscontinued-fractionsl-functions

Key Results

Class Numbers of Real Quadratic Fields: Extending Tables to 101310^{13}

Abstract

We compute class numbers h(d)h(d) of real quadratic fields Q(d)\mathbb{Q}(\sqrt{d}) for all fundamental discriminants dd from 101110^{11} to 101310^{13} — a 100× extension of existing systematic tables. Each discriminant is handled by an independent CUDA thread using the analytic class number formula combined with continued-fraction computation of the regulator. The resulting dataset tests the Cohen-Lenstra heuristics at unprecedented scale, specifically the prediction that h(d)=1h(d) = 1 occurs with probability 75.446%\approx 75.446\% for real quadratic fields.

Background

Class Numbers

The class number h(K)h(K) of a number field KK measures the failure of unique factorization in its ring of integers. For the real quadratic field Q(d)\mathbb{Q}(\sqrt{d}):

  • h(d)=1h(d) = 1 means the ring Z[1+d2]\mathbb{Z}[\frac{1+\sqrt{d}}{2}] (or Z[d]\mathbb{Z}[\sqrt{d}]) has unique factorization
  • h(d)>1h(d) > 1 means unique factorization fails, and the class group has non-trivial structure

The Analytic Class Number Formula

For a fundamental discriminant d>0d > 0:

h(d)R(d)=d2L(1,χd)h(d) \cdot R(d) = \frac{\sqrt{d}}{2} \cdot L(1, \chi_d)

where:

  • R(d)=logεdR(d) = \log \varepsilon_d is the regulator (logarithm of the fundamental unit)
  • L(1,χd)=n=1χd(n)nL(1, \chi_d) = \sum_{n=1}^{\infty} \frac{\chi_d(n)}{n} is the Dirichlet LL-function
  • χd(n)=(dn)\chi_d(n) = \left(\frac{d}{n}\right) is the Kronecker symbol

The regulator is computed from the continued fraction expansion of d\sqrt{d}: the period of the CF gives the fundamental unit εd\varepsilon_d, and R(d)=logεdR(d) = \log \varepsilon_d.

The Cohen-Lenstra Heuristics

Cohen and Lenstra (1984) proposed a remarkable probabilistic model for class groups. For real quadratic fields, they predict:

Prob(h(d)=1)=p prime(11p)(11p2)0.75446\text{Prob}(h(d) = 1) = \prod_{p \text{ prime}} \left(1 - \frac{1}{p}\right)\left(1 - \frac{1}{p^2}\right) \approx 0.75446

More generally, they predict the distribution of the odd part of the class group: an abelian group GG occurs with probability proportional to 1/Aut(G)1/|\text{Aut}(G)|.

These heuristics have been tested computationally up to d1011d \sim 10^{11} and agree beautifully, but more data at larger discriminants is needed to:

  1. Test whether the convergence continues
  2. Look for deviations that might reveal deeper structure
  3. Understand the distribution of large class numbers

Current Frontier

AuthorsYearRangeKey Result
Jacobson, Ramachandran, Williams2006-2015d1011d \leq 10^{11}Systematic class numbers via BSGS
Watkins2004Imaginary quadratic, d1010d \leq 10^{10}Complete tables
Belabas, CohenVariousCubic fields, d107d \leq 10^7Limited by algorithm complexity

No systematic GPU-accelerated computation exists. The BSGS algorithm is embarrassingly parallel — each discriminant is independent — making it ideal for GPU acceleration.

Hardware

ComponentSpecification
NodeNVIDIA DGX B200
GPUs8× NVIDIA B200 (183 GB VRAM each)
Total VRAM1.43 TB
GPU InterconnectNVLink 5 (NV18), full mesh
CPUs2× Intel Xeon Platinum 8570
System RAM2 TB DDR5

Method

Per-Discriminant Computation

Each CUDA thread handles one discriminant dd:

  1. Check fundamentality: Verify dd is a fundamental discriminant (squarefree conditions on dmod4d \bmod 4)
  2. Compute regulator: Run the continued fraction expansion of d\sqrt{d} until the period is found, extract the fundamental unit εd\varepsilon_d, compute R(d)=logεdR(d) = \log \varepsilon_d
  3. Approximate L(1,χd)L(1, \chi_d): Sum the Dirichlet series nNχd(n)/n\sum_{n \leq N} \chi_d(n)/n with N=O(d)N = O(\sqrt{d}) terms
  4. Extract h(d)h(d): Round dL(1,χd)2R(d)\frac{\sqrt{d} \cdot L(1,\chi_d)}{2 R(d)} to the nearest integer

Kronecker Symbol

The Kronecker symbol (dn)\left(\frac{d}{n}\right) is computed via quadratic reciprocity (Jacobi symbol algorithm) in O(logn)O(\log n) steps — fast enough for the per-thread L-function summation.

Parallelization

8 GPUs, each handling a contiguous range of discriminants from 101110^{11} to 101310^{13}.

Results

PENDING — experiment not yet run.

Class Number Distribution

hhCountFractionCohen-Lenstra prediction
1PENDINGPENDING75.446%\approx 75.446\%
2PENDINGPENDINGPENDING
3PENDINGPENDINGPENDING
4PENDINGPENDINGPENDING
5\geq 5PENDINGPENDINGPENDING

Convergence of Cohen-Lenstra

RangeObserved h=1h=1 fractionC-L predictionRatio
d1011d \leq 10^{11}~75.4% (known)75.446%~1.000
1011<d101210^{11} < d \leq 10^{12}PENDING75.446%PENDING
1012<d101310^{12} < d \leq 10^{13}PENDING75.446%PENDING

Reproducibility

git clone https://github.com/cahlen/idontknow
cd idontknow
nvcc -O3 -arch=sm_100a -o class_number_rqf scripts/experiments/class-numbers/class_number_rqf.cu -lm

# Quick test: d = 5 to 10000
./class_number_rqf 5 10000

# Full run: extend to 10^13
./scripts/experiments/class-numbers/run.sh

Computed on NVIDIA DGX B200. Code: github.com/cahlen/idontknow.