The Sato–Tate law, live
A Beamer talk whose numbers, tables and plots Sage computes live: an elliptic curve's a_p against the Sato–Tate law, with an @interact.
number theoryslidesplotsinteractiveDownload (ZIP)Source on GitHub
Preview
talk.tex
% The Sato-Tate law, seen live: a short Beamer talk with Sage code, for Sagebrush's LaTeX editor.
% Press Run to compute everything in this browser, then Present; the last slide but one has a live @interact.
% MIT license.
\documentclass{beamer}
\usetheme{Madrid}
\usepackage{sagetex}
\title[The Sato--Tate law]{How are the $a_p$ of an elliptic curve distributed?}
\subtitle{The Sato--Tate law, computed live}
\author{Sagebrush}
\date{November 2026}
\begin{document}
\begin{sagesilent}
E = EllipticCurve('37a1')
B = 10000
def normalized(C, bound):
# x_p = a_p / (2 sqrt p) for the primes 3 <= p < bound where C has good reduction, sorted
N = C.conductor()
return sorted(float(C.ap(p)) / (2 * sqrt(float(p))) for p in prime_range(3, bound) if N % p)
def st_cdf():
# the Sato-Tate distribution function on [-1, 1]
return plot(1/2 + (x*sqrt(1 - x^2) + arcsin(x))/pi, (x, -1, 1), color='red', thickness=2)
def ecdf(xs):
# the fraction of the xs at or below each of them, the points joined by lines
return line([(t, (i + 1)/len(xs)) for i, t in enumerate(xs)], color='blue', figsize=[6, 3.4])
xs = normalized(E, B)
small = [p for p in prime_range(2, 30)]
counts = table([['$p$'] + small, [r'$\#E(\mathbb{F}_p)$'] + [p + 1 - E.ap(p) for p in small],
['$a_p$'] + [E.ap(p) for p in small]])
moments = table([(2*k, n(sum(t^(2*k) for t in xs)/len(xs), digits=3), catalan_number(k)/4^k) for k in [1, 2, 3]],
header_row=['$2k$', r'mean of $x_p^{2k}$', '$C_k/4^k$'])
\end{sagesilent}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}{An elliptic curve}
\[ E:\ y^2 + y = x^3 - x \]
\begin{itemize}
\item<2-> Conductor $N = \sage{E.conductor()}$, discriminant $\Delta = \sage{E.discriminant()}$.
\item<3-> $j$-invariant $j = \sage{E.j_invariant()}$, not an integer, so $E$ has no complex multiplication.
\item<4-> Rank $\sage{E.rank()}$: $E(\mathbb{Q})$ is infinite.
\end{itemize}
\end{frame}
\begin{frame}{Counting points modulo $p$}
For a prime $p \nmid N$, reduce $E$ modulo $p$ and count:
\[ \#E(\mathbb{F}_p) = p + 1 - a_p. \]
\pause
\begin{center}
\sage{counts}
\end{center}
\end{frame}
\begin{frame}{Hasse's bound}
Hasse (1936): \quad $|a_p| \le 2\sqrt{p}$, \quad so \quad $x_p = \dfrac{a_p}{2\sqrt{p}} \in [-1, 1]$.
\pause
\begin{center}
\sageplot[width=0.85\textwidth]{list_plot([(p, E.ap(p)/(2*sqrt(p))) for p in prime_range(3, 2000) if p != 37], size=4, figsize=[8, 3.2], ymin=-1.05, ymax=1.05)}
\end{center}
\pause
The points look random. Is there a law?
\end{frame}
\begin{frame}{The Sato--Tate law}
\begin{block}{Theorem (Sato--Tate, proved 2008--2011)}
If $E/\mathbb{Q}$ has no complex multiplication, the $x_p$ are equidistributed in $[-1, 1]$ with density
\[ \mu(x) = \frac{2}{\pi}\sqrt{1 - x^2}. \]
\end{block}
\pause
Writing $a_p = 2\sqrt{p}\cos\theta_p$, the angles $\theta_p \in [0, \pi]$ follow $\frac{2}{\pi}\sin^2\theta\,d\theta$.
\pause
\medskip
Proved by Clozel, Harris, Shepherd-Barron and Taylor when $j$ is not an integer, and by Barnet-Lamb,
Geraghty, Harris and Taylor for every curve without complex multiplication.
\end{frame}
\begin{frame}{Evidence: the moments}
The even moments of $\mu$ are $\displaystyle\int_{-1}^{1} x^{2k}\,\mu(x)\,dx = \frac{C_k}{4^k}$, with $C_k$ the Catalan numbers.
\pause
\medskip
For the $\sage{len(xs)}$ primes $p < \sage{B}$ with $p \nmid 2N$:
\begin{center}
\sage{moments}
\end{center}
\end{frame}
\begin{frame}{Evidence: the distribution function}
The fraction of the $x_p$ at most $t$ (blue, joining the sorted points), against the Sato--Tate distribution function (red)
\[ F(t) = \frac12 + \frac{t\sqrt{1 - t^2} + \arcsin t}{\pi}. \]
\begin{center}
\sageplot[width=0.6\textwidth]{ecdf(xs) + st_cdf()}
\end{center}
\end{frame}
\begin{frame}[fragile]{Complex multiplication is different}
\begin{sagesilent}
G = EllipticCurve('27a1')
ps = prime_range(5, B)
zeros = len([p for p in ps if G.ap(p) == 0])
\end{sagesilent}
$G:\ y^2 + y = x^3 - 7$ has $j = \sage{G.j_invariant()}$ and complex multiplication by $\mathbb{Q}(\sqrt{-3})$.
\pause
\medskip
For $p \equiv 2 \pmod 3$, $G$ is supersingular and $a_p = 0$: that is
$\sage{zeros}$ of the $\sage{len(ps)}$ primes $5 \le p < \sage{B}$, about half.
\pause
\medskip
So the $x_p$ of $G$ can't follow $\mu$: half of them sit at $0$.
\end{frame}
\begin{frame}[fragile]{Try it}
\begin{sagesilent}
@interact
def sato_tate(curve=selector(['11a1', '37a1', '389a1', '27a1', '32a1'], default='37a1'),
bound=slider([1000, 2000, 5000, 10000], default=2000)):
C = EllipticCurve(curve)
ys = normalized(C, bound)
print('{}: {} primes, mean of x_p^2 = {:.3f}'.format(curve, len(ys), sum(t^2 for t in ys)/len(ys)))
show(ecdf(ys) + st_cdf())
\end{sagesilent}
Pick a curve and a bound. The curves 27a1 and 32a1 have complex multiplication.
\end{frame}
\begin{frame}{References}
\small
\begin{itemize}
\item H.~Hasse, Zur Theorie der abstrakten elliptischen Funktionenk\"orper I--III, \emph{J.~reine angew.\ Math.}\ 175 (1936).
\item L.~Clozel, M.~Harris, R.~Taylor, Automorphy for some $\ell$-adic lifts of automorphic mod $\ell$ Galois representations, \emph{Publ.\ Math.\ IH\'ES} 108 (2008).
\item R.~Taylor, Automorphy for some $\ell$-adic lifts of automorphic mod $\ell$ Galois representations~II, \emph{Publ.\ Math.\ IH\'ES} 108 (2008).
\item M.~Harris, N.~Shepherd-Barron, R.~Taylor, A family of Calabi--Yau varieties and potential automorphy, \emph{Ann.\ of Math.}\ 171 (2010).
\item T.~Barnet-Lamb, D.~Geraghty, M.~Harris, R.~Taylor, A family of Calabi--Yau varieties and potential automorphy~II, \emph{Publ.\ RIMS} 47 (2011).
\item A.~V.~Sutherland, Sato--Tate distributions, \emph{Contemp.\ Math.}\ 740 (2019).
\end{itemize}
\end{frame}
\end{document}
Files
talk.tex(5904 bytes)