## Abstract

Let *q* be an odd prime power, and denote the set of square-free monic polynomials *D*(*x*)∈*F*_{q}[*x*] of degree *d*. Katz and Sarnak showed that the moments, over , of the zeta functions associated to the curves *y*^{2}=*D*(*x*), evaluated at the central point, tend, as , to the moments of characteristic polynomials, evaluated at the central point, of matrices in *USp*(2⌊(*d*−1)/2⌋). Using techniques that were originally developed for studying moments of *L*-functions over number fields, Andrade and Keating conjectured an asymptotic formula for the moments for *q* fixed and . We provide theoretical and numerical evidence in favour of their conjecture. In some cases, we are able to work out exact formulae for the moments and use these to precisely determine the size of the remainder term in the predicted moments.

## 1. Introduction

In this paper, we provide theoretical and numerical evidence in support of a conjecture of Andrade and Keating regarding the moments, at the central point, of zeta functions associated to hyperelliptic curves over finite fields of odd characteristic.

Relevant background on these zeta functions is provided in this section. Section 2 describes the Andrade–Keating conjecture. We present numerical support for the conjecture in §3 and describe the algorithms used in §9.

In §§5 and 6, we apply old work of Birch [1] to obtain formulae for all the positive integer moments when *d*=3 or 4. We are also able, for 5≤*d*≤9, to use our data to guess formulae for a few specific moments (for example, the first three moments when *d*=7). These are presented in §7.

We then derive, in §8, series expansions for Andrade and Keating's conjectured formula. By comparing with the actual moments, derived or guessed, we can precisely determine in certain cases the remainder term in Andrade and Keating's formula for the moments.

### (a) Zeta functions of quadratic function fields according to Artin

Let *q* be an odd prime power, and be a square-free monic polynomial of positive degree *d*. Artin [2] developed the theory of quadratic function fields in analogy to that of Dedekind for quadratic number fields. Let *R* be the ring
1.1

Inspired by Dedekind's work on algebraic number fields, Artin [2] established that all non-zero proper ideals of *R* can be uniquely factored into prime ideals [3]. He further proved that every prime ideal of *R* divides some unique ideal 〈*P*〉 of *R*, where *P* is an irreducible polynomial in , and furthermore obtained the decomposition law
1.2
In the first case, explicitly: , , where *B*(*x*)^{2}=*D*(*x*) mod *P*(*x*); in the second case and in the third case, . Artin thus defined, for , and *P* irreducible, the ‘Legendre symbol’
1.3
One can extend it, multiplicatively, to non-irreducible polynomials, in analogy with the Jacobi symbol. Let , *b*(*x*)≠0, monic and *b*(*x*)=*Q*_{1}(*x*)^{α1}…*Q*_{r}(*x*)^{αr} be the unique factorization in , of *b*(*x*) into monic irreducible polynomials. Then define
1.4
Artin proved the law of quadratic reciprocity for , relatively prime, non-zero and monic
where .

For ease of notation, we define, for ,
1.5
for *n*≠0, and 0 for *n*=0. Artin defined the zeta function associated to *R* to be
1.6
where the sum is over non-zero ideals of *R*, and , the absolute norm of the ideal , denotes the number of residue classes . Artin also obtained the meromorphic continuation of *ζ*_{R}(*s*) to (see (1.8)–(1.12)) and its functional equation (see §1b).

Note, that the absolute norm is completely multiplicative, , for any ideals of *R*. Unique factorization of into prime ideals gives the Euler product
1.7
We can account for each ideal of *R* by considering the irreducible polynomial that sits below it. Now, in *R*, we have because there are choices for *a*(*x*) and *b*(*x*) modulo *P*(*x*) in (1.1). Thus, the decomposition of 〈*P*〉 into prime ideals given in (1.2) yields if or , and if .

We can use the Legendre symbol to correctly account for each local factor
1.8
Here, runs over all monic irreducible polynomials and . When *χ*_{D}(*P*)=1 this accounts for the two prime ideals that *P* sits below, each of norm . When *χ*_{D}(*P*)=0 there is just a single of norm . And when *χ*_{D}(*P*)=−1 the two factors involving *P* combine to give the correct norm of .

Artin proved that *ζ*_{R}(*s*) is a rational function of *q*^{−s}. We denote the first Euler product by . It can be expressed in closed form by unique factorization in
1.9
The second equality follows from unique factorization, the third equality gathers *n*'s according to their degree (there are *q*^{r} monic polynomials of degree *r* in ), and the last equality is the sum of the stated geometric series.

Letting
1.10
one can collect together the terms *n* of given degree and get
1.11
Artin used quadratic reciprocity to show that
1.12
so that *L*(*s*,*χ*_{D}) is a polynomial in *q*^{−s} of degree ≤*d*−1, and in fact of degree *d*−1 by means of the functional equation, also proved by Artin, described below.

To prove (1.12), one can use the fact that the sum of (*n*|*D*) over a complete set of residue classes *n* modulo *D* is 0. Note that on applying quadratic reciprocity, each *χ*_{D}(*n*)=±(*n*|*D*). For fixed *D* and fixed , with *n* monic, each application of quadratic reciprocity has, by (1.5), the same ±1 factor. And, when *r*≥*d*, *n* runs over *q*^{r−d} copies of a complete set of residue classes modulo *D*, which can be seen by writing *n*=*g*(*x*)*D*(*x*)+*h*(*x*), with or *h*=0, and , *g* monic.

### (b) Functional and ‘approximate’ functional equations

Artin also derived the functional equation for *L*(*s*,*χ*_{D}). It plays an important role in Andrade and Keating's heuristics leading to their moment conjecture, and also in allowing us to reduce the complexity of determining the zeta function associated to quadratic function fields.

In order to describe it, we let *X*_{D}(*s*)=|*D*|^{1/2−s}*X*(*s*), where
1.13
Then
1.14
The function *X*(*s*) plays the same role as the ratio of Gamma factors, , where , that appears in the functional equation of Dirichlet *L*-functions.

