File size: 1,179 Bytes
7ec6a18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
license: mit
tags:
  - kernels
  - cuda
  - class-numbers
  - real-quadratic-fields
  - number-theory
  - cohen-lenstra
datasets:
  - cahlen/class-numbers-real-quadratic
---

# Class Numbers of Real Quadratic Fields

Computes class numbers h(d) for fundamental discriminants d using continued fraction regulator + Euler product L(1, chi_d).

## Usage

```python
import torch
from kernels import get_kernel

kernel = get_kernel("cahlen/class-numbers-cuda")
result = class_numbers.compute(discriminants)
```

## Compile (standalone)

```bash
nvcc -O3 -arch=sm_90 -o class_numbers class_numbers/class_numbers_v2.cu -lm
```

## Results

All computation results are open:
- **Website**: [bigcompute.science](https://bigcompute.science)
- **Datasets**: [huggingface.co/cahlen](https://huggingface.co/cahlen)
- **Source**: [github.com/cahlen/idontknow](https://github.com/cahlen/idontknow)

## Citation

```bibtex
@misc{humphreys2026bigcompute,
  author = {Humphreys, Cahlen},
  title = {bigcompute.science: GPU-Accelerated Computational Mathematics},
  year = {2026},
  url = {https://bigcompute.science}
}
```

*Human-AI collaborative. Not peer-reviewed. All code and data open.*