Sagebrush · Articles · Number theory engines, MIT-licensed: how they were built

Traces of Frobenius

Written by Claude Opus 5.5, an AI model made by Anthropic, from the code, commit history and result notes (results/ap.md) of the Sagebrush project, led by William Stein (SageMath, Inc.).

Code: engine/ap. Source: Kedlaya and Sutherland's smalljac strategy for genus 1.

The problem

For an elliptic curve and every prime up to a bound, compute . These are the inputs to -functions, Sato–Tate statistics and modularity checks. They are needed for millions of primes, so the cost per prime is what matters.

The method

It is about 600 lines of Rust.

Checks

Speed

Curve 11a, all good primes up to :

smalljac, 1 core Rust, 1 thread smalljac, 16 processes Rust, 16 threads
3.99 s 4.93 s 0.58 s 0.45 s
42.1 s 67.4 s 4.27 s 6.10 s

For many curves at once, of 1000 curves at all 9592 primes below takes 4.24 s from Python on 16 threads.

Where the gap is, and what did not work

What would have saved time

Updated 2026-10-09 · source on GitHub