Note that in the case *d* is even, *L*(*s*,*χ*_{D}) has a trivial zero at *s*=0. If one defines the ‘completed’ *L*-function, *L**(*s*,*χ*_{D}) by
1.15
then *L** is a polynomial in *q*^{−s} of even degree
1.16
and satisfies the functional equation
1.17
Because *L* and *L** are polynomials in *u*=*q*^{−s}, it is convenient to define
1.18
so that the above functional equation reads
1.19
Notice that this gives a relationship between the coefficients of (and hence of *L**):
1.20
Comparing coefficients yields
1.21
thus
1.22

When *d* is odd, so that *L*=*L**, then, returning to (1.10), we have
1.23
in analogy to the approximate functional equation of Dirichlet *L*-functions, though, here, the approximate functional equation is an identity with no correction terms. The advantage of the approximate functional equation is that it only involves terms with . This alone represents a large savings, since the number of monic polynomials *n* of degree *r* equals *q*^{r}, so that the total number of *n* involved is , rather than (*q*^{2g+1}−1)/(*q*−1) in (1.23), i.e. *roughly* |*D*|^{1/2} terms compared with approximately |*D*| terms in (1.11).

The approximate functional equation in the case that *d* is even involves extra corrections terms. We define so that, when *d* is even, . Letting
1.24
we have
1.25
Hence, *a*(0)=*b*(0), *a*(1)=*b*(1)−*b*(0), *a*(2)=*b*(2)−*b*(0),…,*a*(2*g*)=*b*(2*g*)−*b*(2*g*−1), *a*(2*g*+1)=−*b*(2*g*). Summing, gives
1.26
The extra factor of (1−*u*) complicates, slightly, the approximate functional equation. Substituting (1.26) into (1.22), rearranging the resulting double sum and summing the geometric series, we obtain
1.27
Thus, multiplying by 1−*u*,
1.28
so that, for *d* even,
1.29
Hence in the *d* even case, the approximate functional equation has a remainder term, expressed in the second line above. Note that one can also express the remainder term using the coefficients and .

### (c) Hyperelliptic curves according to Schmidt and Weil

Another point of view is obtained by considering the related hyperelliptic curve *C*:*y*^{2}=*D*(*x*) over . One can define the zeta function associated to *C* as the function
1.30
where *N*_{r}(*C*) counts the number of points, including points at infinity, on the curve *C* over the field . When *d* is odd there is one point at infinity on the curve and when *d* is even there are two
1.31
We can express *N*_{r}(*C*) in terms of the Legendre symbol on : For , let
1.32
Then
1.33
since there are two solutions in to *y*^{2}=*D*(*x*) when *D*(*x*) is a square (and non- zero), one solution if *D*(*x*)=0, and none otherwise.

For given *D*, we define *a*_{qr}=*a*_{qr}(*D*) to be
1.34

One can show that *Z*_{C} and *ζ*_{R} are related
1.35
so that
1.36
Weil [4] proved the Riemann Hypothesis for *Z*_{C}: that its zeros lie on the circle |*u*|=*q*^{−1/2} (equivalently, that the zeros of *L**(*s*,*χ*_{D}) lie on ). Thus, we may write
1.37
with |*α*_{j}|=*q*^{1/2}. Taking the logarithm of (1.30) and (1.36), using (1.37), and equating coefficients of their Maclaurin series gives
1.38

In more generality, Schmidt [5] obtained the rationality and functional equation of the zeta function associated to any non-singular curve over , and Weil established its Riemann hypothesis.

One can express the coefficients of *L* or *L** in terms of the *a*_{qr}'s. Substituting (1.34) into (1.36), we get
1.39
On Taylor expanding the series on the r.h.s. above, and also using relationship (1.21), we get table 1 for the polynomials , for *d*≤7:

### (d) The hyperelliptic ensemble

We define to be the set of square-free monic polynomials of degree *d* in . The number of elements of is given by
1.40
This can be proven by considering the coefficient of *q*^{−ds} for .

We will also need the following formula for the number, *i*_{n}(*q*), of monic irreducible polynomials in of degree *n*≥1:
1.41
where *μ* is the traditional Möbius function. This can be obtained by grouping together, in (1.9), polynomials *P* according to their degree, so that . Taking the logarithmic derivative with respect to *s*, expanding the geometric series on both sides, and comparing coefficients of *q*^{−ns}, gives
1.42
Möbius inversion then yields (1.41).

## 2. Moments of zeta functions over the hyperelliptic ensemble

Let *k* be a positive integer. Katz & Sarnak [6,7] proved that
2.1
where 2*g*=*d*−1 or *d*−2 depending on whether *d* is odd or even, and d*A* is Haar measure on *USp*(2*g*) normalized so that , see eqn (40) and the discussion above eqn (41) in [7]. The statement of their result is given for a general class function on *USp*(2*g*), and their interest was in the statistics of zeros of zeta functions. However, one can take, in their eqn (40), for the class function, a power of the characteristic polynomial.

One can give precise formulae for the integral on the r.h.s. above. Keating & Snaith [8] used the Selberg integral to derive 2.2 This formula has the advantage of being expressed very concisely and explicitly.

Conrey *et al.* gave, in [9], another formula, as a *k*-fold contour integral
2.3
where the contours of integration enclose the origin,
2.4
is a Vandermonde determinant, and
2.5
While much more complicated than (2.2), this form is the one for which analogous formulae for the moments of have been developed, for number fields [9,10,11] and in the function field setting [12,13].

### (a) Andrade–Keating conjectures

Andrade and Keating have given a conjecture for the asymptotic behaviour of the moments of , averaged over . While they restricted their discussion to the case that *d* is odd, it is straight-forward to adapt their analysis to include even *d*. For the reader's convenience, we repeat below the definition of *X*(*s*) given earlier in (1.13).

### Conjecture 2.1 (Andrade–Keating)

Let *q* be an odd prime power, and *d* a positive integer. Define
2.6

Andrade & Keating [12] conjectured the following asymptotic expansion. For *q* fixed, and ,
2.7
where *Q*_{k}(*q*;*d*) is the polynomial of degree *k*(*k*+1)/2 in *d*, with coefficients that depend on *k* and *q*, given by the *k*–fold residue
2.8
where
2.9
and is the Euler product, absolutely convergent for , defined by
2.10

