Class Numbers of Real Quadratic Fields: Extending Tables to
Abstract
We compute class numbers of real quadratic fields for all fundamental discriminants from to — 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 occurs with probability for real quadratic fields.
Background
Class Numbers
The class number of a number field measures the failure of unique factorization in its ring of integers. For the real quadratic field :
- means the ring (or ) has unique factorization
- means unique factorization fails, and the class group has non-trivial structure
The Analytic Class Number Formula
For a fundamental discriminant :
where:
- is the regulator (logarithm of the fundamental unit)
- is the Dirichlet -function
- is the Kronecker symbol
The regulator is computed from the continued fraction expansion of : the period of the CF gives the fundamental unit , and .
The Cohen-Lenstra Heuristics
Cohen and Lenstra (1984) proposed a remarkable probabilistic model for class groups. For real quadratic fields, they predict:
More generally, they predict the distribution of the odd part of the class group: an abelian group occurs with probability proportional to .
These heuristics have been tested computationally up to and agree beautifully, but more data at larger discriminants is needed to:
- Test whether the convergence continues
- Look for deviations that might reveal deeper structure
- Understand the distribution of large class numbers
Current Frontier
| Authors | Year | Range | Key Result |
|---|---|---|---|
| Jacobson, Ramachandran, Williams | 2006-2015 | Systematic class numbers via BSGS | |
| Watkins | 2004 | Imaginary quadratic, | Complete tables |
| Belabas, Cohen | Various | Cubic fields, | Limited 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
| Component | Specification |
|---|---|
| Node | NVIDIA DGX B200 |
| GPUs | 8× NVIDIA B200 (183 GB VRAM each) |
| Total VRAM | 1.43 TB |
| GPU Interconnect | NVLink 5 (NV18), full mesh |
| CPUs | 2× Intel Xeon Platinum 8570 |
| System RAM | 2 TB DDR5 |
Method
Per-Discriminant Computation
Each CUDA thread handles one discriminant :
- Check fundamentality: Verify is a fundamental discriminant (squarefree conditions on )
- Compute regulator: Run the continued fraction expansion of until the period is found, extract the fundamental unit , compute
- Approximate : Sum the Dirichlet series with terms
- Extract : Round to the nearest integer
Kronecker Symbol
The Kronecker symbol is computed via quadratic reciprocity (Jacobi symbol algorithm) in steps — fast enough for the per-thread L-function summation.
Parallelization
8 GPUs, each handling a contiguous range of discriminants from to .
Results
PENDING — experiment not yet run.
Class Number Distribution
| Count | Fraction | Cohen-Lenstra prediction | |
|---|---|---|---|
| 1 | PENDING | PENDING | |
| 2 | PENDING | PENDING | PENDING |
| 3 | PENDING | PENDING | PENDING |
| 4 | PENDING | PENDING | PENDING |
| PENDING | PENDING | PENDING |
Convergence of Cohen-Lenstra
| Range | Observed fraction | C-L prediction | Ratio |
|---|---|---|---|
| ~75.4% (known) | 75.446% | ~1.000 | |
| PENDING | 75.446% | PENDING | |
| PENDING | 75.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.