### Remarks

(1) The above conjecture is the function field analogue of conjecture 1.5.3 in [9] for the moments of quadratic Dirichlet *L*-functions in the number field setting.

(2) If we substitute , then for *d*=2*g*+1 or *d*=2*g*+2,
2.11
where
2.12

Letting , we have that, *Q*_{k}(*q*;*d*) tends to as expressed on the r.h.s. of (2.3), consistent with the theorem of Katz and Sarnak.

(3) When *d* is odd, *k*=1, and *q*≡1 mod 4, Andrade & Keating [14] proved
2.13
where
2.14
This is consistent with the conjecture since, when *d* is odd,
2.15
The above formula is analogous to the formula obtained by Jutila [15] for the first moment, in the number field setting, of .

We would like to point out that Hoffstein & Rosen [16] have obtained formulae for the first moment, as , averaging over *all* , and also for square-free *D*(*x*), not necessarily monic. In the latter case, they did not explicitly determine a certain coefficient in their formula. In principle, their method should produce a sharper remainder term than (2.13). The second to fourth moments, as , again averaged over *all* , have been considered, by Chinta & Gunnels [17,18] and Bucur & Diaconu [19]. Square-free averages seem harder to get a handle on, and, for the purpose of testing Andrade and Keating's conjecture we require square-free averages.

## 3. Numerical data

We first present numerical evidence in support of the Andrade–Keating conjecture. We have numerically computed the moments *M*_{k}(*q*,*d*), and compared them with Andrade and Keating's *Q*_{k}(*q*,*d*) for *k*≤10, *d*≤18, and for odd prime powers *q* specified below:

In addition to these values, we also computed moments for a few large values of *q*, when *d*=3, such as *q*=10009. Later, we discovered formulae for the moments when *d*=3, and *d*=4, so that one can directly evaluate the moments in those cases quite easily using theorems 5.1 and 6.1. Our data will be made available on lmfdb.org [20].

We display a selection of data, in tables 2–20 for the pairs *q*,*d*: 10009,3; 729,3; 491,4; 343,4; 81,5; 73,5; 49,6; 23,7; 17,8; 9,9; 9,10; 5,11; 5,12; 5,13; 3,14; 3,15; 3,16; 3,17; 3,18.

For *k*≤10, and the above pairs of *q*,*d*, we list the difference and ratio between the actual moments *M*_{k}(*q*,*d*), and the Andrade–Keating value *Q*_{k}(*q*,*d*). The conjectured value *Q*_{k}(*q*,*d*) nicely fits the actual data *M*_{k}(*q*,*d*), spectacularly well in some cases.

The sheer number, *q*^{d}−*q*^{d−1}, of polynomials makes it prohibitive to compute the moments *M*_{k}(*q*,*d*) for *d* large, at least if we do so one *D* at a time. One can slightly reduce the amount of computation for the moments by taking advantage of the fact that many *D* have the same zeta functions, see §4. The largest value of *d* for which we determined moments was *d*=18 and *q*=3.

Our data support Andrade and Keating's conjecture in the sense that, for given *q* (size of field), and *k*, the ratio between the actual moment *M*_{k}(*q*,*d*) and their prediction *Q*_{k}(*q*,*d*) does appear to tend to 1 as *d* grows.

It seems quite difficult to determine, theoretically, the rate at which it approaches 1 as . However, while Andrade and Keating made their prediction for given *k* and *q*, and , we have had some success in determining the size of the remainder term for given *k* and *d*, letting *q* grow. We describe our findings below.

A natural quantity with which to measure the remainder term in the Andrade–Keating prediction is
3.1
It is roughly the number of terms, , being summed in the moment *M*_{k}(*q*,*d*).

For any given value of *d* and *k*, our data suggest that, as (i.e. as since, now, *d* is fixed), there is a constant *μ*(=*μ*(*k*,*d*)), depending on *d* and *k*, such that
3.2
with the implied constants in the *Θ* depending on *k* and *d*. As remarked earlier, *Q*_{k}(*q*,*d*) converges, as , to (2.3). Thus, for given *k* and *d*, *Q*_{k}(*q*,*d*) is bounded as ; hence, the above can be written as
3.3

In §§5–8, we are able to determine (conditionally, for *d*>4) the values of *μ* displayed in table 21, for a selection of *d*≤9 and *k*=1,2,3.

Interestingly, when *d*=3, the *k*=2,3 predictions fit better ( in both cases) than the *k*=1 prediction (*μ*=1), with a similar feature for *d*=5, and *k*=2 (*μ*=1) in comparison with *k*=1 ().

The *d*=6 entry for *k*=3 is missing because we did not have enough data to determine it. The formulae for even values of *d* seem to involve powers of 1/*q*^{1/2}, as compared with 1/*q* for odd values of *d*, and hence more terms.

One might ask about the behaviour of *μ* if we fix *k* and allow *d* to grow. For example, if we fix *k*=1 and let *d* grow, is it true that . This would be in analogy with the conjectured remainder term in the first moment (*k*=1) of quadratic Dirichlet *L*-functions [10]. Is there a term of size *X*^{−1/4} that eventually (for *d* sufficiently large) enters when *k*=3, as predicted in the number field setting by Diaconu and colleagues [21,10]?

If we fix *d* and allow *k* to grow, it appears that *μ* is not as impressive. For example, we show in §5, for *d*=3 and any *k*≥10, that (we restrict in that section to *q* prime). In §6 we prove, for *d*=4 and any *k*≥9, that (again with *q* restricted to being prime).

## 4. Isomorphic hyperelliptic curves

We took advantage, in tabulating zeta functions, and also in deriving the formulae described below in §§5 and 6, of the fact that the same zeta functions in arise repeatedly.

For , let us denote its coefficients as *c*_{n}=*c*_{n}(*D*):
4.1
If is non-zero, i.e. if *p*, the characteristic of *F*_{q} does not divide *d*, then, on binomial expanding and rearranging the resulting double sum
4.2
We can choose *u*=−*d*^{−1}*c*_{d−1} so as to make the coefficient of *x*^{d−1} equal to zero. Furthermore, *D*(*x*) is square-free if and only if *D*(*x*+*u*) is square-free.

Thus, for , let denote the set
4.3
Thus, in the case that , the set can be partitioned into *q* subsets of equal size, each one obtained from by a change of variable *x*→*x*−*u*, .

For example, in the case that *d*=3 and is not of characteristic 3, each is expressed as *x*^{3}+*Ax*+*B*, with . When *d*=3, the square-free condition is equivalent *D*(*x*) not having a repeated root in .

If we let , and , then their associated zeta functions are equal, because both have the same point counts over any as we may pair up points on *y*^{2}=*D*(*x*) with points (*x*+*u*,*y*) on *y*^{2}=*D*_{2}(*x*).

Therefore, for , we can write 4.4

There are yet additional isomorphisms, though we did not exploit these in our work. Given (or ), consider, for , the polynomial (resp. ). If *a*^{d} is a square (and non-zero) in (if *d* is even, or if *a* is itself a square), then the hyperelliptic curves *y*^{2}=*D*(*x*) and *y*^{2}=*a*^{d}*D*(*a*^{−1}*x*)=*x*^{d}+*ac*_{d−1}*x*^{d−1}+*a*^{2}*c*_{d−2}*x*^{d−2}+⋯*a*^{d} have the same number of solutions over any . This can be seen by pairing up (*x*,*y*) on the first curve with , where denotes either square root of *a*^{d} in , on the second curve.

## 5. Moment formulae when *d*=3

In this section we assume that *d*=3, and the characteristic of *F*_{q} is not 3, so that each is of the form *D*(*x*)=*x*^{3}+*Ax*+*B*, we have that
5.1
where
5.2
Thus,
5.3
Now the odd moments of *a*_{q} are all equal to 0
5.4
That is because may can pair up each *D*(*x*) that produces a given value of *a*_{q}=*a*_{q}(*D*(*x*)), with another curve that produces . This can be achieved as follows. Let *a* be a non-square in . Let . Then
5.5
the last equality holding because , and because *a*^{−1}*x* runs over all of as *x* does.

Birch [1] used the Selberg trace formula to determine the even moments of *a*_{q}(*D*(*x*)) for the set of *all* *D*(*x*)=*x*^{3}+*Ax*+*B*, with , i.e. without the square-free condition. He restricted to *q*=*p*, i.e. prime fields, with *p*>3. Thus, for the remainder of this section, we restrict to *q*=*p*>3, as well.

For *j* even, Birch defines
5.6
and obtains a formula for *S*_{j/2}(*p*):
5.7
where tr_{2l}(*T*_{n}) is the trace of the Hecke operator *T*_{n} acting on the space of cusp forms of weight 2*l* for the full modular group, i.e. acting on :
5.8
where *f* runs over the eigenfunctions of the all the Hecke operators, and where λ_{f}(*n*) are their Fourier coefficients, normalized so that λ(1)=1.

The term tr_{2l+2}(*T*_{p}) first contributes to *S*_{j/2}(*p*) when *j*=10, because for 2*l*+2=2,4,6,8,10, whereas tr_{12}(*T*_{p})=*τ*(*p*), the Ramanujan *τ* function.

Thus *S*_{1}(*p*),…,*S*_{4}(*p*) are polynomials in *p*, but the higher moments *S*_{5}(*p*),*S*_{6}(*p*),… can be expressed as polynomials in *p* and the coefficients of Hecke eigenforms.

We note that there is a typo in the example formulae of Birch's Theorem 2. His stated formulae for *S*_{1}(*p*),…,*S*_{5}(*p*) are all missing the factor of *p*−1, and should read: *S*_{1}(*p*)=(*p*−1)*p*^{2}, *S*_{2}(*p*)=(*p*−1)(2*p*^{3}−3*p*), *S*_{3}(*p*)=(*p*−1)(5*p*^{4}−9*p*^{2}−5*p*), *S*_{4}(*p*)=(*p*−1)(14*p*^{5}−28*p*^{3}−20*p*^{2}−7*p*), *S*_{5}(*p*)=(*p*−1)(42*p*^{6}−90*p*^{4}−75*p*^{3}−35*p*^{2}−9*p*−*τ*(*p*)),….

Now, Birch sums over all *A*,*B*∈*F*_{p}, whereas we are summing over square-free . If *x*^{3}+*Ax*+*B* is not square-free, we can write it as
5.9
for some . Comparing coefficients of *x*^{2} gives *t*=−2*s* mod *p*, hence *x*^{3}+*Ax*+*B*=(*x*+*s*)^{2}(*x*−2*s*), so that
5.10
For given , (*x*+*s*|*p*)^{2}=1, unless *x*=−*s*, in which case (*x*+*s*|*p*)^{2}=0. Thus,
5.11
the latter equality because the full sum of (*x*−2*s*|*p*) over all *x* mod *p* is 0. Thus, when *j* is even, *a*_{p}((*x*+*s*)^{2}(*x*−2*s*))^{j}=1, when *s*≠0 mod *p*, and equals 0 if *s*=0 mod *p*.

Therefore, we have shown that
5.12
Combining the above with (5.7) and (5.3) gives
5.13
Simplifying, and using
5.14
(this identity is derived in greater generality below) we have
5.15
Rearranging the sum over *j* and *l*, the right side above equals
5.16
Now, the inner sum over *j* equals
5.17
where _{2}*F*_{1}(*a*,*b*;*c*;*z*) is the Gauss hypergeometric function
5.18
One easily checks this by comparing, with *a*=*l*−*k*/2, , *c*=2*l*+2, each term in the above sum with the terms in the sum over *j* in (5.16). Note that, with this choice of *a* and *b*, the terms in the above series vanish if 2*n*>*k*−2*l*, and the hypergeometric series terminates.

Using Gauss' identity
5.19
we thus have, on simplifying,
5.20
Applying the Legendre duplication formula, we can simplify both the numerator (with *z*=*k*+1) and denominator (with ) to get
5.21
Returning to (5.15), we thus have the following theorem:

### Theorem 5.1

*Let p>3 be prime. Then*
5.22

The fact that our final formula for the moments (in the *d*=3 case) can be expressed so cleanly and succinctly suggests that an alternate point of view should exist that produces the same formula more directly. Indeed, A Diaconu & V Pasol (2014, personal communication) have derived an equivalent formula using multiple Dirichlet series over finite fields, though perhaps a simpler approach can be found.

We list the first 10 moments in table 22.

It appears, from our numerical data, that (5.22) also holds for , if *k*≤9, i.e. if we replace *p* with any odd prime power *q*, whether divisible by 3 or not. For *k*≥10, one would need to adjust the terms tr_{2l+2}(*T*_{p}). For example, for *k*=10, and *q*=*p*^{2}, it appears from our tables that one should replace *τ*(*p*) by 2*τ*(*p*^{2})−*τ*(*p*)^{2}. We do not attempt to address the general formula here since the above suffices for the purpose of testing the Andrade–Keating conjecture, which does not see the arithmetic terms tr_{2l+2}(*T*_{p}).

Note, for instance, that the Fourier coefficients λ(*p*) of a weight 2*l*+2 modular form satisfies the Ramanujan bound
5.23
Thus, for given *k*≥10, the terms tr_{2l+2}(*T*_{p}) contribute, overall, an amount to (5.22) that is *O*(*p*^{−1/2}). Furthermore, it is known that
5.24
Therefore, in the case *k*≥10, *d*=3 and *q* prime, we have , since, here, *X*=*p*^{3}, and *X*^{−1/6}=*p*^{−1/2}.

## 6. Moment formulae when *d*=4

Birch's formula can be applied to the case of *d*=4 as well, because there is a relationship between elliptic curves of degrees 3 and 4.

According to the table in 1*c*, the zeta function associated to *y*^{2}=*D*(*x*) over , for , equals (1−*u*)(1−(*a*_{q}−1)*u*+*qu*^{2}). Here *a*_{q}(*D*(*x*)) is defined by (1.34). Substituting *u*=*q*^{−1/2}, binomial expanding, and rearranging the resulting double sum, we have
6.1
where
6.2
The connection with the moments for *d*=3 is through the following relationship. Let
6.3
We prove, in theorem 6.2, that, for *q* an odd prime power, not divisible by 3, and for *j*≥0
6.4

Now, equation (5.12) gives, for prime *q*=*p*>3,
6.5
The extra factor of *p* compared with (5.12) is to account for the fact that here our sum is over rather than .

Thus, breaking the sum on the right side of (6.1) into even and odd terms *j*, we have, for *q*=*p*>3,
6.6
The first sum is precisely the sum that appears in (5.3), and (5.22) gives
6.7
Furthermore, substituting *j*=*ν*−1, the second sum equals
6.8
Using (6.5), as well as lemma 6.3 (below), and simplifying, the second sum becomes
6.9
Putting together (6.9) and (6.7), we arrive at the following theorem:

### Theorem 6.1

*Let p>3 be prime. Then,*
6.10

The above formula seems to hold (based on our tables), for *k*≤8, if we replace *p* by any odd prime power *q*. The Hecke eigenvalues enter starting with *k*=9.

Therefore, in the case *k*≥9, *d*=4 and *q* prime, we have , since, here, *X*=*p*^{4} and *X*^{−1/8}=*p*^{−1/2}. Expanding this formula, for *k*=1,2,3,4,5, and collecting powers of *p*, gives table 23.

### Theorem 6.2

*With m*_{3}*(q;j) and m*_{4}*(q;j) defined by (6.3) and (6.2), the relationship (6.4) holds for any odd prime power q not divisible by 3, and any j≥0.*

### Proof.

While the relationship in (6.4) involves sums over and , we establish the same relationship over the simpler , . One can then recover the original sums (6.3) and (6.2) by scaling both by a factor of *q*.

Thus, let . To the hyperelliptic curve specified by a quadratic equation of the form *E*_{4}:*y*^{2}=*x*^{4}+*Ax*^{2}+*Bx*+*C*, we can associate a cubic equation *E*_{3}:*Y* ^{2}=*X*^{3}+*αX*+*β*, where the two equations are related by the rational change of variables,
6.11
so that on substituting and simplifying
6.12
These can be verified by hand or, more easily, with the aid of a symbolic math package such as Maple. See Mordell [22, p. 77], where this change of variables is described, though with a slightly different normalization. We will use this association to establish the relationship specified in the statement of this lemma.

Note that, since we are in characteristic greater than 3, all coefficients appearing in the above two displays (e.g. ) are defined in . Also, the change of variable (6.11) can be inverted:
6.13
The points , satisfying *y*^{2}=*x*^{4}+*Ax*^{2}+*Bx*+*c* are in one-to-one correspondence with the points satisfying *Y* ^{2}=*X*^{3}+*αX*+*β*, with the exception of one point.

This exception arises from the denominator, *X*+*A*/6, in (6.11). If *X*=−*A*/6, then substituting into *Y* ^{2}=*X*^{3}+*αX*+*β*, with *α*,*β* given by (6.12), gives *Y* ^{2}=*B*^{2}/64, i.e. *Y* =±*B*/8. Thus, when *B*≠0, there are two points on *Y* ^{2}=*X*^{3}+*αX*+*β* with *X*=−*A*/6, namely (−*A*/6,±*B*/8). When *B*=0 there is just one point, (−*A*/6,0).

In the former case, the point (*X*,*Y*)=(−*A*/6,−*B*/8) does not have a corresponding point , but the point (−*A*/6,*B*/8) does, namely (*x*,*y*)=((*A*^{2}−4*C*)/(4*B*),(16*C*^{2}+8*AB*^{2}−8*A*^{2}*C*−*A*^{4})/(16*B*^{2})), obtained by substituting *X*=−*A*/6 into *y*=−*x*^{2}+2*X*−*A*/6, then substituting for *y* into *y*^{2}=*x*^{4}+*Ax*^{2}+*Bx*+*C* to get *x*, and finally back-substituting into *y*=−*x*^{2}+2*X*−*A*/6.

In the latter case, i.e. *B*=0, there is no point corresponding to (*X*,*Y*)=(−*A*/6,0). For, if there was, we would have, on substituting *y*=−*x*^{2}+2*X*−*A*/6=−*x*^{2}−*A*/2 into *y*^{2}=*x*^{4}+*Ax*^{2}+*C*, that *A*^{2}/4=*C*, so that *y*^{2}=*x*^{4}+*Ax*+*A*^{2}/4=(*x*^{2}+*A*/2)^{2}, violating the assumption that *x*^{4}+*Ax*+*Bx*+*C* is square-free.

Thus, we have shown that −*a*_{q}(*X*^{3}+*αX*+*β*)=1−*a*_{q}(*x*^{4}+*Ax*^{2}+*Bx*+*C*) (in terms of the point counting function, recalling (1.34), this gives *N*_{1}(*E*_{4})=*N*_{1}(*E*_{3}), though, below, we work just with *a*_{q}). This allows us to relate *m*_{4}(*q*;*j*) as expressed in (6.2) with *m*_{3}(*q*;*j*) as expressed in (6.3).

By carefully examining our tables of zeta functions, we also determined that it is important to pair curves according to their value of ±*a*_{q}(*X*^{3}+*αX*+*β*). Thus, fix *a* to be any non-square in . Given , we define its quadratic twist (depending on *a*), to be *X*^{3}+*a*^{2}*αX*+*a*^{3}*β*. As explained in §5, we have *a*_{q}(*X*^{3}+*a*^{2}*αX*+*a*^{3}*β*)=−*a*_{q}(*X*^{3}+*αX*+*β*).

Now, we can count the number of curves *y*^{2}=*x*^{4}+*Ax*^{2}+*Bx*+*C* that are associated to a given *y*^{2}=*X*^{3}+*αX*+*β* as follows. For any choice of , there is exactly one choice of such that −*C*/4−*A*^{2}/48=*α*.

For given *A* and *C*, there are either 0, 1 or 2 choices of such that *β*=*A*^{3}/864+*B*^{2}/64−*AC*/24, i.e. such that (*B*/8)^{2}=*β*−*A*^{3}/864+*AC*/24. More precisely, the number of such *B* is given by
6.14

Thus, the total number of of curves *y*^{2}=*x*^{4}+*Ax*^{2}+*Bx*+*C* that are associated under the above change of variable to a given *Y* ^{2}=*X*^{3}+*αX*+*β* is equal to
6.15
As already remarked, the above sum involves *q* pairs , since any choice of *A* determines *C*.

We will also need the number of *y*^{2}=*x*^{4}+*Ax*^{2}+*Bx*+*C* that are associated to the twisted curve *y*^{2}=*X*^{3}+*a*^{2}*αX*+*a*^{3}*β*:
6.16
As *A*,*C* run over the elements of , so do *a*^{2}*C* and *aA*. Thus, we can replace the condition in the last summand by −*a*^{2}*C*/4−*a*^{2}*A*^{2}/48=*a*^{2}*α*, i.e. by the same condition as in (6.15), −*C*/4−*A*^{2}/48=*α*. The above sum therefore equals
6.17
the latter equality because since we have chosen *a* to be a non-square in .

Summing (6.15) and (6.17), the number of curves *y*^{2}=*x*^{4}+*Ax*^{2}+*Bx*+*C* associated to either *Y* ^{2}=*X*^{3}+*αX*+*β* or to *y*^{2}=*X*^{3}+*a*^{2}*αX*+*a*^{3}*β* is given by
6.18
Thus 2*q* curves in are associated to each pair of curves *Y* ^{2}=*X*^{3}+*αX*+*β*, *y*^{2}=*X*^{3}+*a*^{2}*αX*+*a*^{3}*β* in , and all such curves have the same value of |1−*a*_{q}(*x*^{4}+*Ax*^{2}+*Bx*+*C*)|.

Special care is needed in the event that *Y* ^{2}=*X*^{3}+*αX*+*β* twists to itself, i.e. *a*^{2}*α*=*α* and *a*^{3}*β*=*β*. But, in that case, *a*_{q}(*X*^{3}+*αX*+*β*)=−*a*_{q}(*X*^{3}+*αX*+*β*), and thus equals 0, hence such polynomials contribute 0 to *m*_{3}(*q*;*j*), and their associated curves *y*^{2}=*x*^{4}+*Ax*^{2}+*Bx*+*C* contribute 0 to *m*_{4}(*q*;*j*), so we may ignore these.

Thus, the number of curves from with given ±*a*_{q} are in 1:*q* proportion with the number of curves from with the same *L*-functions. When *j* is even, each term in *m*_{3} and *m*_{4} appear with an even exponent, and all terms summed are positive. Hence
6.19

When *j* is odd, then
6.20
Here, we are considering the contribution to *m*_{4} from each particular value of *a*_{q}(*X*^{3}+*αX*+*β*). The factor of *q* outside the sums is to account for the fact that *m*_{4} is a sum over rather than . We run over all square-free , and also their twists *X*^{3}+*a*^{2}*αX*+*a*^{3}*β* (where, as before, *a* is any fixed non-square in ), that give rise to that particular value of ±*a*_{q}. For any such pair of curves in , we count how many *y*^{2}=*X*^{4}+*Ax*^{2}+*Bx*+*C* are associated to them using (6.15) and (6.17). Because *j* is odd, , thus resulting in (6.20) when the two are combined. The impact of running over curves and their twists (with *a*_{q}≠0) is to count each twice, hence the extra factors of 2 in front of both sides of (6.20).

Now, the inner sum equals −*a*_{q}(*X*^{3}+*αX*+*β*), as one can check by substituting *t*=−*A*/6, which runs over as *A* does, and −*C*/4=*α*+*A*^{2}/48=*α*+3*t*^{2}/4 into the summand. Thus, the inner sum in (6.20) equals
6.21
Simplifying thus gives, when *j* is odd,
6.22
which, by definition, equals *m*_{3}(*q*;*j*+1). ▪

### Lemma 6.3

6.23
*If* *l*=0, *we take the* *v*=0 *term to equal* 0.

### Proof.

The sum in the lemma can be expressed as
6.24
evaluated at *z*=1. Here (*a*)_{n}=*Γ*(*a*+*n*)/*Γ*(*a*)=*a*(*a*+1)…(*a*+*n*−1) (taken to be 1 if *n*=0). Other than the factor *l*+*n*, the sum over *n* is . The sum can be obtained by multiplying _{2}*F*_{1} by *z*^{l}, differentiating with respect to *z*, and then multiplying by *z*. Using
6.25
we can thus express the sum over *n* in (6.24) as
6.26
with *a*=*l*−*k*/2, and *c*=2*l*+2. Substituting *z*=1, and applying (5.19), we get
6.27
(we also used in simplifying). Substituting the right side into (6.24), simplifying, and using the Legendre duplication formula gives (6.23). ▪

## 7. Formulae suggested by our data, *d*≥5

We list here the formulae that one gets, experimentally, from interpolating (or guessing!) when possible, from our data.

When we did not have enough data to interpolate, we combined leading terms as derived from the Andrade–Keating conjecture with interpolation for the lower coefficients (also exploiting, via the Chinese remainder theorem, the observation that the coefficients seem to be integers). We left ourselves some leeway so that we could check our guess against at least one additional data point. We give the resulting formulae, for *d*=5, in table 24.

These formulae appear to hold for all prime powers *q*. For *k*>5 and *d*=5, presumably some extra arithmetic quantities enter, as they do for *k*>9 when *d*=3. In the case of *d*=5, the approach of A Diaconu & V Pasol (2014, personal communication) does appear to produce, with proof, a somewhat complicated formula for the moments involving traces of Hecke operators acting on Siegel cusp forms for certain congruence subgroups of . We have not attempted to put their formula in more concrete form. It would be a worthwhile project to do so, to provably produce and extend the above table of moment polynomials for *d*=5, and to better understand the contribution from the Hecke terms, presumably starting, when *d*=5, at *k*=6. We believe the Hecke terms enter at *k*=6 (when *d*=5) because we were not able to interpolate any polynomials in 1/*q* for *k*=6 in spite of having the moments for all *q*≤53 (19 data points).

The leading coefficients, 3,14,84,594,4719,…, are given by the Keating Snaith formula, with *g*=2 (so that *d*=2*g*+1=5). Interestingly, these leading coefficients also appear in the work of Kedlaya & Sutherland [23, table 4] as moments of traces in *USp*(2*g*), for *g*=2, and similarly for *g*=1 and the leading coefficients of table 22. This does not persist for *g*>2.

We display in tables 25–28 moment formulas guessed at from our data, for 6≤*d*≤9.

## 8. Series expansions for *Q*_{k}(*q*;*d*)

When *d* is odd,
8.1

When *d* is even,
8.2

Grouping *P*'s together according to their degree, and using formula (1.41) for the number of irreducible polynomials of given degree, we have, on expanding the above formulae in powers of 1/*q* or 1/*q*^{1/2}, that, for *d*=2*g*+1 odd, *k*=1:
8.3
and for *d*=2*g*+2 even, *k*=1:
8.4
Substituting *d*=1,2,3,…,9 into the above formulae yields table 29:

In table 29, we are displaying the terms that match with the actual moments from the previous sections.

### (a) Series expansions for *Q*_{k}(*q*;*d*) when *k*=2,3

We can work out expansions, analogous to (8.3) and (8.4) for additional values of *k*, and do so here for *k*=2,3.

We make use of the methods of Goulden *et al.* [11] to express the coefficients of the polynomials *Q*_{k}(*q*;*d*) more explicitly. To apply the formulae of [11], we first write *Q*_{k}(*q*;*d*) as a polynomial in 2*g* rather than in *d*. For given *q* and *k* let
8.5
Note that this actually defines two different polynomials, depending on whether *d*=2*g*+1 or *d*=2*g*+2, so that *c*_{r}(*q*;*k*) also depends (for *r*>0) on the parity of *d*. To avoid clutter, we suppress this dependence in our notation.

Define
8.6
In the last equality, we are simply grouping together factors according to the value of |*P*|=*q*^{n}.

The length of the partition λ is defined to be the number of non zero λ_{i}s. We denote it by *l*(λ). Given *α*=(*α*_{1},…,*α*_{n}), we write *u*^{α} to denote . Let λ be a partition of length less than or equal to *n*. If *n*≥*l*(λ), then
8.7
where the *α* ranges over distinct permutations of (λ_{1},…,λ_{n}). If *l*(λ)>*n*, then *m*_{λ}(*u*_{1},…,*u*_{n})=0. For the only partition of 0, the empty partition, we define *m*_{0}=1. Thus, for example,

Let
8.8
be the power series expansion of
8.9
where *H* is defined in (2.12). The double product above plays the role of cancelling the poles of in (2.12).

In (8.8), the sum is over all partitions λ_{1}+⋯+λ_{k}=*i*, with λ_{1}≥λ_{2}≥⋯λ_{k}≥0. We divide the expression by *a*_{k} to ensure that the constant term in the power series is 1.

Then
8.10
and, for *r*≥1,
8.11
where *N*_{λ}(*k*) is defined by
8.12
The above is obtained by substituting (8.8) into (2.11), changing variables, *u*_{j}=(2*g*)*z*_{j}/2, and taking care to borrow from , thus producing the factor displayed, .

In Goulden *et al.* [11], we obtained several formulae for *N*_{λ}(*k*) and also proved that it is a polynomial in *k* of degree at most 2|λ| (which is the reason why we pull out the factor To exploit the formulae obtained in that paper, we also regard *Q*_{k} as a polynomial in 2*g* rather than in *g*. A list of the polynomials *N*_{λ}(*k*), quoted from [12], is given in table 30.

In order to compute the multivariate Taylor expansion of (8.9), i.e. the coefficients *b*_{λ}(*k*), we consider the series expansion of its logarithm, since it is easier to deal with a sum than a product. Let
8.13
be the power series expansion of the logarithm of (8.9). We start the sum at *r*=1 because the division by *a*_{k} makes the constant term 0. Now, the l.h.s. is symmetric in the *u*_{i}'s, and we can find *B*_{λ}(*k*) by applying
8.14
where *l*=*l*(λ), and setting *u*_{1}=⋯=*u*_{k}=0. Since the partial derivatives do not involve *u*_{l+1},…,*u*_{k} we can set these to 0 before the differentiation.

Thus, *B*_{λ}(*k*) is equal to (8.14) applied to
8.15
evaluated at *u*_{1}=⋯=*u*_{l}=0.

Next, by composing the series expansions (8.13) with the series for the exponential function, we can derive formulae for the coefficients *b*_{λ}(*k*).

In this way, we computed the following series expansions, if *d*=2*g*+1 is odd:
8.16
and
8.17

Note that the terms that are independent of *q* (e.g. in *Q*_{2}(*q*;*d*)), match the right side of (2.2). This is explained by the fact that, as ,
8.18
and we recover the moments of unitary sympletic matrices as given in (2.3).

If *d*=2*g*+2 is even we have
8.19
and
8.20

Substituting *d*=1,…,7 into the above formulae for *Q*_{2}(*q*;*d*) gives table 31. For *Q*_{3}(*q*;*d*), this yields table 32.

Again, we are displaying the terms that match with the actual moments from §7. Letting *X*=*q*^{d}, the above expansions yield the values of *μ* presented in §3.

## 9. Algorithms used

To tabulate zeta functions, we first looped though all monic polynomials *D*(*x*) of given degree *d* in or , and, for each *D*, checked whether to determine if *D* is square-free. We then used the approximate functional equation described in §1*b* and quadratic reciprocity to determine each zeta functions for all (when ), or (when *p*|*d*), and the values of *d*,*q* listed in §3. We implemented our code in C++ using the flint package [24] for finite field arithmetic. However, this became prohibitive as , and each application of the approximate functional equation requiring roughly *q*^{g} evaluations of *χ*_{D}(*n*) via quadratic reciprocity.

After gathering some data in this fashion, we switched to using Magma's built-in routine for computing the zeta function of a hyperelliptic curve. It uses a combination of exponential point counting methods and Kedlaya's algorithm [25]. Let *q*=*p*^{n}. The latter algorithm runs in time *O*(*p*^{1+ϵ}*g*^{4+ϵ}*n*^{3+ϵ}), for any *ϵ*>0, with the implied constant depending on *ϵ*, see [26, Theorem 3.1].

The other computational aspect of testing the Andrade–Keating conjecture involved numerically evaluating the coefficients of the polynomials *Q*_{k}(*q*;*d*). While formula (2.11) can be used to evaluate a few coefficients *c*_{r}(*q*;*k*) of the polynomials *Q*_{k}(*q*;*d*), it is not well suited for computing all *k*(*k*+1)/2 coefficients, except when *k* is small. For example, we took (2.11) as our starting point in the previous section to work out, via (8.11), formulae for *Q*_{k}(*q*;*d*) for *k*=1,2,3. However, it is not feasible, to compute, in this manner, all 55 coefficients, *c*_{r}(*q*;*k*), when say, *k*=10, as this would involve expanding the integrand in a series of 10 variables using monomials of degree less than or equal to 55. Instead, we used a technique that was developed in the number field setting, see [27, §3] and [28, §4.2]. We summarize the method, as applied in our setting, below.

In [9, Lemma 2.5.2] plays a key role, and we first paraphrase the part we need.

### Lemma 9.1 (from [9])

*Suppose* *F* *is a symmetric function of* *k* *variables, regular near* (0,…,0), *and* *f*(*s*) *has a simple pole of residue* 1 *at* *s*=0 *and is otherwise analytic in a neighbourhood of* *s*=0, *and let*
9.1
*Assume* |*α*_{i}|≠|*α*_{j}| *if* *i*≠*j*. *Then, for sufficiently small* |*α*_{j}|,
9.2
*and where the path of integration encloses the* ±*α*_{j}'s.

Note that the poles of *K* from the product of *f*'s are cancelled by a portion of the factor . The condition that |*α*_{j}| be sufficiently small is needed to ensure that the numerator of the integrand in (9.2) is analytic in and on the contours.

To compute *c*_{r}(*q*;*k*) we do two things. First, we expand the exponential in (2.11) to get
9.3
Next, we view the above as the limiting case of (9.2), *α*_{j}→0, with
and evaluate it by summing the 2^{k} terms on the left side of (9.2). In practice, we took *a*_{j}=*j*10^{−65}. Now the terms being summed have poles of order *k*(*k*+1)/2 that cancel as we sum all the terms. One can see that they must cancel since the expression on the right side of (9.2) is analytic in a neighbourhood of *α*=0. Thus, to see our way through the enormous cancellation that takes place, we used, for example when *k*=10, thousands of digits of working precision.

One advantage here, over the number field setting, is that the arithmetic product *A*, defined in (2.10), as expressed in (2.12) (i.e. grouping together irreducible polynomials according to their degree *n*), converges very quickly. The relative remainder term in truncating the product over *n* in (2.12) at *n*≤*N*, is, for sufficiently small *u*_{j}, *O*(*q*^{−N−1+ϵ}), with the implied constant depending on *ϵ*. Thus, only a few hundred (for *q*=3) or handful (for *q*=10 009) of *n* were needed to achieve at least 30 digits precision for all *c*_{r}(*q*;*k*) that we computed.

## Funding statement

The first author was supported in part by an NSERC Discovery grant and EPSRC grant no. EPK0343831. The second author was supported by an NSERC USRA.

## Acknowledgements

We thank Julio Andrade, Adrian Diaconu, Jon Keating and Vicentiu Pasol for helpful feedback.

## Footnotes

One contribution of 8 to a Theo Murphy meeting issue ‘Number fields and function fields: coalescences, contrasts and emerging applications’.

- © 2015 The Author(s) Published by the Royal Society. All rights reserved.