This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Enumerating hyperelliptic curves
over finite fields in quasilinear time

Everett W. Howe Independent mathematician, San Diego, CA 92104, USA [email protected] http://ewhowe.com
(Date: 20 June 2024)
Abstract.

We present an algorithm that, for every fixed genus gg, will enumerate all hyperelliptic curves of genus gg over a finite field kk of odd characteristic in quasilinear time; that is, the time required for the algorithm is O~(q2g1)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{2g-1}), where q=#kq=\#k. Such an algorithm already exists in the case g=2g=2, thanks to work of Mestre and Cardona and Quer, and in the case g=3g=3, thanks to work of Lercier and Ritzenthaler. Experimentally, it appears that our new algorithm is about two orders of magnitude faster in practice than ones based on their work.

Key words and phrases:
Hyperelliptic curve, finite field
1991 Mathematics Subject Classification:
Primary 11G20; Secondary 11Y16, 14G15, 14H10, 14H25

1. Introduction

There are many circumstances in which one may want to enumerate all hyperelliptic curves of a given genus over a given finite field. One may wish to determine whether a hyperelliptic curve with certain special properties exists — for instance, with a certain number of points [14, p. 393], or a certain zeta function, or a certain aa-number [7, §4], or some other property of interest — and explicit enumeration allows for a direct search. Or perhaps one may wish to gather data about all hyperelliptic curves of a given genus over a given finite field — for example, in order to compute the distribution of the number of points on such curves, as in [1], or to determine experimental results [18] that can inspire future theorems [11].

In this paper we present, for every fixed genus g>1g>1, an algorithm to calculate a list of all hyperelliptic curves of genus gg over a given finite field of odd characteristic.111Hyperelliptic curves in characteristic 22 are different from those in other characteristics in some basic ways, and, as we discuss later, there already exists an efficient algorithm for enumerating them.

Theorem 1.1.

Fix an integer g>1.g>1. Together, the algorithms we present in Section 7 provide a method for computing a complete list of hyperelliptic curves of genus gg over 𝐅q{\mathbf{F}}_{q} for odd prime powers qq, with each curve appearing exactly once up to isomorphism. The algorithms take time O~(q2g1)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{2g-1}) and space O(q2g1)O(q^{2g-1}).

From [3, Proposition 7.1] and from the fact that a generic hyperelliptic curve has automorphism group of order 22, we see that there are roughly 2q2g12q^{2g-1} hyperelliptic curves of genus gg over 𝐅q{\mathbf{F}}_{q}, so our algorithm runs in quasilinear time.

We also present an apparently new explicit enumeration of all monic irreducible homogeneous bivariate quartics over a finite field kk of odd characteristic, up to the natural action of PGL2(k)\operatorname{PGL}_{2}(k) (see Section 2), which may be of independent interest.

Theorem 1.2.

Given an odd prime power qq, let γ\gamma be a nonzero element of 𝐅q4{\mathbf{F}}_{q^{4}} whose multiplicative order is 2(q21)2(q^{2}-1) and let ρ\rho be an element of 𝐅q2𝐅q{\mathbf{F}}_{q^{2}}\setminus{\mathbf{F}}_{q} with ρ2𝐅q\rho^{2}\in{\mathbf{F}}_{q}. Let S4S_{4} be the union of the two sets

{(γi1)/(γi+1)|i odd, 1i(q+1)/2}\bigl{\{}(\gamma^{i}-1)/(\gamma^{i}+1)\ |\ \text{$i$ odd},\ 1\leq i\leq(q+1)/2\bigr{\}}

and

{ρ(γi1)/(γi+1)|i odd, 1i(q1)/2}.\bigl{\{}\rho(\gamma^{i}-1)/(\gamma^{i}+1)\ |\ \text{$i$ odd},\ 1\leq i\leq(q-1)/2\bigr{\}}\,.

Then the homogenized minimal polynomials of the elements of S4S_{4} provide a complete set of unique representatives for the action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) on the monic irreducible homogeneous bivariate quartics over 𝐅q{\mathbf{F}}_{q} .

We prove this in Section 3. Also, here and elsewhere, when we say we have a “complete set of unique representatives” for an action of a group on a set, we mean that we have a set of orbit representatives that contains exactly one member from each orbit.

Briefly, there are two main ideas behind the algorithms that give us Theorem 1.1. The first is that there is an easy way to tell whether two irreducible homogeneous polynomials in 𝐅q[x,y]{\mathbf{F}}_{q}[x,y] lie in the same orbit under the action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) — see Theorem 4.2. We use this fact to reduce the problem of getting a list of all hyperelliptic curves without duplicates in quasilinear time to the problem of getting a list of hyperelliptic curves with a bounded number of duplicates in quasilinear time. The second is that if one understands the cosets of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) in PGL2(𝐅q2)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{2}}), and if one has a list of orbit representatives for PGL2(𝐅q2)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{2}}) acting on irreducible homogenous polynomials of degree nn in 𝐅q2[x,y]{\mathbf{F}}_{q^{2}}[x,y], then one can get a list of orbit representatives for PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) acting on irreducible homogenous polynomials of degree 2n2n in 𝐅q[x,y]{\mathbf{F}}_{q}[x,y] — see Section 7.4. The point of this observation is that the number of PGL2(𝐅q2)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{2}}) orbits of irreducible degree-nn polynomials over 𝐅q2{\mathbf{F}}_{q^{2}} is on the order of q2n6q^{2n-6}, while the number of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbits of degree-2n2n polynomials over 𝐅q{\mathbf{F}}_{q} is roughly q2n3q^{2n-3}, so the former is easier to compute than the latter.

The algorithm for enumerating hyperelliptic curves that we present is designed for simplicity of argument, rather than for efficiency of computation. In Section 8 we describe modifications that will make the algorithm more efficient, and in Section 9 we present even more details and timings for the case of genus 22 and genus 33.

An obvious issue with our algorithm, as we present it here, is that it requires O(q2g1)O(q^{2g-1}) space. This is because our initial computations often produce some duplicate entries, and we eliminate these duplicates by collecting all the output, computing some invariants, and then discarding entries whose invariants have already been seen. In a followup paper [9], we show how it is possible to modify the techniques presented here in order to get a quasilinear time algorithm for computing genus-gg hyperelliptic curves over 𝐅q{\mathbf{F}}_{q} that only requires O(logq)O(\log q) space. Our implementation of the genus-22 case of the algorithm from the present paper uses a basic version of the ideas from [9], and it would not be hard to modify the genus-22 code we provide in [10] so that it requires only O(q)O(q) space.

We start by considering various reductions, special cases, and lemmas. In Section 2 we show that enumerating hyperelliptic curves of genus gg over a finite field kk of odd characteristic can be reduced to enumerating Galois-stable sets of 2g+22g+2 elements of 𝐏1(k¯){\mathbf{P}}^{1}(\mathchoice{k\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm k}}$}}) up to the natural action of PGL2(k)\operatorname{PGL}_{2}(k). The rest of the paper is therefore concerned mostly with the latter problem, which we solve for all finite fields, not just those of odd characteristic. In Section 3 we prove Theorem 1.2, as well as similar results for quartics with one or two irreducible quadratic factors and generalizations to characteristic 22. In Section 4 we introduce an invariant for PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbits of monic irreducible homogeneous bivariate polynomials of degree n4n\geq 4 over 𝐅q{\mathbf{F}}_{q}, and we use it to provide a very straightforward algorithm for giving a complete set of unique representatives for these orbits in time O~(qn2)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{n-2}). In Sections 5 and 6 we give an explicit enumeration of a complete set of unique representatives for the cosets of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) in PGL2(𝐅qp)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{p}}) for primes pp. The case p=2p=2 is the key result needed for the most difficult case of our algorithm to enumerate hyperelliptic curves. In Section 7 we use the results of the earlier sections to present a collection of algorithms that, together, give a complete set of unique representatives for the PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbits of Galois stable sets of 2g+2{2g+2} elements of 𝐏1(𝐅¯q){\mathbf{P}}^{1}(\overline{{\mathbf{F}}}_{q}). We close with Sections 8 and 9, described above.

For many of our algorithms we require an easily computable total ordering of the elements of 𝐅q{\mathbf{F}}_{q} or of polynomials in 𝐅q[x]{\mathbf{F}}_{q}[x] or in 𝐅q[x,y]{\mathbf{F}}_{q}[x,y]. We will always denote such an ordering by “<<” and we leave the reader to choose their favorite one. Also, if the proof of a proposition is clear, we indicate that the proof will be skipped by including an end-of-proof mark in the statement of the result.

Acknowledgements

I am grateful to the referees for ANTS, who provided helpful feedback that improved this paper.

2. Hyperelliptic curves and Weierstrass points

We begin by setting some general notation. Given a finite field kk, let RR be the graded polynomial ring k[x,y]k[x,y], with the grading given by the degree. For each nn let RnR_{n} be the set of homogeneous polynomials in RR of degree nn and let RhomR_{\textup{hom}} be the union of the RnR_{n}. We say that fRhomf\in R_{\textup{hom}} is monic if f(x,1)f(x,1) is monic as a univariate polynomial, and we say that ff is separable if in k¯[x,y]\mathchoice{k\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm k}}$}}[x,y] it can be written as a constant times a product of distinct monic linear factors. We say that αk¯\alpha\in\mathchoice{k\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm k}}$}} is a root of ff if f(α,1)=0f(\alpha,1)=0, and that [α:β]𝐏1(k¯){[\alpha\,{:}\,\beta]}\in{\mathbf{P}}^{1}(\mathchoice{k\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm k}}$}}) is a zero of ff if f(α,β)=0f(\alpha,\beta)=0.

We also define a left action of PGL2(k)\operatorname{PGL}_{2}(k) on Rhom/k×R_{\textup{hom}}/k^{\times} as follows. If Γ\Gamma is an element of PGL2(k)\operatorname{PGL}_{2}(k) represented by a matrix M\colonequals[abcd]M\colonequals\bigl{[}\begin{smallmatrix}a&b\\ c&d\end{smallmatrix}\bigr{]} and if ff lies in RhomR_{\textup{hom}}, we define Γ(fmodk×)\Gamma(f\bmod k^{\times}) to be the class in Rhom/k×R_{\textup{hom}}/k^{\times} of f(dxby,cx+ay)f(dx-by,-cx+ay).

Every class of Rhom/k×R_{\textup{hom}}/k^{\times} contains a unique monic element, and we define an action of PGL2(k)\operatorname{PGL}_{2}(k) on the monic elements of RhomR_{\textup{hom}} by writing Γ(f)=g\Gamma(f)=g when gg is the monic element of Γ(fmodk×)\Gamma(f\bmod k^{\times}). If Γ\Gamma is represented by a matrix M\colonequals[abcd]M\colonequals\bigl{[}\begin{smallmatrix}a&b\\ c&d\end{smallmatrix}\bigr{]} and if Γ(f)=g\Gamma(f)=g, then f(dxby,cx+ay)=eg(x,y)f(dx-by,-cx+ay)=eg(x,y) for some ek×e\in k^{\times}, and if we choose a different matrix to represent Γ\Gamma, then the constant ee will be multiplied by an nnth power. When nn is even, the class of ee in k×/k×2k^{\times}/k^{\times 2} therefore depends only on Γ\Gamma, and we denote this square class by sΓ,fs_{\Gamma,f}.

Given a separable polynomial fRhomf\in R_{\textup{hom}}, we let Zeros(f)\operatorname{Zeros}(f) denote the set of zeros of ff in 𝐏1(k¯){\mathbf{P}}^{1}(\mathchoice{k\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm k}}$}}), so that Zeros(f)\operatorname{Zeros}(f) consists of the roots of ff under the usual inclusion k¯𝐏1(k¯)\mathchoice{k\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm k}}$}}\subset{\mathbf{P}}^{1}(\mathchoice{k\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm k}}$}}) given by α[α: 1]\alpha\mapsto{[\alpha\,{:}\,1]}, together with \colonequals[1: 0]𝐏1(k¯)\infty\colonequals{[1\,{:}\,0]}\in{\mathbf{P}}^{1}(\mathchoice{k\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm k}}$}}) if ff is divisible by yy. For every integer n0n\geq 0 we let Symn(k)\operatorname{Sym}^{n}(k) denote the set of all Galois-stable sets of nn distinct points in 𝐏1(k¯){\mathbf{P}}^{1}(\mathchoice{k\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm k}}$}}), so that the natural action of PGL2(k)\operatorname{PGL}_{2}(k) on 𝐏1(k¯){\mathbf{P}}^{1}(\mathchoice{k\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm k}}$}}) leads to an action of PGL2(k)\operatorname{PGL}_{2}(k) on Symn(k)\operatorname{Sym}^{n}(k). We see that Zeros\operatorname{Zeros} gives us a bijection between the set of monic separable polynomials in RnR_{n} and the set Symn(k)\operatorname{Sym}^{n}(k), and we check that Zeros(Γ(f))=Γ(Zeros(f))\operatorname{Zeros}(\Gamma(f))=\Gamma(\operatorname{Zeros}(f)) for all fRhomf\in R_{\textup{hom}}.

Our goal in this paper is to produce an algorithm to enumerate hyperelliptic curves of a given genus gg over finite fields kk of odd characteristic. As a first step, we reduce this problem to the problem of computing representatives for all PGL2(k)\operatorname{PGL}_{2}(k) orbits of Symn(k)\operatorname{Sym}^{n}(k), where n=2g+2n=2g+2.

Let kk be a finite field of odd characteristic and let CC be a hyperelliptic curve over kk, that is, a curve of genus g>1g>1 with a degree-22 map to a curve of genus 0. Every genus-0 curve over a finite field is isomorphic to 𝐏1{\mathbf{P}}^{1}, and since our kk has odd characteristic CC can be written in the form z2=f~z^{2}=\tilde{f}, where f~k[x]\tilde{f}\in k[x] is a separable polynomial of degree 2g+12g+1 or 2g+22g+2. We can rewrite this as a model z2=f(x,y)z^{2}=f(x,y) in weighted projective space by homogenizing f~\tilde{f} into a polynomial fR2g+2f\in R_{2g+2}; here we give the coordinates xx and yy weight 11 and the coordinate zz weight g+1g+1. Then the map [x:y:z][x:y]{[x\,{:}\,y\,{:}\,z]}\mapsto{[x\,{:}\,y]} gives the double cover C𝐏1C\to{\mathbf{P}}^{1}, and the points of 𝐏1{\mathbf{P}}^{1} that ramify in this map are exactly the elements of Zeros(f)\operatorname{Zeros}(f). If C1C_{1} and C2C_{2} are two hyperelliptic curves, given by equations z2=f1z^{2}=f_{1} and z2=f2z^{2}=f_{2}, then every isomorphism from C1C_{1} to C2C_{2} can be written in the form

[x:y:z][ax+by:cx+dy:ez],{[x\,{:}\,y\,{:}\,z]}\mapsto{[ax+by\,{:}\,{cx+dy}\,{:}\,ez]}\,,

where adbcad-bc and ee are nonzero, and where

(1) e2f1(x,y)=f2(ax+by,cx+dy);e^{2}f_{1}(x,y)=f_{2}(ax+by,cx+dy)\,;

see [17, Corollary 7.4.33]. Then e2f1(dxby,cx+ay)=(adbc)2g+2f2(x,y)e^{2}f_{1}(dx-by,-cx+ay)=(ad-bc)^{2g+2}f_{2}(x,y), so we see that f2modk×=Γ(f1modk×)f_{2}\bmod k^{\times}=\Gamma(f_{1}\bmod k^{\times}), where ΓPGL2(k)\Gamma\in\operatorname{PGL}_{2}(k) is the element represented by the matrix M\colonequals[abcd]M\colonequals\bigl{[}\begin{smallmatrix}a&b\\ c&d\end{smallmatrix}\bigr{]}. Thus, if C1C_{1} and C2C_{2} are isomorphic, the element Γ\Gamma of PGL2(k)\operatorname{PGL}_{2}(k) takes the ramification points of C1𝐏1C_{1}\to{\mathbf{P}}^{1} to the ramification points of C2𝐏1C_{2}\to{\mathbf{P}}^{1}. Conversely, if [abcd]PGL2(k)\bigl{[}\begin{smallmatrix}a&b\\ c&d\end{smallmatrix}\bigr{]}\in\operatorname{PGL}_{2}(k) takes the ramification points of C1𝐏1C_{1}\to{\mathbf{P}}^{1} to the ramification points of C2𝐏1C_{2}\to{\mathbf{P}}^{1}, then there is an ek¯e\in\mathchoice{k\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm k}}$}}, with e2ke^{2}\in k, that makes (1) hold. If ee lies in kk, we have an isomorphism between C1C_{1} and C2C_{2}; if ee does not lie in kk, we have an isomorphism between C1C_{1} and the quadratic twist of C2C_{2}, that is, the curve y2=νf2y^{2}=\nu f_{2}, where ν\nu is a nonsquare in kk. (In general, a twist of a curve CC over a finite field kk is another curve over kk that becomes isomorphic to CC when the base field is extended to an algebraic closure of kk. Twists of CC correspond to elements of the cohomology set H1(Gal(k¯/k),Autk¯C)H^{1}(\operatorname{Gal}(\mathchoice{k\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm k}}$}}/k),\operatorname{Aut}_{\mathchoice{k\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm k}}$}}}C) — see [21, §III.1.3] — and by “the quadratic twist” of a hyperelliptic curve we mean the twist corresponding to the cocycle that sends the Frobenius element of Gal(k¯/k)\operatorname{Gal}(\mathchoice{k\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm k}}$}}/k) to the hyperelliptic involution. Note that sometimes the quadratic twist may in fact be the trivial twist.)

Thus, we have a map from the set of isomorphism classes of genus-gg hyperelliptic curves over kk to the set of PGL2(k)\operatorname{PGL}_{2}(k) orbits of Symn(k)\operatorname{Sym}^{n}(k), where n=2g+2n=2g+2. This map is clearly surjective, and the PGL2(k)\operatorname{PGL}_{2}(k) orbit of an element AA of Symn(k)\operatorname{Sym}^{n}(k) has at most two preimages in the set of isomorphism classes of hyperelliptic curves: the isomorphism classes of y2=fy^{2}=f and of y2=νfy^{2}=\nu f, where ff is the unique monic polynomial with Zeros(f)=A\operatorname{Zeros}(f)=A and where ν\nu is a nonsquare in kk. (We say “at most two” preimages because, as we noted above, these two curves may be isomorphic to one another.)

Whether an element AA of Symn(k)\operatorname{Sym}^{n}(k) has one or two preimages is easy to determine: Let fRnf\in R_{n} be the unique monic polynomial with Zeros(f)=A\operatorname{Zeros}(f)=A. Compute all elements Γ\Gamma of PGL2(k)\operatorname{PGL}_{2}(k) that take the set AA to itself; at worst this takes time O(n(n1)(n2)){O(n(n-1)(n-2))}, and since nn is fixed in our context, this is O(1)O(1) operations. For each such Γ\Gamma compute the element sΓ,fs_{\Gamma,f} of k×/k×2k^{\times}/k^{\times 2}. If any of these elements is nontrivial, then the curve y2=fy^{2}=f is isomorphic to its twist y2=νfy^{2}=\nu f. (Compare to [20, Lemma 1.2].)

This shows that if we can compute a complete set of unique representatives for the orbits of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) acting on Sym2g+2(𝐅q)\operatorname{Sym}^{2g+2}({\mathbf{F}}_{q}) in time O~(q2g1)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{2g-1}), we can also compute a complete set of unique representatives for the hyperelliptic curves of genus gg over 𝐅q{\mathbf{F}}_{q} in time O~(q2g1)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{2g-1}). Thus, for the rest of this paper we focus on enumerating the PGL2(k)\operatorname{PGL}_{2}(k) orbits of Symn(k)\operatorname{Sym}^{n}(k), for n=2g+2n=2g+2. In particular, for our application to enumerating hyperelliptic curves we only need to consider even nn that are at least 66. The algorithms that we present for the latter problem work for all finite fields, not just those of odd characteristic.

Remark 2.1.

Over a finite field 𝐅q{\mathbf{F}}_{q} of characteristic 22 there are still roughly 2q2g12q^{2g-1} hyperelliptic curves of genus gg, but it is much easier to enumerate them in quasilinear time than it is in odd characteristic, because the ramification divisor of the hyperelliptic structure map C𝐏1C\to{\mathbf{P}}^{1} is supported on at most g+1g+1 points. Enumerating the possible ramification divisors up to the action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) in time O~(q2g1)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{2g-1}) is therefore much simpler than in odd characteristic, and enumerating the curves with a given ramification divisor is relatively straightforward. The algorithm of Xarles [24] follows this outline; it has been implemented by him in genus 44, by Dragutinović [6] in genus 55, and by Huang, Kedlaya, and Lau [12] in genus 66.

3. Results for quartic polynomials

In this section we prove Theorem 1.2. We also prove similar results that give complete sets of unique representatives for the action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) on monic homogeneous quartics that have one or two irreducible quadratic factors, and we state generalizations to finite fields of characteristic 22. We begin with an elementary lemma.

Lemma 3.1.

Let kk be a field and let aa, bb, cc, and dd be distinct elements of 𝐏1(k){\mathbf{P}}^{1}(k). Then there is a unique element of PGL2(k)\operatorname{PGL}_{2}(k) that swaps aa with bb and cc with dd, and this element is an involution.

Proof.

An element of PGL2(k)\operatorname{PGL}_{2}(k) is determined by where it sends three distinct elements of 𝐏1(k){\mathbf{P}}^{1}(k), so the uniqueness is automatic, and we need only prove existence. By using the action of PGL2(k)\operatorname{PGL}_{2}(k), we see that it suffices to prove the lemma in the case where a=a=\infty, b=0b=0, and c=1c=1. Then the element [0d10]\bigl{[}\begin{smallmatrix}0&d\\ 1&0\end{smallmatrix}\bigr{]} of PGL2(k)\operatorname{PGL}_{2}(k) is an involution that swaps aa with bb and cc with dd. ∎

Corollary 3.2.

Let qq be a prime power and let α\alpha, β\beta, γ\gamma, and δ\delta be distinct elements of 𝐅¯q\overline{{\mathbf{F}}}_{q} such that {{α,β},{γ,δ}}={{αq,βq},{γq,δq}}.\{\{\alpha,\beta\},\{\gamma,\delta\}\}=\{\{\alpha^{q},\beta^{q}\},\{\gamma^{q},\delta^{q}\}\}\,. Then there is a unique element of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) that swaps α\alpha with β\beta and γ\gamma with δ\delta, and this element is an involution.

Proof.

Let ΓPGL2(𝐅¯q)\Gamma\in\operatorname{PGL}_{2}(\overline{{\mathbf{F}}}_{q}) be the involution that swaps α\alpha with β\beta and γ\gamma with δ\delta. Then Γ(q)\Gamma^{(q)}, by which we mean the element of PGL2(𝐅¯q)\operatorname{PGL}_{2}(\overline{{\mathbf{F}}}_{q}) obtained by taking a representative matrix for Γ\Gamma and replacing all of its entries by their qqth powers, is also an involution that swaps α\alpha with β\beta and γ\gamma with δ\delta, because of the equality of sets in our hypothesis. By the uniqueness property in Lemma 3.1, it follows that Γ(q)=Γ\Gamma^{(q)}=\Gamma in PGL2(𝐅¯q)\operatorname{PGL}_{2}(\overline{{\mathbf{F}}}_{q}), from which we see that Γ\Gamma actually lies in PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}). ∎

Proof of Theorem 1.2.

First we show that every monic irreducible quartic in 𝐅q[x]{\mathbf{F}}_{q}[x] can be transformed into one of the quartics in the statement of the theorem; this is equivalent to showing that every irreducible quartic has a root in 𝐅q4{\mathbf{F}}_{q^{4}} that can be moved by PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) to an element of the set S4S_{4} from the theorem.

In the statement of the theorem we chose an element ρ\rho of 𝐅q2𝐅q{\mathbf{F}}_{q^{2}}\setminus{\mathbf{F}}_{q} with ρ2𝐅q\rho^{2}\in{\mathbf{F}}_{q}. Let ν=ρ2\nu=\rho^{2}, so that ν\nu is a nonsquare in 𝐅q{\mathbf{F}}_{q}.

Let ff be an irreducible quartic in 𝐅q[x]{\mathbf{F}}_{q}[x], let α\alpha be a root of ff in 𝐅q4{\mathbf{F}}_{q^{4}}, and set α1\colonequalsα\alpha_{1}\colonequals\alpha, α2\colonequalsα1q\alpha_{2}\colonequals\alpha_{1}^{q}, α3\colonequalsα2q\alpha_{3}\colonequals\alpha_{2}^{q}, and α4\colonequalsα3q\alpha_{4}\colonequals\alpha_{3}^{q}. By Corollary 3.2 there is a unique involution Γ\Gamma in PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) that swaps α1\alpha_{1} with α3\alpha_{3} and α2\alpha_{2} with α4\alpha_{4}. We refer to this as the involution associated to ff.

Let Φ\Phi be an element of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}). Then the involution associated to Φ(f)\Phi(f) is ΦΓΦ1\Phi\Gamma\Phi^{-1}. Since every involution in PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) is conjugate either to [0110]\bigl{[}\begin{smallmatrix}0&1\\ 1&0\end{smallmatrix}\bigr{]} or [0ν10]\bigl{[}\begin{smallmatrix}0&\nu\\ 1&0\end{smallmatrix}\bigr{]}, we can choose Φ\Phi so that ΦΓΦ1\Phi\Gamma\Phi^{-1} is one of these two standard involutions. Now we replace ff with Φ(f)\Phi(f), α\alpha with Φ(α)\Phi(\alpha), and Γ\Gamma with ΦΓΦ1\Phi\Gamma\Phi^{-1}.

Suppose Γ=[0110]\Gamma=\bigl{[}\begin{smallmatrix}0&1\\ 1&0\end{smallmatrix}\bigr{]}. The subgroup of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) that stabilizes Γ\Gamma under conjugation is

H1\colonequals{[abba]|a2b2}{[abba]|a2b2}.H_{1}\colonequals\Biggl{\{}\begin{bmatrix}a&b\\ b&a\end{bmatrix}\ \bigg{|}\ a^{2}\neq b^{2}\Biggr{\}}\cup\Biggl{\{}\begin{bmatrix}-a&-b\\ \phantom{-}b&\phantom{-}a\end{bmatrix}\ \bigg{|}\ a^{2}\neq b^{2}\Biggr{\}}\,.

We would like to apply an element of H1H_{1} to α\alpha, and if necessary replace α\alpha with one of its conjugates, to put α\alpha into a standard form. We accomplish this by considering the function 𝐏1(𝐅q4)𝐏1(𝐅q4){\mathbf{P}}^{1}({\mathbf{F}}_{q^{4}})\to{\mathbf{P}}^{1}({\mathbf{F}}_{q^{4}}) given by applying the element Ψ\colonequals[1111]\Psi\colonequals\bigl{[}\begin{smallmatrix}\phantom{-}1&1\\ -1&1\end{smallmatrix}\bigr{]} of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}). Since Ψ\Psi conjugates Γ\Gamma to the involution [1001]\bigl{[}\begin{smallmatrix}-1&0\\ \phantom{-}0&1\end{smallmatrix}\bigr{]}, we see that Ψ(α)q2=Ψ(α){\Psi(\alpha)^{q^{2}}=-\Psi(\alpha)}. This shows that Ψ(α)q21=1\Psi(\alpha)^{q^{2}-1}=-1, so the multiplicative order of Ψ(α)\Psi(\alpha) is even and divides 2(q21)2(q^{2}-1). It follows that we may write Ψ(α)=γi\Psi(\alpha)=\gamma^{i} for some odd integer ii with 0<i<2(q21)0<i<2(q^{2}-1).

Let

H1\colonequalsΨH1Ψ1={[a001]|a𝐅q×}{[0a10]|a𝐅q×}.H_{1}^{\prime}\colonequals\Psi H_{1}\Psi^{-1}=\Biggl{\{}\begin{bmatrix}a&0\\ 0&1\end{bmatrix}\ \bigg{|}\ a\in{\mathbf{F}}_{q}^{\times}\Biggr{\}}\cup\Biggl{\{}\begin{bmatrix}0&a\\ 1&0\end{bmatrix}\ \bigg{|}\ a\in{\mathbf{F}}_{q}^{\times}\Biggr{\}}\,.

Then applying an element of H1H_{1} to α\alpha corresponds to applying an element of H1H_{1}^{\prime} to Ψ(α)\Psi(\alpha), and the elements of H1H_{1}^{\prime} either multiply Ψ(α)\Psi(\alpha) by an element of 𝐅q×{\mathbf{F}}_{q}^{\times} or replace Ψ(α)\Psi(\alpha) with its inverse times an element of 𝐅q×{\mathbf{F}}_{q}^{\times}. Since the elements of 𝐅q×{\mathbf{F}}_{q}^{\times} are the powers of γ2(q+1)\gamma^{2(q+1)}, these two actions show that there is a ΦH1\Phi^{\prime}\in H_{1}^{\prime} such that Φ(Ψ(α))=γi\Phi^{\prime}(\Psi(\alpha))=\gamma^{i} for an odd integer ii with 0<i<q+10<i<q+1. If we let Φ=Ψ1ΦΨH1\Phi=\Psi^{-1}\Phi^{\prime}\Psi\in H_{1} and replace α\alpha with Φ(α)\Phi(\alpha), we find that Ψ(α)=γi\Psi(\alpha)=\gamma^{i} for this ii.

Finally, replacing α\alpha with αq\alpha^{q} has the effect of replacing ii with iqiq. If we write i=2h+1i=2h+1 we see that

iq2hq+q2h+q(2h+1)+(q+1)q+1imod2(q+1),iq\equiv 2hq+q\equiv-2h+q\equiv-(2h+1)+(q+1)\equiv q+1-i\bmod 2(q+1)\,,

so by replacing α\alpha with its conjugate αq\alpha^{q}, if necessary, and then modifying the new α\alpha by an element of H1H_{1}, we find that we may assume that 0<i(q+1)/20<i\leq(q+1)/2.

We see that every irreducible quartic whose associated involution is [0110]\bigl{[}\begin{smallmatrix}0&1\\ 1&0\end{smallmatrix}\bigr{]} has a root in the PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbit of Ψ1(γi)=(γi1)/(γi+1)\Psi^{-1}(\gamma^{i})=(\gamma^{i}-1)/(\gamma^{i}+1), for some odd ii with 0<i(q+1)/20<i\leq(q+1)/2. Moreover, from our analysis it is clear that different values of ii in this range produce quartics in distinct PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbits.

Next, suppose the involution associated with a quartic ff is Γ=[0ν10]\Gamma=\bigl{[}\begin{smallmatrix}0&\nu\\ 1&0\end{smallmatrix}\bigr{]}. The subgroup of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) that stabilizes Γ\Gamma under conjugation is

Hν\colonequals{[abνba]|a2νb2}{[abνba]|a2νb2}.H_{\nu}\colonequals\Biggl{\{}\begin{bmatrix}a&b\nu\\ b&a\end{bmatrix}\ \bigg{|}\ a^{2}\neq\nu b^{2}\Biggr{\}}\cup\Biggl{\{}\begin{bmatrix}-a&-b\nu\\ \phantom{-}b&\phantom{-}a\end{bmatrix}\ \bigg{|}\ a^{2}\neq\nu b^{2}\Biggr{\}}\,.

As before, we would like to apply an element of HνH_{\nu} to α\alpha, and if necessary replace α\alpha with one of its conjugates, to put α\alpha into a standard form. This time we consider the function 𝐏1(𝐅q4)𝐏1(𝐅q4){\mathbf{P}}^{1}({\mathbf{F}}_{q^{4}})\to{\mathbf{P}}^{1}({\mathbf{F}}_{q^{4}}) given by applying the element Ψ\colonequals[1ρ1ρ]\Psi\colonequals\bigl{[}\begin{smallmatrix}\phantom{-}1&\rho\\ -1&\rho\end{smallmatrix}\bigr{]} of PGL2(𝐅q2)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{2}}), where ρ\rho is the element of 𝐅q2{\mathbf{F}}_{q^{2}} chosen in the statement of the theorem and ν=ρ2\nu=\rho^{2}. Then Ψ\Psi conjugates Γ\Gamma to the involution [1001]\bigl{[}\begin{smallmatrix}-1&0\\ \phantom{-}0&1\end{smallmatrix}\bigr{]}, and once again we have Ψ(α)q2=Ψ(α)\Psi(\alpha)^{q^{2}}=-\Psi(\alpha). As before, we see that Ψ(α)q21=1\Psi(\alpha)^{q^{2}-1}=-1, so Ψ(α)\Psi(\alpha) has multiplicative order dividing 2(q21)2(q^{2}-1). Once again we may write Ψ(α)=γi\Psi(\alpha)=\gamma^{i} for some odd integer ii with 0<i<2(q21)0<i<2(q^{2}-1).

Let Hν\colonequalsΨHνΨ1H_{\nu}^{\prime}\colonequals\Psi H_{\nu}\Psi^{-1} and let NN be the kernel of the norm map from 𝐅q2×{\mathbf{F}}_{q^{2}}^{\times} to 𝐅q×{\mathbf{F}}_{q}^{\times}. We check that

Hν={[a001]|aN}{[0a10]|aN}.H_{\nu}^{\prime}=\Biggl{\{}\begin{bmatrix}a&0\\ 0&1\end{bmatrix}\ \bigg{|}\ a\in N\Biggr{\}}\cup\Biggl{\{}\begin{bmatrix}0&a\\ 1&0\end{bmatrix}\ \bigg{|}\ a\in N\Biggr{\}}\,.

Then applying an element of HνH_{\nu} to α\alpha corresponds to applying an element of HνH_{\nu}^{\prime} to Ψ(α)\Psi(\alpha), and the elements of HνH_{\nu}^{\prime} either multiply Ψ(α)\Psi(\alpha) by an element of NN or replace Ψ(α)\Psi(\alpha) with its inverse times an element of NN.

The elements of NN are the powers of γ2(q1)\gamma^{2(q-1)}, so arguing as before we find that we may replace α\alpha with Φ(α)\Phi(\alpha) for some ΦHν\Phi\in H_{\nu} so that Ψ(α)=γi\Psi(\alpha)=\gamma^{i} for an odd ii with 0<i<q10<i<q-1. We check that Ψ(αq)=1/Ψ(α)q\Psi(\alpha^{q})=1/\Psi(\alpha)^{q}, so replacing α\alpha with αq\alpha^{q} has the effect of replacing ii with iq-iq. If we write i=2h1i=2h-1 we see that

iq2hq+q2h+q(2h+1)+(q1)q1imod2(q1),-iq\equiv-2hq+q\equiv-2h+q\equiv(-2h+1)+(q-1)\equiv q-1-i\bmod 2(q-1)\,,

so by replacing α\alpha with its conjugate αq\alpha^{q}, if necessary, we find that we may assume that 0<i(q1)/20<i\leq(q-1)/2.

We see that every irreducible quartic whose associated involution is [0ν10]\bigl{[}\begin{smallmatrix}0&\nu\\ 1&0\end{smallmatrix}\bigr{]} has a root in the PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbit of Ψ1(γi)=ρ(γi1)/(γi+1)\Psi^{-1}(\gamma^{i})=\rho(\gamma^{i}-1)/(\gamma^{i}+1), for some odd ii with 0<i(q1)/20<i\leq(q-1)/2, and different values of ii in this range give irreducible quartics that are not equivalent to one another under the action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}). ∎

Remark 3.3.

For a separable quartic f=x4+ax3y+bx2y2+cxy3+dy4f=x^{4}+ax^{3}y+bx^{2}y^{2}+cxy^{3}+dy^{4}, we let j(f)j(f) denote the jj-invariant of the Jacobian of the genus-0 curve z2=fz^{2}=f. One can show that j(f)=256(b23ac+12d)3/Δj(f)=256(b^{2}-3ac+12d)^{3}/\Delta, where Δ\Delta is the discriminant of ff, and clearly j(Γ(f))=j(f)j(\Gamma(f))=j(f) for all ΓPGL2(𝐅q)\Gamma\in\operatorname{PGL}_{2}({\mathbf{F}}_{q}), because the curve z2=Γ(f)z^{2}=\Gamma(f) is geometrically isomorphic to z2=fz^{2}=f. Using arguments from [8, §3], one can show that jj takes different values on irreducible quartics that are not in the same PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbit.

For products of two distinct irreducible quadratics, we have a similar result.

Theorem 3.4.

Given an odd prime power qq, let ζ\zeta be a generator of 𝐅q2×{\mathbf{F}}_{q^{2}}^{\times}, let ρ\rho be an element of 𝐅q2𝐅q{\mathbf{F}}_{q^{2}}\setminus{\mathbf{F}}_{q} with ρ2𝐅q\rho^{2}\in{\mathbf{F}}_{q}, and let ν=ρ2\nu=\rho^{2}. Let

S22={ρ(ζi1)/(ζi+1)| 0<i(q1)/2}S_{22}=\{\rho(\zeta^{i}-1)/(\zeta^{i}+1)\ |\ 0<i\leq(q-1)/2\}

and let T22T_{22} be the set of homogenized minimal polynomials of the elements of S22S_{22}. Then the set {(x2νy2)g|gT22}\{(x^{2}-\nu y^{2})g\ |\ g\in T_{22}\} is a complete set of unique representatives for the action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) on the homogeneous quartics that factor into a product of two distinct monic irreducible quadratics.

Proof.

Let ff be a homogeneous quartic that factors into a product of two monic irreducible quadratics, so that the roots of ff are α\alpha, α¯\mathchoice{\alpha\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm\alpha}}$}}{\alpha\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm\alpha}}$}}{\alpha\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm\alpha}}$}}{\alpha\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm\alpha}}$}}, β\beta, and β¯\mathchoice{\beta\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm\beta}}$}}{\beta\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm\beta}}$}}{\beta\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm\beta}}$}}{\beta\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm\beta}}$}}, for two elements α\alpha and β\beta in 𝐅q2{\mathbf{F}}_{q^{2}} with conjugates α¯\mathchoice{\alpha\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm\alpha}}$}}{\alpha\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm\alpha}}$}}{\alpha\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm\alpha}}$}}{\alpha\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm\alpha}}$}} and β¯\mathchoice{\beta\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm\beta}}$}}{\beta\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm\beta}}$}}{\beta\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm\beta}}$}}{\beta\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm\beta}}$}}. We will show that there is a unique element σ\sigma in S22S_{22} such that the set {α,α¯,β,β¯}\{\alpha,\mathchoice{\alpha\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm\alpha}}$}}{\alpha\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm\alpha}}$}}{\alpha\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm\alpha}}$}}{\alpha\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm\alpha}}$}},\beta,\mathchoice{\beta\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm\beta}}$}}{\beta\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm\beta}}$}}{\beta\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm\beta}}$}}{\beta\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm\beta}}$}}\} can be sent to {ρ,ρ¯,σ,σ¯}\{\rho,\mathchoice{\rho\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm\rho}}$}}{\rho\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm\rho}}$}}{\rho\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm\rho}}$}}{\rho\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm\rho}}$}},\sigma,\mathchoice{\sigma\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm\sigma}}$}}{\sigma\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm\sigma}}$}}{\sigma\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm\sigma}}$}}{\sigma\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm\sigma}}$}}\} by an element of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}). This will be enough to prove the theorem.

By replacing ff with its image under an element of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) we may assume that α=ρ\alpha=\rho. The subgroup of PGLq(𝐅q)\operatorname{PGL}_{q}({\mathbf{F}}_{q}) that fixes the set {ρ,ρ¯}\{\rho,\mathchoice{\rho\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm\rho}}$}}{\rho\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm\rho}}$}}{\rho\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm\rho}}$}}{\rho\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm\rho}}$}}\} is the group HνH_{\nu} from the proof of Theorem 1.2. Let Ψ\colonequals[1ρ1ρ]\Psi\colonequals\bigl{[}\begin{smallmatrix}\phantom{-}1&\rho\\ -1&\rho\end{smallmatrix}\bigr{]}. Arguing as in the proof of Theorem 1.2 we find that there is a unique element Γ\Gamma of HνH_{\nu} so that we can write Ψ(Γ(β))\Psi(\Gamma(\beta)) as ζi\zeta^{i} for an integer ii with 0<i(q1)/20<i\leq(q-1)/2.

Since by Corollary 3.2 there is an element of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) that swaps α\alpha and α¯\mathchoice{\alpha\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm\alpha}}$}}{\alpha\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm\alpha}}$}}{\alpha\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm\alpha}}$}}{\alpha\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm\alpha}}$}} with β\beta and β¯\mathchoice{\beta\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm\beta}}$}}{\beta\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm\beta}}$}}{\beta\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm\beta}}$}}{\beta\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm\beta}}$}}, we would have gotten the same value of ii if we had normalized β\beta and β¯\mathchoice{\beta\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm\beta}}$}}{\beta\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm\beta}}$}}{\beta\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm\beta}}$}}{\beta\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm\beta}}$}} to be ρ\rho and ρ¯\mathchoice{\rho\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm\rho}}$}}{\rho\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm\rho}}$}}{\rho\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm\rho}}$}}{\rho\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm\rho}}$}} at the beginning of our argument, instead of α\alpha and α¯\mathchoice{\alpha\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm\alpha}}$}}{\alpha\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm\alpha}}$}}{\alpha\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm\alpha}}$}}{\alpha\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm\alpha}}$}}. Thus the value of ii we obtain truly depends only on the PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbit of ff.

This shows that we may assume that β=Ψ1(ζi)\beta=\Psi^{-1}(\zeta^{i}) is an element of S2S_{2}, and different elements of S2S_{2} correspond to different PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbits. The theorem follows. ∎

Remark 3.5.

If ff is a homogeneous quartic in 𝐅q[x,y]{\mathbf{F}}_{q}[x,y] that can be factored into the product of two monic irreducible quadratics x2+sxy+ty2x^{2}+sxy+ty^{2} and x2+uxy+vy2x^{2}+uxy+vy^{2}, we define

μ(f)\colonequals(su2t2v)2(s24t)(u24v),\mu(f)\colonequals\frac{(su-2t-2v)^{2}}{(s^{2}-4t)(u^{2}-4v)}\,,

and we check that j(f)=64(μ(f)+3)3/(μ(f)1)2j(f)=64(\mu(f)+3)^{3}/(\mu(f)-1)^{2}, where j(f)j(f) is as in Remark 3.3. Note that μ(f)\mu(f) is a square, because the two factors in the denominator are the discriminants of the irreducible factors of ff.

We leave it to the reader to check that for ff of this form we have μ(Γ(f))=μ(f)\mu(\Gamma(f))=\mu(f) for every ΓPGL2(𝐅q)\Gamma\in\operatorname{PGL}_{2}({\mathbf{F}}_{q}), so μ\mu is an invariant of the PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbits of such quartics. Given any square dd in 𝐅q{\mathbf{F}}_{q} other than 11, we check that a quartic f\colonequals(x2νy2)(x2+uxy+vy2)f\colonequals(x^{2}-\nu y^{2})(x^{2}+uxy+vy^{2}) satisfies μ(f)=d\mu(f)=d if and only if (u,v)(u,v) lies on a certain nonsingular conic. Nonsingular conics over finite fields have rational points not on the line at infinity, so there are values of uu and vv that give a quartic for which μ\mu attains the value dd. Since μ\mu attains (q1)/2(q-1)/2 different values, μ\mu must take different values on the (q1)/2(q-1)/2 orbits of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) acting on products of irreducible quadratics.

One can show that μ\mu is derived from a modular function that parametrizes pairs (E,P)(E,P), where EE is an elliptic curve and PP is a point of order 22. For products f1f2f_{1}f_{2} of two irreducible quadratics, the elliptic curve is the Jacobian of the curve C:z2=f1f2C\colon z^{2}=f_{1}f_{2}, and the point of order 22 is represented by the degree-0 divisor on CC whose double is the divisor of f1/f2f_{1}/f_{2}.

We also have a similar result for quartics with exactly one irreducible quadratic factor, which works in all characteristics.

Theorem 3.6.

Given a prime power qq, let ζ\zeta be a generator of 𝐅q2×{\mathbf{F}}_{q^{2}}^{\times}. Let

S211={ζi| 0<i(q+1)/2}S_{211}=\{\zeta^{i}\ |\ 0<i\leq(q+1)/2\}

and let T211T_{211} be the set of homogenized minimal polynomials of the elements of S211S_{211}. Then the set {xyg|gT211}\{xyg\ |\ g\in T_{211}\} is a complete set of unique representatives for the action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) on the monic separable homogeneous quartics that have exactly one irreducible quadratic factor.

Proof.

The proof follows the same lines as that of Theorem 3.4, but is much simpler. We move the two rational roots of ff to 0 and \infty, and then show that up to scaling and inversion, every element of 𝐅q2𝐅q{\mathbf{F}}_{q^{2}}\setminus{\mathbf{F}}_{q} has a unique representative in S211S_{211}. We leave the details to the reader. ∎

Remark 3.7.

The function μ\mu defined in Remark 3.5 can be extended to monic separable quartics with exactly one irreducible quadratic factor; when the two zeros of ff in 𝐏1(𝐅q){\mathbf{P}}^{1}({\mathbf{F}}_{q}) are finite we can use the same formula as before, and when f=y(xby)(x2+ux+v)f=y(x-by)(x^{2}+ux+v) we can define μ(f)=(u+2b)2/(u24v)\mu(f)=(u+2b)^{2}/(u^{2}-4v). Once again, μ\mu depends only on the PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbit of its argument. On quartics of this type, the set of values attained by μ\mu is the set of nonsquares in 𝐅q{\mathbf{F}}_{q} together with 0. Thus, μ\mu distinguishes PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbits of such quartics from one another.

Theorem 3.6 applies to all finite fields, while Theorems 1.2 and 3.4 require the characteristic to be odd. The following theorem generalizes the latter two results to characteristic 22. The proof is analogous to those of the earlier theorems, but is made much simpler by the fact that in this case every involution in PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) is conjugate to [1101]\bigl{[}\begin{smallmatrix}1&1\\ 0&1\end{smallmatrix}\bigr{]}. We leave the details to the reader.

Theorem 3.8.

Let qq be a power of 22, let AA be the set of elements of 𝐅q{\mathbf{F}}_{q} of absolute trace 11, and let ν\nu be an element of AA. Then the set

{(x4+x2y2)+a(x2y2+xy3)+a2νy4|aA}\bigl{\{}(x^{4}+x^{2}y^{2})+a(x^{2}y^{2}+xy^{3})+a^{2}\nu y^{4}\ |\ a\in A\bigr{\}}

is a complete set of unique representatives for the action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) on the monic irreducible homogeneous quartics over 𝐅q{\mathbf{F}}_{q}, and the set

{(x2+xy+νy2)(x2+xy+ay2)|aA,aν}\bigl{\{}(x^{2}+xy+\nu y^{2})(x^{2}+xy+ay^{2})\ |\ a\in A,a\neq\nu\bigr{\}}

is a complete set of unique representatives for the action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) on the homogeneous quartics over 𝐅q{\mathbf{F}}_{q} that can be written as the product of two distinct monic irreducible quadratics.∎

Remark 3.9.

Theorems 1.2, 3.4, 3.6, and 3.8 lead to quasilinear-time algorithms to give complete sets of unique representatives for the action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) on the various types of quartics discussed in the theorems. The only difficulty is obtaining a primitive element ζ\zeta for 𝐅q2{\mathbf{F}}_{q^{2}} in Theorems 3.4 and 3.6 and an element γ\gamma of order 2(q21)2(q^{2}-1) in 𝐅q4{\mathbf{F}}_{q^{4}} for Theorem 1.2. But primitive elements for 𝐅q2{\mathbf{F}}_{q^{2}} can be determined deterministically in time O(q1/2+ε)O(q^{1/2+\varepsilon}) for every ε>0\varepsilon>0 (see [23]), and the γ\gamma required for Theorem 1.2 can be obtained by taking the square root in 𝐅q4{\mathbf{F}}_{q^{4}} of a primitive element for 𝐅q2{\mathbf{F}}_{q^{2}}.

In quasilinear time we can also create a table of size O(q)O(q) that we can use to invert the function μ\mu, which gives us a way to compute the orbit representatives of quartics with one or two irreducible quadratic factors. The function μ\mu does not reduce well modulo 22, but the function (μ1)/4(\mu-1)/4 does; the corresponding function takes a product (x2+sxy+ty2)(x2+uxy+vy2)(x^{2}+sxy+ty^{2})(x^{2}+uxy+vy^{2}) in characteristic 22 to ((t+v)2+(s+u)(sv+tu))/(su)2((t+v)^{2}+(s+u)(sv+tu))/(su)^{2}.

4. An invariant for irreducible polynomials over finite fields

In this section we define an easily computable invariant222Classically, an invariant on the set Rnk[x,y]R_{n}\subset k[x,y] of homogeneous bivariate polynomials of degree nn is a function RnkR_{n}\to k that is constant on PGL2(k)\operatorname{PGL}_{2}(k) orbits. We use the term more generally here, and simply mean a function from RnR_{n} to any set that is constant on PGL2(k)\operatorname{PGL}_{2}(k) orbits. for monic irreducible homogeneous bivariate polynomials of arbitrary degree n4n\geq 4 over a finite field 𝐅q{\mathbf{F}}_{q} under the action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) mentioned in Section 2. The invariant is based on the classical cross ratio, which is the function that assigns to an ordered quadruple (P1,P2,P3,P4)(P_{1},P_{2},P_{3},P_{4}) of distinct elements of 𝐏1(k¯){\mathbf{P}}^{1}(\mathchoice{k\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm k}}$}}) the element αk¯\alpha\in\mathchoice{k\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm k}}$}} for which Γ(P4)=[α: 1]{\Gamma(P_{4})={[\alpha\,{:}\,1]}}, where Γ\Gamma is the unique element of PGL2(k¯)\operatorname{PGL}_{2}(\mathchoice{k\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm k}}$}}) that sends P1P_{1} to \infty, P2P_{2} to 0, and P3P_{3} to 11. It follows that the cross ratio is constant on the orbits of the diagonal action of PGL2(k¯)\operatorname{PGL}_{2}(\mathchoice{k\hbox to0.0pt{\hss$\overline{\phantom{\displaystyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\textstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptstyle\rm k}}$}}{k\hbox to0.0pt{\hss$\overline{\phantom{\scriptscriptstyle\rm k}}$}}) on such quadruples, and takes distinct values on distinct orbits. (Compare to [5, Definition III.3.7] and the propositions following it.)

Definition 4.1.

Let qq be a prime power and let ff be a monic irreducible homogeneous bivariate polynomial of degree n4n\geq 4 over 𝐅q{\mathbf{F}}_{q}. We define the cross polynomial Cross(f)\operatorname{Cross}(f) of ff as follows: Let α𝐅qn\alpha\in{\mathbf{F}}_{q^{n}} be a root of ff, and let χ𝐅qn\chi\in{\mathbf{F}}_{q^{n}} be the cross ratio of α\alpha, αq\alpha^{q}, αq2\alpha^{q^{2}}, and αq3\alpha^{q^{3}}; that is,

χ\colonequals(αq3αq)(αq2α)(αq3α)(αq2αq).\chi\colonequals\frac{(\alpha^{q^{3}}-\alpha^{q})(\alpha^{q^{2}}-\alpha)}{(\alpha^{q^{3}}-\alpha)(\alpha^{q^{2}}-\alpha^{q})}\,.

Then set Cross(f)\operatorname{Cross}(f) to be the characteristic polynomial of χ\chi over 𝐅q{\mathbf{F}}_{q}.

Note that the denominator of χ\chi is nonzero, because the powers of α\alpha involved are four of the nn distinct conjugates of α\alpha. Also, replacing α\alpha with one of its conjugates results in replacing χ\chi with a conjugate, so the characteristic polynomial remains unchanged. Thus we see that Cross(f)\operatorname{Cross}(f) is well-defined.

Theorem 4.2.

Let qq be a prime power. Two monic irreducible homogenous polynomials in 𝐅q[x,y]{\mathbf{F}}_{q}[x,y] of degree at least 44 lie in the same orbit under the action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) if and only if they have the same cross polynomial.

Proof.

Suppose ff and gg are irreducible homogenous polynomials in 𝐅q[x,y]{\mathbf{F}}_{q}[x,y] of degree at least 44. Suppose ff and gg lie in the same PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbit, say g=Γ(f)g=\Gamma(f) for some ΓPGL2(𝐅q)\Gamma\in\operatorname{PGL}_{2}({\mathbf{F}}_{q}). Then ff and gg have the same degree, which we denote by nn. Let α\alpha be a root of ff in 𝐅qn{\mathbf{F}}_{q^{n}} and let β=Γ(α)\beta=\Gamma(\alpha). Then β\beta is a root of gg, and for every i0i\geq 0 we have βqi=Γ(αqi)\beta^{q^{i}}=\Gamma(\alpha^{q^{i}}). In particular, the cross ratio of α\alpha, αq\alpha^{q}, αq2\alpha^{q^{2}}, and αq3\alpha^{q^{3}} is equal to the cross ratio of β\beta, βq\beta^{q}, βq2\beta^{q^{2}}, and βq3\beta^{q^{3}}, so Cross(f)=Cross(g)\operatorname{Cross}(f)=\operatorname{Cross}(g).

Conversely, suppose ff and gg are two monic irreducible polynomials of degree at least 44 with Cross(f)=Cross(g)\operatorname{Cross}(f)=\operatorname{Cross}(g). Since a polynomial has the same degree as its cross polynomial, ff and gg have the same degree, say nn. Since the cross polynomials are equal, there are roots α\alpha of ff and β\beta of gg in 𝐅qn{\mathbf{F}}_{q^{n}} such that α\alpha, αq\alpha^{q}, αq2\alpha^{q^{2}}, and αq3\alpha^{q^{3}} have the same cross ratio as β\beta, βq\beta^{q}, βq2\beta^{q^{2}}, and βq3\beta^{q^{3}}. It follows that there is an element Γ\Gamma of PGL2(𝐅qn)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{n}}) with Γ(αqi)=βqi\Gamma(\alpha^{q^{i}})=\beta^{q^{i}} for 0i30\leq i\leq 3. In particular, we have Γ(xq)=Γ(x)q\Gamma(x^{q})=\Gamma(x)^{q} for three distinct values of xx, namely α\alpha, αq\alpha^{q}, and αq2\alpha^{q^{2}}, so Γ\Gamma is fixed by Frobenius and therefore lies in PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}). Thus, Γ\Gamma takes every root of ff to a root of gg, so Γ(f)=g\Gamma(f)=g. ∎

As an application of this invariant, we give an algorithm for creating a table of orbit representatives for irreducible polynomials of degree n4n\geq 4 in time O~(qn2)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{n-2}).

Algorithm 4.3.

Inverting the cross polynomial function.

  • Input:

    A prime power qq and an integer n4n\geq 4.

  • Output:

    A table, indexed by the values of the cross polynomials for irreducible polynomials of degree nn, giving for each cross polynomial gg an irreducible homogeneous f𝐅q[x,y]f\in{\mathbf{F}}_{q}[x,y] of degree nn with Crossf=g\operatorname{Cross}f=g.

  • 1.

    Construct a copy of 𝐅qn{\mathbf{F}}_{q^{n}} with an 𝐅q{\mathbf{F}}_{q}-basis (β1,,βn)(\beta_{1},\ldots,\beta_{n}) such that β1\beta_{1} appears with nonzero coefficient in the representation of 11.

  • 2.

    Set LL to be the empty list.

  • 3.

    For every α𝐅qn\alpha\in{\mathbf{F}}_{q^{n}} that does not lie in a proper subfield, and whose representation (a1,,an)(a_{1},\ldots,a_{n}) on the given basis has a1=0a_{1}=0 and has ai=1a_{i}=1 for the first ii with ai0a_{i}\neq 0, do:

    • (ad)

      Compute the homogenization ff of the minimal polynomial of α\alpha.

    • (bd)

      Compute Crossf\operatorname{Cross}f.

    • (cd)

      Append the pair (Crossf,f)(\operatorname{Cross}f,f) to LL.

  • 4.

    Sort LL.

  • 5.

    Delete every entry (Crossf,f)(\operatorname{Cross}f,f) of LL for which the value of Crossf\operatorname{Cross}f appears earlier in the list.

  • 6.

    Return LL.

Proposition 4.4.

Algorithm 4.3 produces correct output and runs in time O~(qn2)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{n-2}), measured in arithmetic operations in 𝐅q{\mathbf{F}}_{q}.

Proof.

First we note that every PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbit contains an α\alpha as in step (3). We can see this because starting with an arbitrary α𝐅qn\alpha\in{\mathbf{F}}_{q^{n}}, we can subtract an element of 𝐅q{\mathbf{F}}_{q} to zero out the coefficient of β1\beta_{1}, and then we can scale by an element of 𝐅q×{\mathbf{F}}_{q}^{\times} so that the first nonzero coefficient is 11. It follows that every orbit will have a representative included in the output, and step (5) ensures that there is only one representative given for each orbit. Thus the output is correct. Now we analyze the timing.

For fixed nn, Shoup’s algorithm [22] can construct a finite field 𝐅qn{\mathbf{F}}_{q^{n}} in time O~(q)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(\sqrt{q}), and in polynomial time [15] we can find an embedding of our given 𝐅q{\mathbf{F}}_{q} into this copy of 𝐅qn{\mathbf{F}}_{q^{n}}, so step (1) can be done within the stated time bound. Because nn is fixed, for each α\alpha the values of ff and Crossf\operatorname{Cross}f can be computed in time O(1)O(1), so creating the list LL takes time O(qn2)O(q^{n-2}). Finally, sorting a list of length O(qn2)O(q^{n-2}) takes time O~(qn2)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{n-2}) (see [13, §5.2.3]). ∎

As we will see, for composite values of nn there is an algorithm for producing a complete set of unique representatives for the PGL2(k)\operatorname{PGL}_{2}(k) orbits of irreducible homogeneous polynomials of degree nn that runs in time O~(qn3)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{n-3}); see Section 8.3. An algorithm of this time complexity that works for all nn is given in [9].

5. Explicit coset representatives for PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) in PGL2(𝐅q2)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{2}})

As part of our algorithm, we will need to have a complete set of unique representatives for the right cosets of the subgroup PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) of PGL2(𝐅q2)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{2}}). In this section we give an explicit set of such representatives.

Throughout this section, qq is a prime power, ω\omega is an element of 𝐅q2𝐅q{{\mathbf{F}}_{q^{2}}\setminus{\mathbf{F}}_{q}}, and γ\gamma is a generator of the multiplicative group of 𝐅q2{\mathbf{F}}_{q^{2}}.

An element of PGL2(𝐅q2)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{2}}) is determined by where it sends \infty, 0, and 11, and given any three distinct elements of 𝐏1(𝐅q2){\mathbf{P}}^{1}({\mathbf{F}}_{q^{2}}), there is an element of PGL2(𝐅q2)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{2}}) that sends \infty, 0, and 11 to those three elements. Thus, we may represent elements of PGL2(𝐅q2)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{2}}) by triples (ζ,η,θ)(\zeta,\eta,\theta) of pairwise distinct elements of 𝐏1(𝐅q2){\mathbf{P}}^{1}({\mathbf{F}}_{q^{2}}), indicating the images of \infty, 0, and 11. If Γ\Gamma is an element of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}), then Γ\Gamma sends the element (ζ,η,θ)(\zeta,\eta,\theta) of PGL2(𝐅q2)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{2}}) to (Γ(ζ),Γ(η),Γ(θ))(\Gamma(\zeta),\Gamma(\eta),\Gamma(\theta)).

Proposition 5.1.

Let BB be the set {(ωγi+ωq)/(γi+1)| 0i<q1}.\{(\omega\gamma^{i}+\omega^{q})/(\gamma^{i}+1)\ |\ 0\leq i<q-1\bigr{\}}. The following elements give a complete set of unique coset representatives for the left action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) on PGL2(𝐅q2)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{2}}):

  1. (1)

    (,0,1)(\infty,0,1);

  2. (2)

    {(,0,ω+a)|a𝐅q}\bigl{\{}(\infty,0,\omega+a)\ |\ a\in{\mathbf{F}}_{q}\bigr{\}};

  3. (3)

    {(,ω,θ)|θ𝐅q2 with θω}\bigl{\{}(\infty,\omega,\theta)\ |\ \theta\in{\mathbf{F}}_{q^{2}}\text{\ with\ }\theta\neq\omega\bigr{\}};

  4. (4)

    {(ω,ωq,θ)|θB}\bigl{\{}(\omega,\omega^{q},\theta)\ |\ \theta\in B\bigr{\}};

  5. (5)

    {(ω,η,θ)|ηB,θ𝐏1(𝐅q2) with θω and θη}\bigl{\{}(\omega,\eta,\theta)\ |\ \eta\in B,\theta\in{\mathbf{P}}^{1}({\mathbf{F}}_{q^{2}})\text{\ with\ }\theta\neq\omega\text{\ and\ }\theta\neq\eta\bigr{\}}.

To prove this proposition, we need the following lemma.

Lemma 5.2.

With notation as above, let GG be the subgroup of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) that fixes the element ω\omega. Then the set BB from Proposition 5.1 is a complete set of unique representatives for the left action of GG on 𝐏1(𝐅q2){ω,ωq}{{\mathbf{P}}^{1}({\mathbf{F}}_{q^{2}})\setminus\{\omega,\omega^{q}\}}.

Proof.

Let r\colonequalsω+ωqr\colonequals\omega+\omega^{q} and let s\colonequalsωq+1s\colonequals\omega^{q+1}. We check that the group GG is equal to

G={[asbbarb]|[a:b]𝐏1(𝐅q)}.G=\Biggl{\{}\begin{bmatrix}a&\phantom{a}-sb\\ b&a-rb\end{bmatrix}\ \bigg{|}\ {[a\,{:}\,b]}\in{\mathbf{P}}^{1}({\mathbf{F}}_{q})\Biggr{\}}\,.

Let Φ\colonequals[1ωq1ω],\Phi\colonequals\bigl{[}\begin{smallmatrix}-1&\phantom{-}\omega^{q}\\ \phantom{-}1&-\omega\phantom{{}^{q}}\end{smallmatrix}\bigr{]}, so that Φ\Phi sends ω\omega to \infty and ωq\omega^{q} to 0. We compute that

ΦGΦ1\displaystyle\Phi G\Phi^{-1} ={[abωq00abω]|[a:b]𝐏1(𝐅q)}\displaystyle=\Biggl{\{}\begin{bmatrix}a-b\omega^{q}&0\\ 0&a-b\omega\end{bmatrix}\ \bigg{|}\ {[a\,{:}\,b]}\in{\mathbf{P}}^{1}({\mathbf{F}}_{q})\Biggr{\}}
={[(abωq)/(abω)001]|[a:b]𝐏1(𝐅q)}.\displaystyle=\Biggl{\{}\begin{bmatrix}(a-b\omega^{q})/(a-b\omega)&0\\ 0&1\end{bmatrix}\ \bigg{|}\ {[a\,{:}\,b]}\in{\mathbf{P}}^{1}({\mathbf{F}}_{q})\Biggr{\}}\,.

By Hilbert 9090, the set of values attained by (abωq)/(abω)(a-b\omega^{q})/(a-b\omega) is equal to the set of elements of 𝐅q2{\mathbf{F}}_{q^{2}} whose norms to 𝐅q{\mathbf{F}}_{q} are equal to 11, and these elements are precisely the powers of γq1\gamma^{q-1}. Thus, the action of ΦGΦ1\Phi G\Phi^{-1} on 𝐏1(𝐅q2){,0}{\mathbf{P}}^{1}({\mathbf{F}}_{q^{2}})\setminus\{\infty,0\} is generated by multiplication by γq1\gamma^{q-1}, and it is easy to see that the values 1,γ,,γq21,\gamma,\ldots,\gamma^{q-2} are orbit representatives for this action. Applying Φ1\Phi^{-1} to these orbit representatives will give us orbit representatives for the action of GG on 𝐏1(𝐅q2){ω,ωq}{{\mathbf{P}}^{1}({\mathbf{F}}_{q^{2}})\setminus\{\omega,\omega^{q}\}}, and we see that Φ1(γi)=(ωγi+ωq)/(γi+1)\Phi^{-1}(\gamma^{i})=(\omega\gamma^{i}+\omega^{q})/(\gamma^{i}+1). ∎

Proof of Proposition 5.1.

Suppose we are given an element (ζ,η,θ)(\zeta,\eta,\theta) of PGL2(𝐅q2)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{2}}). We will show how to modify it by elements of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) to put it into one of the forms listed in the proposition. In the course of this demonstration, it will become clear that the elements listed in the proposition do indeed lie in different PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbits, because they are fixed by the following procedure.

Recall that ω\omega is an element of 𝐅q2𝐅q{\mathbf{F}}_{q^{2}}\setminus{\mathbf{F}}_{q}. Given a triple Γ\colonequals(ζ,η,θ)\Gamma\colonequals(\zeta,\eta,\theta) representing an element of PGL2(𝐅q2)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{2}}), we do the following:

  1. (1)

    If ζ\zeta lies in 𝐏1(𝐅q){\mathbf{P}}^{1}({\mathbf{F}}_{q}): In this case, we can apply an element of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) that moves ζ\zeta to \infty. Our element of PGL2(𝐅q2)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{2}}) can now be written (,η,θ)(\infty,\eta,\theta), for some new values of η\eta and θ\theta. We can now only apply elements of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) that fix \infty; that is, we are limited to the so-called ax+bax+b group.

    1. (a)

      If η\eta lies in 𝐅q{\mathbf{F}}_{q}: In this case, we can use the ax+bax+b group to move η\eta to 0. Our element of PGL2(𝐅q2)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{2}}) can now be written (,0,θ)(\infty,0,\theta), for some new value θ\theta. Now we can only apply elements of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) that fix \infty and 0; that is, we are limited to scalar multiplication.

      1. (i)

        If θ\theta lies in 𝐅q{\mathbf{F}}_{q}: In this case, we can scale θ\theta so that it is equal to 11. We obtain the element (,0,1)(\infty,0,1) listed in part (1) of the proposition, and no further action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) is possible.

      2. (ii)

        If θ\theta does not lie in 𝐅q{\mathbf{F}}_{q}: We can write θ=uω+v\theta=u\omega+v for elements u,vu,v of 𝐅q{\mathbf{F}}_{q}, with uu nonzero. There is a unique scaling that will put θ\theta into the form ω+a\omega+a. We obtain an element from part (2) of the proposition.

    2. (b)

      If η\eta does not lie in 𝐅q{\mathbf{F}}_{q}: Using the ax+bax+b group, we can move η\eta to ω\omega. There is no further action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) that fixes \infty and ω\omega, so θ\theta can be any element of 𝐅q2{\mathbf{F}}_{q^{2}} other than ω\omega. This gives us an element from part (3) of the proposition.

  2. (2)

    If ζ\zeta does not lie in 𝐏1(𝐅q){\mathbf{P}}^{1}({\mathbf{F}}_{q}): In this case, ζ\zeta is an element of 𝐅q2𝐅q{\mathbf{F}}_{q^{2}}\setminus{\mathbf{F}}_{q}, and we can use the ax+bax+b subgroup of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) to move ζ\zeta to ω\omega. The only elements of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) that we can apply once we have fixed ζ=ω\zeta=\omega are the elements of the group GG from Lemma 5.2.

    1. (a)

      If η\eta is equal to ωq\omega^{q}: If η=ωq\eta=\omega^{q} then the action of GG fixes η\eta. We know that θ\theta is different from both ω\omega and ωq\omega^{q}, so by Lemma 5.2 we can use GG to move θ\theta to a unique element of the set BB. This gives us an element from part (4) of the proposition.

    2. (b)

      If η\eta is not equal to ωq\omega^{q}: We can use GG to move η\eta to a unique element of BB. Once we have normalized η\eta in this way, there is no further action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) that fixes ω\omega and η\eta, so θ\theta can be any element of 𝐏1(𝐅q2){\mathbf{P}}^{1}({\mathbf{F}}_{q^{2}}) other than ω\omega and η\eta. This gives us an element from part (5) of the proposition.

These cases enumerate all of the possibilities for our element (ζ,η,θ)(\zeta,\eta,\theta), so the proposition is proved. ∎

6. Explicit coset representatives for PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) in PGL2(𝐅qp)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{p}})

It is not necessary for proving our main theorem, but there is a result analogous to Proposition 5.1 for the cosets of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) in PGL2(𝐅qp)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{p}}), where pp is an odd prime. As before, we represent elements of PGL2(𝐅qp)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{p}}) as triples (ζ,η,θ)(\zeta,\eta,\theta) of distinct elements of 𝐏1(𝐅qp){\mathbf{P}}^{1}({\mathbf{F}}_{q^{p}}), indicating where the given element of PGL2(𝐅qp)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{p}}) sends \infty, 0, and 11.

Proposition 6.1.

Let qq be a prime power and let pp be an odd prime. Let CC be a set of orbit representatives for the action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) on 𝐅qp𝐅q{\mathbf{F}}_{q^{p}}\setminus{\mathbf{F}}_{q}, let CC_{\infty} be a set of orbit representatives for the action of the ax+bax+b subgroup of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) on 𝐅qp𝐅q{\mathbf{F}}_{q^{p}}\setminus{\mathbf{F}}_{q}, and let C,0C_{\infty,0} be a set of orbit representatives for the multiplicative action of 𝐅q×{\mathbf{F}}_{q}^{\times} on 𝐅qp𝐅q{\mathbf{F}}_{q^{p}}\setminus{\mathbf{F}}_{q}.

The following elements give a complete set of unique coset representatives for the left action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) on PGL2(𝐅qp)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{p}}):

  1. (1)

    (,0,1)(\infty,0,1);

  2. (2)

    {(,0,θ)|θC,0}\bigl{\{}(\infty,0,\theta)\ |\ \theta\in C_{\infty,0}\bigr{\}};

  3. (3)

    {(,η,θ)|ηC,θ𝐅qp with θη}\bigl{\{}(\infty,\eta,\theta)\ |\ \eta\in C_{\infty},\ \theta\in{\mathbf{F}}_{q^{p}}\text{\ with\ }\theta\neq\eta\bigr{\}};

  4. (4)

    {(ζ,η,θ)|ζC,η,θ𝐏1(𝐅qp) with ηζ and θζ and θη}\bigl{\{}(\zeta,\eta,\theta)\ |\ \zeta\in C,\ \eta,\theta\in{\mathbf{P}}^{1}({\mathbf{F}}_{q^{p}})\text{\ with\ }\eta\neq\zeta\text{\ and\ }\theta\neq\zeta\text{\ and\ }\theta\neq\eta\bigr{\}}.

Proof.

The proof is much like that of Proposition 5.1, but simpler. Suppose we are given an arbitrary (ζ,η,θ)(\zeta,\eta,\theta) in PGL2(𝐅qp)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{p}}). If ζ\zeta and η\eta both lie in 𝐏1(𝐅q){\mathbf{P}}^{1}({\mathbf{F}}_{q}), we can move them to \infty and 0, and then we can only modify θ\theta by scaling by elements of 𝐅q×{\mathbf{F}}_{q}^{\times}. If θ\theta lies in 𝐅q{\mathbf{F}}_{q} we get case (1), and if not we get case (2).

If ζ\zeta lies in 𝐏1(𝐅q){\mathbf{P}}^{1}({\mathbf{F}}_{q}) but η\eta does not, we move ζ\zeta to \infty using PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}). Then the only action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) we have left to us is the ax+bax+b subgroup. Since η\eta lies in 𝐅qp𝐅q{\mathbf{F}}_{q^{p}}\setminus{\mathbf{F}}_{q}, we can use this subgroup to move η\eta to an element of CC_{\infty}. Then θ\theta can be arbitrary, as long as it is different from \infty and from η\eta. This gives us case (3).

If ζ\zeta does not lie in 𝐏1(𝐅q){\mathbf{P}}^{1}({\mathbf{F}}_{q}) then we can move ζ\zeta using PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) so that it lies in CC, and there is no further action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) left available to us, because the only elements of 𝐏1(𝐅¯q){\mathbf{P}}^{1}(\overline{{\mathbf{F}}}_{q}) with nontrivial PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) stabilizers lie in 𝐏1(𝐅q2){\mathbf{P}}^{1}({\mathbf{F}}_{q^{2}}). This gives us case (4). ∎

This result is useful because we can compute the sets of representatives we need.

Algorithm 6.2.

Orbit representatives for PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) acting on the elements of 𝐅qn{\mathbf{F}}_{q^{n}} that do not lie in proper subfields.

  • Input:

    A prime power qq and an integer n3n\geq 3.

  • Output:

    A complete set of unique representatives for the action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) on the the elements of 𝐅qn{\mathbf{F}}_{q^{n}} that do not lie in proper subfields.

  • 1.

    Set LL and MM to be empty lists.

  • 2.

    Construct a copy of 𝐅qn{\mathbf{F}}_{q^{n}} with an 𝐅q{\mathbf{F}}_{q}-basis (β1,,βn)(\beta_{1},\ldots,\beta_{n}) such that β1\beta_{1} appears with nonzero coefficient in the representation of 11.

  • 3.

    If n=3n=3 return a list containing the single element β2\beta_{2}, and stop.

  • 4.

    For every α𝐅qn\alpha\in{\mathbf{F}}_{q^{n}} that does not lie in a proper subfield, and whose representation (a1,,an)(a_{1},\ldots,a_{n}) on the given basis has a1=0a_{1}=0 and has ai=1a_{i}=1 for the first ii with ai0a_{i}\neq 0, do:

    • (ad)

      Compute αqi\alpha^{q^{i}} for i=1,,n1i=1,\ldots,n-1. If any of these conjugates is smaller than or equal to α\alpha under a fixed ordering <<, continue on to the next value of α\alpha.

    • (bd)

      Compute the minimal polynomial ff of α\alpha.

    • (cd)

      Find the (unique) irreducible factor gg of Cross(f)\operatorname{Cross}(f).

    • (dd)

      Append the pair (g,α)(g,\alpha) to LL.

  • 5.

    Sort LL.

  • 6.

    Delete every element (g,α)(g,\alpha) of LL such that gg appears as a first entry of an element earlier in the list.

  • 7.

    For every (g,α)(g,\alpha) in LL, do:

    • (ad)

      For i=0,,degg1i=0,\ldots,\deg g-1, append the element αqi\alpha^{q^{i}} to MM.

  • 8.

    Return MM.

Proposition 6.3.

Algorithm 6.2 produces a complete list of unique representatives for the orbits of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) acting on the elements of 𝐅qn{\mathbf{F}}_{q^{n}} that lie in no proper subfield. It runs in time O~(qn2)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{n-2}).

Proof.

When n=3n=3, the group PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) acts transitively on 𝐏q3𝐅q{\mathbf{P}}_{q^{3}}\setminus{\mathbf{F}}_{q}, so step (3) gives correct output. For n>3n>3, Algorithm 6.2 is a variation on Algorithm 4.3. The only additional fact we must note is that there is an element of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) that takes α\alpha to one of its nontrivial conjugates if and only if the cross polynomial of ff is not irreducible, and that the order of each such element of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) is equal to the exponent ee such that Cross(f)=ge\operatorname{Cross}(f)=g^{e}. Thus, the Galois orbit of α\alpha contains representatives of exactly degg\deg g PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbits. ∎

Algorithm 6.2 gives us a method to calculate the set CC from Proposition 6.1. The sets CC_{\infty} and C,0C_{\infty,0} can be computed in similar (but simpler) ways; we leave the details to the reader.

7. Enumerating PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbit representatives for Symn(𝐅q)\operatorname{Sym}^{n}({\mathbf{F}}_{q})

In this section we present our algorithm for enumerating orbit representatives for the action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) on Symn(𝐅q)\operatorname{Sym}^{n}({\mathbf{F}}_{q}) in time O~(qn3)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{n-3}), for nn fixed and qq varying. The algorithm consists of a number of different algorithms, each addressing a subset of elements of Symn(𝐅q)\operatorname{Sym}^{n}({\mathbf{F}}_{q}). The problem is trivial when n3n\leq 3, so we will always assume that n4n\geq 4, and for one case we will also demand that nn be even. This is sufficient for our application to enumerating hyperelliptic curves of genus gg, where n=2g+2n=2g+2 is even and at least 66. (See [9] for an algorithm that works for all nn.)

Recall that an element of Symn(𝐅q)\operatorname{Sym}^{n}({\mathbf{F}}_{q}) is a set A={α1,,αn}A=\{\alpha_{1},\ldots,\alpha_{n}\} of nn distinct elements of 𝐏1(𝐅¯q){\mathbf{P}}^{1}(\overline{{\mathbf{F}}}_{q}) that is stable under the action of the Galois group of 𝐅¯q\overline{{\mathbf{F}}}_{q} over 𝐅q{\mathbf{F}}_{q}. An element of Symn(𝐅q)\operatorname{Sym}^{n}({\mathbf{F}}_{q}) is primitive if the degree of each extension 𝐅q(αi){\mathbf{F}}_{q}(\alpha_{i}) over 𝐅q{\mathbf{F}}_{q} is equal to nn. Every element AA of Symn(𝐅q)\operatorname{Sym}^{n}({\mathbf{F}}_{q}) can be written in a unique way (up to order) as the union of a collection {Ai}\{A_{i}\} of primitive elements AiA_{i} of Symmi(𝐅q)\operatorname{Sym}^{m_{i}}({\mathbf{F}}_{q}), for some sequence of integers mim_{i} with mi=n\sum m_{i}=n. The sequence (mi)i(m_{i})_{i}, listed in non-increasing order, is the Galois type of AA. If ff is the monic homogeneous polynomial whose zero set is AA, then (mi)i(m_{i})_{i} is also the list of the degrees of the irreducible factors of ff, and we also refer to this sequence as the Galois type of ff. We will enumerate the PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbits of Symn(𝐅q)\operatorname{Sym}^{n}({\mathbf{F}}_{q}) by enumerating each Galois type separately.

Let M\colonequals(m1,m2,,mr)M\colonequals(m_{1},m_{2},\ldots,m_{r}) be a Galois type for Symn(𝐅q)\operatorname{Sym}^{n}({\mathbf{F}}_{q}), so that m1m2mr>0m_{1}\geq m_{2}\geq\cdots\geq m_{r}>0 and n=m1++mrn=m_{1}+\cdots+m_{r}. In the following subsections we show how to enumerate the PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbits of the elements of Symn(𝐅q)\operatorname{Sym}^{n}({\mathbf{F}}_{q}) of this Galois type, based on the value of m1m_{1}.

7.1. The case m1=1m_{1}=1

Every element AA of Symn(𝐅q)\operatorname{Sym}^{n}({\mathbf{F}}_{q}) of this Galois type is simply a collection of nn distinct elements of 𝐏1(𝐅q){\mathbf{P}}^{1}({\mathbf{F}}_{q}). We can specify a standard form for such elements AA by considering all possible choices of three distinct points aia_{i}, aja_{j}, and aka_{k} in AA, and using an element Γ\Gamma of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) to move those three points to \infty, 0, and 11, respectively. To this choice we associate the polynomial ff of degree n1n-1 defined by

f\colonequalsyi(xΓ(a)y).f\colonequals y\prod_{\ell\neq i}(x-\Gamma(a_{\ell})y)\,.

Our standard form for AA is the smallest polynomial ff obtained in this way, under an arbitrary total ordering << of the monic homogeneous polynomials of degree nn.

Our algorithm for enumerating orbit representatives of this Galois type is as follows.

Algorithm 7.1.

Orbit representatives for PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) acting on the elements of Symn(𝐅q)\operatorname{Sym}^{n}({\mathbf{F}}_{q}) of Galois type (1,1,,1)(1,1,\ldots,1).

  • Input:

    A prime power qq and an integer n4n\geq 4.

  • Output:

    A complete set of unique representatives for the action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) on the monic homogenous polynomials of degree nn and Galois type (1,1,,1)(1,1,\ldots,1).

  • 1.

    Set LL to be the empty list, and set a1\colonequalsa_{1}\colonequals\infty, a2\colonequals0a_{2}\colonequals 0, and a3\colonequals1a_{3}\colonequals 1.

  • 2.

    For every set {a4,,an}\{a_{4},\ldots,a_{n}\} of distinct elements of 𝐅q{0,1}{\mathbf{F}}_{q}\setminus\{0,1\} do:

    • (ad)

      Set f\colonequalsyi=2n(xaiy)f\colonequals y\prod_{i=2}^{n}(x-a_{i}y).

    • (bd)

      Set F\colonequals{Γ(f)}F\colonequals\{\Gamma(f)\}, where Γ\Gamma ranges over the elements of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) that send three elements of {ai}\{a_{i}\} to \infty, 0, and 11.

    • (cd)

      If ff is the smallest element of FF under the ordering <<, append ff to LL.

  • 3.

    Return LL.

Proposition 7.2.

Algorithm 7.1 produces a complete set of unique representatives for the orbits of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) acting on the monic homogeneous degree-nn polynomials of Galois type (1,1,,1)(1,1,\ldots,1). It runs in time O~(qn3)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{n-3}), measured in arithmetic operations in 𝐅q{\mathbf{F}}_{q}. ∎

7.2. The case m1=2m_{1}=2

When m1=2m_{1}=2 the possible Galois types (m1,,mr)(m_{1},\ldots,m_{r}) consist of ss values of 22 and tt values of 11, where 2s+t=n2s+t=n and s>0s>0. We present two algorithms, one that applies when t3t\geq 3 and one that applies when s2s\geq 2. Since we are assuming throughout that n4n\geq 4, the only remaining case is when s=1s=1 and t=2t=2, but that situation is handled by Theorem 3.6.

Algorithm 7.3.

Orbit representatives for PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) acting on the elements of Symn(𝐅q)\operatorname{Sym}^{n}({\mathbf{F}}_{q}) of Galois type of the form (2,2,,2,1,,1)(2,2,\ldots,2,1,\ldots,1), with ss entries of 22 and tt entries of 11, where t3t\geq 3.

  • Input:

    A prime power qq, an integer n4n\geq 4, and integers ss and tt with 2s+t=n2s+t=n and t3t\geq 3.

  • Output:

    A complete set of unique representatives for the action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) on the monic homogenous polynomials of degree nn with the given Galois type.

  • 1.

    Set LL to be the empty list, and set a1\colonequalsa_{1}\colonequals\infty, a2\colonequals0a_{2}\colonequals 0, and a3\colonequals1a_{3}\colonequals 1.

  • 2.

    Create a list I2I_{2} of the monic irreducible homogeneous quadratics over 𝐅q{\mathbf{F}}_{q}.

  • 3.

    For every set {a4,,at}\{a_{4},\ldots,a_{t}\} of distinct elements of 𝐅q{0,1}{\mathbf{F}}_{q}\setminus\{0,1\} and every set {g1,,gs}\{g_{1},\ldots,g_{s}\} of distinct elements of I2I_{2} do:

    • (ad)

      Set f\colonequalsyi=2t(xaiy)i=1sgif\colonequals y\prod_{i=2}^{t}(x-a_{i}y)\cdot\prod_{i=1}^{s}g_{i}.

    • (bd)

      Set F\colonequals{Γ(f)}F\colonequals\{\Gamma(f)\}, where Γ\Gamma ranges over the elements of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) that send three elements of {ai}\{a_{i}\} to \infty, 0, and 11.

    • (cd)

      If ff is the smallest element of FF under the ordering <<, append ff to LL.

  • 4.

    Return LL.

Proposition 7.4.

Algorithm 7.3 produces a complete set of unique representatives for the orbits of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) acting on the monic homogeneous degree-nn polynomials of Galois type (2,2,,2,1,,1)(2,2,\ldots,2,1,\ldots,1), with ss entries of 22 and t3t\geq 3 entries of 11. It runs in time O~(qn3)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{n-3}), measured in arithmetic operations in 𝐅q{\mathbf{F}}_{q}. ∎

Algorithm 7.5.

Orbit representatives for PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) acting on the elements of Symn(𝐅q)\operatorname{Sym}^{n}({\mathbf{F}}_{q}) of Galois type of the form (2,2,,2,1,,1)(2,2,\ldots,2,1,\ldots,1), with ss entries of 22 and tt entries of 11, where s2s\geq 2.

  • Input:

    A prime power qq, an integer n4n\geq 4, and integers ss and tt with 2s+t=n2s+t=n and s2s\geq 2.

  • Output:

    A complete set of unique representatives for the action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) on the monic homogenous polynomials of degree nn with the given Galois type.

  • 1.

    Set LL to be the empty list.

  • 2.

    Let I1I_{1} be the set of polynomials {y}{xay:a𝐅q}\{y\}\cup\{x-ay\,:\,a\in{\mathbf{F}}_{q}\}.

  • 3.

    Create a list I2I_{2} of the monic irreducible homogeneous quadratics over 𝐅q{\mathbf{F}}_{q}.

  • 4.

    For every pair (f1,f2)(f_{1},f_{2}) of irreducible quadratic factors obtained from Theorem 3.4 or Theorem 3.8, for every set {f3,,fs}\{f_{3},\ldots,f_{s}\} of elements of I2I_{2} such that the quadratics f1,,fsf_{1},\ldots,f_{s} are distinct, and for every set {g1,,gt}\{g_{1},\ldots,g_{t}\} of distinct elements of I1I_{1}, do:

    • (ad)

      Set f\colonequalsi=1sfii=1tgif\colonequals\prod_{i=1}^{s}f_{i}\cdot\prod_{i=1}^{t}g_{i}.

    • (bd)

      Set F\colonequals{Γ(f)}F\colonequals\{\Gamma(f)\}, where Γ\Gamma ranges over the elements of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) that send a pair of elements of {fi}\{f_{i}\} to the representative of their PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbit, calculated using the table mentioned at the end of Remark 3.9.

    • (cd)

      If ff is the smallest element of FF under the ordering <<, append ff to LL.

  • 5.

    Return LL.

Remark 7.6.

The most direct way of implementing step (4)(b) involves computing the roots of various irreducible quadratics in a fixed copy of 𝐅q2{\mathbf{F}}_{q^{2}}. From [15, Theorem 1.2], we know that this can be done in time polynomial in logq\log q.

Proposition 7.7.

Algorithm 7.5 produces a complete set of unique representatives for the orbits of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) acting on the monic homogeneous degree-nn polynomials of Galois type (2,2,,2,1,,1)(2,2,\ldots,2,1,\ldots,1), with s2s\geq 2 entries of 22 and tt entries of 11. It runs in time O~(qn3)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{n-3}), measured in arithmetic operations in 𝐅q{\mathbf{F}}_{q}. ∎

7.3. The case 3m1n13\leq m_{1}\leq n-1

Let (m1,,mr)(m_{1},\ldots,m_{r}) be a Galois type with 3m1n13\leq m_{1}\leq n-1. When m1>3m_{1}>3 we will make use of the list of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbit representatives of irreducible polynomials of degree m1m_{1} provided by Algorithm 4.3, which will not exceed our claimed time bound of O~(qn3)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{n-3}) because m12n3m_{1}-2\leq n-3. When m1=3m_{1}=3 we will use the fact that there is exactly one PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbit of irreducible degree-33 polynomials, so we can take our favorite irreducible polynomial of degree 33 as the sole orbit representative.

Algorithm 7.8.

Orbit representatives for PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) acting on the elements of Symn(𝐅q)\operatorname{Sym}^{n}({\mathbf{F}}_{q}) of Galois type (m1,,mr)(m_{1},\ldots,m_{r}), with 3m1n13\leq m_{1}\leq n-1.

  • Input:

    A prime power qq, an integer n4n\geq 4, and a Galois type with 3m1n13\leq m_{1}\leq n-1.

  • Output:

    A complete set of unique representatives for the action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) on the monic homogenous polynomials of degree nn with the given Galois type.

  • 1.

    Set LL to be the empty list.

  • 2.

    For each value of mim_{i} in the set {m2,,mr}\{m_{2},\ldots,m_{r}\}, create a list ImiI_{m_{i}} of the monic irreducible homogeneous polynomials of degree mim_{i}.

  • 3.

    If m1>3m_{1}>3, let L1L_{1} be the output of Algorithm 4.3 associated to the inputs qq and m1m_{1} and let SS be the list of orbit representatives of irreducible polynomials of degree m1m_{1} obtained as the second elements of each pair on the list L1L_{1}.

  • 4.

    If m1=3m_{1}=3 let SS be the single-element list consisting of an arbitrary irreducible polynomial of degree 33.

  • 5.

    For every element f1f_{1} of SS and every set of distinct polynomials {f2,,fr}\{f_{2},\ldots,f_{r}\} with fiImif_{i}\in I_{m_{i}} do:

    • (ad)

      Set f\colonequalsi=1rfi.f\colonequals\prod_{i=1}^{r}f_{i}.

    • (bd)

      Let M1M_{1} be the set of fif_{i} of degree m1m_{1} and set F\colonequals{Γ(f)}F\colonequals\{\Gamma(f)\}, where Γ\Gamma ranges over the elements of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) that send an element of MM to its associated orbit representative, obtained by computing its cross polynomial and using the lookup table L1L_{1} if m1>3m_{1}>3 and by direct calculation if m1=3m_{1}=3.

    • (cd)

      If ff is the smallest element of FF under the ordering <<, append ff to LL.

  • 6.

    Return LL.

Remark 7.9.

As in the similar situation in Algorithm 7.5, we can accomplish step (5)(b) by computing the roots of various irreducible polynomials of degree mm in a fixed copy of 𝐅qm{\mathbf{F}}_{q^{m}}, and [15, Theorem 1.2] shows that we can do this in time polynomial in logq\log q.

Proposition 7.10.

Algorithm 7.8 produces a complete set of unique representatives for the orbits of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) acting on the monic homogeneous degree-nn polynomials of the given Galois type. It runs in time O~(qn3)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{n-3}), measured in arithmetic operations in 𝐅q{\mathbf{F}}_{q}.

Proof.

The correctness of the algorithm is clear, because every PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbit of the given Galois type has a representative considered by the algorithm, and duplicates are prevented by steps (5)(b) and (5)(c).

For each mim_{i} in step (2), the time required to compute the list ImiI_{m_{i}} is O~(qmi)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{m_{i}}), and since minm1n3m_{i}\leq n-m_{1}\leq n-3 this is O~(qn3)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{n-3}). The time required for step (3) is O~(qm12)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{m_{1}-2}), and since m12n3m_{1}-2\leq n-3, this is also O~(qn3)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{n-3}). And in step (5), we consider O(qn3)O(q^{n-3}) tuples (f1,,fr)(f_{1},\ldots,f_{r}), and each takes time O~(1)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(1) to process. Thus, the total time required is as claimed. ∎

7.4. The case m1=nm_{1}=n

This is the first and only case in which we will require nn to be even. The case n=4n=4 is covered by Theorems 1.2 and 3.8, so we may assume that n6n\geq 6. Note that we cannot just apply Algorithm 4.3, because that takes time O~(qn2)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{n-2}), and we want an algorithm that takes time O~(qn3)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{n-3}).

Algorithm 7.11.

Orbit representatives for PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) acting on the elements of Symn(𝐅q)\operatorname{Sym}^{n}({\mathbf{F}}_{q}) of Galois type (n)(n), where n6n\geq 6 is even.

  • Input:

    A prime power qq and an even integer n6n\geq 6.

  • Output:

    A complete set of unique representatives for the action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) on the monic irreducible homogenous polynomials of degree nn.

  • 1.

    If n=6n=6, let MM be the list consisting of a single monic irreducible cubic homogeneous polynomial in 𝐅q2[x,y]{\mathbf{F}}_{q^{2}}[x,y].

  • 2.

    If n=8n=8, let MM be the list consisting of the monic irreducible quartic homogeneous polynomials in 𝐅q2[x,y]{\mathbf{F}}_{q^{2}}[x,y] given by Theorem 1.2 or Theorem 3.8 applied to the field 𝐅q2{\mathbf{F}}_{q^{2}}.

  • 3.

    If n10n\geq 10, use Algorithm 4.3 to create a list MM of orbit representatives for the action of PGL2(𝐅q2)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{2}}) acting on the monic irreducible homogeneous polynomials of degree n/2n/2 in 𝐅q2[x,y]{\mathbf{F}}_{q^{2}}[x,y].

  • 4.

    Let GG be the list of coset representative for the left action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) on PGL2(𝐅q2)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{2}}) from Proposition 5.1.

  • 5.

    Let NN be the list consisting of Γ(f)\Gamma(f), for all ΓG\Gamma\in G and ff in MM.

  • 6.

    Let LL be the list of all products gg(q)gg^{(q)} for gNg\in N, where the superscript (q)(q) means to raise each coefficient of a polynomial to the qqth power.

  • 7.

    Let LL^{\prime} be the list of all pairs (Crossf,f)(\operatorname{Cross}f,f) for fLf\in L.

  • 8.

    Sort LL^{\prime}, and then delete every entry (Crossf,f)(\operatorname{Cross}f,f) where Crossf\operatorname{Cross}f appears as the first element of an earlier entry in LL^{\prime}.

  • 9.

    Let L′′L^{\prime\prime} be the list of second elements of the entries in LL^{\prime}.

  • 10.

    Return L′′L^{\prime\prime}.

Proposition 7.12.

Algorithm 7.11 produces a complete set of unique representatives for the orbits of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) acting on the monic irreducible homogeneous polynomials of degree nn. It runs in time O~(qn3)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{n-3}), measured in arithmetic operations in 𝐅q{\mathbf{F}}_{q}.

Proof.

To prove correctness, we must show that the list L′′L^{\prime\prime} consists of unique representatives for each PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbit of irreducible polynomials of degree nn over 𝐅q{\mathbf{F}}_{q}. First we show that it contains at least one representative from each orbit.

We know that every monic irreducible homogeneous polynomial ff of degree nn in 𝐅q[x,y]{\mathbf{F}}_{q}[x,y] can be written gg(q)gg^{(q)} for a monic irreducible homogeneous polynomial gg in 𝐅q2[x,y]{\mathbf{F}}_{q^{2}}[x,y] of degree n/2n/2, and gg is unique up to gg(q)g\leftrightarrow g^{(q)}. If we can show that the list NN contains an element in every orbit of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) acting on the left on the set SS of monic irreducible homogeneous polynomials of degree n/2n/2 in 𝐅q2[x,y]{\mathbf{F}}_{q^{2}}[x,y], then that will show that LL contains at least one element in every orbit of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) acting on the monic irreducible homogeneous polynomials of degree nn in 𝐅q[x,y]{\mathbf{F}}_{q}[x,y]. But since MM is a list of representative for the orbits of PGL2(𝐅q2)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{2}}) acting on SS, and since GG consists of coset representatives for PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) acting on PGL2(𝐅q2)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{2}}), this is clear. Thus, LL contains a representative from each orbit of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) acting on the set of monic irreducible homogeneous polynomials of degree nn in 𝐅q[x,y]{\mathbf{F}}_{q}[x,y]. In fact, LL contains at most two such representatives for each orbit, because of the uniqueness of gg up to gg(q)g\leftrightarrow g^{(q)}.

By construction (and by Theorem 4.2), the list L′′L^{\prime\prime} contains at most one representative from each orbit of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) acting on the irreducible polynomials. But we already saw that it contains at least one such representative. Therefore, it is a complete list of unique representatives.

The only thing left to check is that the algorithm runs in time O~(qn3)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{n-3}). Steps (1) through (3) take time at most O~((q2)(n/22))=O~(qn4)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}((q^{2})^{(n/2-2)})=\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{n-4}). Step (4) takes time O(q3)O(q^{3}), and step (5) takes time O~(qn3)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{n-3}) because there are O(q3)O(q^{3}) elements of GG and O(qn6)O(q^{n-6}) elements of MM. Steps (6) through (9) also take time O~(qn3)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{n-3}), because the lists NN, LL, and LL^{\prime} contain O(qn3)O(q^{n-3}) elements. ∎

8. Additional efficiencies

In this section we mention a few ways that the algorithms in Section 7 can be improved. The asymptotic complexity of the revised algorithms is still O~(qn3)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{n-3}), but the speedups in this section improve the algorithms by constant factors.

8.1. Avoiding repeated orbits

Several of our algorithms include a step to deal with elements of Symn(𝐅q)\operatorname{Sym}^{n}({\mathbf{F}}_{q}) that can be normalized (in the manner of the particular algorithm) in several ways. This happens in steps (2)(b) and (c) of Algorithm 7.1, in steps (3)(b) and (c) of Algorithm 7.3, in steps (4)(b) and (c) of Algorithm 7.5, and in steps (5)(b) and (c) of Algorithm 7.8. In Algorithm 7.8, for example, this is needed when there is more than one occurrence of the number m1m_{1} in the Galois type. The algorithm normalizes elements of Symn(𝐅q)\operatorname{Sym}^{n}({\mathbf{F}}_{q}) of the given Galois type (represented by monic homogeneous polynomials of degree nn) by absorbing all of the action of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) into one factor of degree m1m_{1}. If there is more than one such factor, there is more than one normalization of the same polynomial, and the algorithm has to identify the resulting repeated orbits and return only one of them. (There is also more than one normalization if a factor of degree m1m_{1} has nontrivial PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) stabilizer, but that is rare.)

The most straightforward way to avoid this situation is to handle Galois types with m1m_{1} occurring more than once in a different way. For instance, if we are working with the Galois type (4,4,3,1)(4,4,3,1), instead of normalizing on the factors of degree 44 (for which there are two choices), we can instead normalize on the factor of degree 33. This technique can be used to handle every Galois type that includes at least one value of mm that is at least 33 and that occurs just once in the type. Similarly, if the value 22 occurs in a type exactly twice, we can normalize the product of two irreducible quadratics.

If we have a Galois type with m13m_{1}\geq 3 where this is impossible — for example, (4,4,3,3)(4,4,3,3) — we have another option. We use a modified version of Algorithm 4.3 where we skip step (5); this gives us a list of all monic irreducible polynomials of degree m1m_{1}, grouped by their cross polynomials. Then, in Algorithm 7.8, in step (5) we do not consider all sets of distinct polynomials {f2,,fr}\{f_{2},\ldots,f_{r}\}; instead, we demand that the cross polynomial of every fif_{i} whose degree is equal to m1m_{1} not appear earlier on the sorted list that that of f1f_{1}. If in fact all of the additional cross polynomials are different from the cross polynomial of f1f_{1}, the orbit representative we obtain will not be repeated unless the PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) stabilizer of f1f_{1} is nontrivial, which is unusual (and easy to check). If some of the additional cross polynomials are the same as that of f1f_{1}, then we keep track of this orbit on a separate list, and deduplicate this (much smaller) list separately.

8.2. Treating the Galois types (n1,1)(n-1,1) and (n2,1,1)(n-2,1,1) more efficiently

Consider the Galois type (n1,1)(n-1,1), corresponding to a product of a linear homogeneous polynomial with an irreducible homogeneous polynomial of degree n1n-1. Instead of absorbing all the PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) action into the choice of the irreducible polynomial of degree n1n-1, we can instead demand that the linear polynomial have its zero at \infty. Then we have to find representatives for irreducible homogeneous polynomials of degree n1n-1 up to the ax+bax+b group. We can accomplish this by modifying the technique of Algorithm 4.3: We construct a copy of 𝐅qn1{\mathbf{F}}_{q^{n-1}}, we choose a basis (β1,,βn1)(\beta_{1},\ldots,\beta_{n-1}) such that β1\beta_{1} appears with a nonzero coefficient in the representation of 11, and then we simply list the minimal polynomials of elements whose representation on the given basis begins (0,,0,1,)(0,\ldots,0,1,\ldots), with at least one 0 at the beginning and with the first nonzero element being 11. We can also take care to produce only one element from each Galois orbit at this stage, in order to avoid using cross polynomials to deduplicate the list later.

For the Galois type (n2,1,1)(n-2,1,1), we look for orbit representatives of the form xyfxyf for irreducible homogeneous ff of degree n2n-2. We can modify ff only by replacing (x,y)(x,y) with (cx,y)(cx,y) or (cy,x)(cy,x), so we can construct a copy of 𝐅qn2{\mathbf{F}}_{q^{n-2}} with basis (β1,,βn2)(\beta_{1},\ldots,\beta_{n-2}), list the minimal polynomials of the elements whose representations on the given basis have their first nonzero element equal to 11, and then deduplicate as usual.

8.3. More efficient computations of PGL2\operatorname{PGL}_{2} orbits of irreducibles

In step (3) of Algorithm 7.8, we obtain a list of orbit representatives for irreducible polynomials of a given degree mm by using Algorithm 4.3. If mm is composite, we can use a more efficient algorithm based on the idea of Algorithm 7.11. Namely, if m=pmm=pm^{\prime}, we can compute orbit representatives for PGL2(𝐅qp)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{p}}) acting on irreducible polynomials in 𝐅qp[x]{\mathbf{F}}_{q^{p}}[x] of degree mm^{\prime}, and then use Proposition 5.1 or Proposition 6.1 to list coset representatives for PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) in PGL2(𝐅qp)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{p}}). As in Algorithm 7.11, we can combine these two lists to get a complete list of unique orbit representatives for PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) acting on irreducible polynomials of degree nn.

In fact, what we have just shown is that if nn is composite, we can compute a complete set of unique representatives for the orbits of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) acting on the monic irreducible homogeneous polynomials of degree nn in time O~(qn3)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{n-3}). This leaves open the case when nn is prime. In a followup paper [9], we explain a completely different technique that will produce these orbit representatives for prime nn — indeed, for odd nn — in time O~(qn3)\mathchoice{\accentset{\displaystyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\textstyle\text{\smash{\raisebox{-6.02773pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptstyle\text{\smash{\raisebox{-4.2194pt}{$\widetildesym$}}}}{O}}{\accentset{\scriptscriptstyle\text{\smash{\raisebox{-3.01385pt}{$\widetildesym$}}}}{O}}(q^{n-3}), but no longer deterministically, because the method relies on factoring polynomials of bounded degree in polynomial time.

9. Implementations for genus 22 and genus 33

We have implemented our algorithm for hyperelliptic curves of genus 22 and genus 33 in Magma [2]. Magma files with the implementations can be found in several places: in the ancillary files attached the the arXiv version of this paper, on the author’s web page, and in the GitHub repository associated to this paper [10]. In addition to the improvements described in Section 8 and others of a similar nature, our code for the genus-22 case includes an improvement for the Galois type (6)(6) that allows us to skip the deduplication step in Algorithm 7.11. The basic idea is to choose the irreducible cubic polynomial in step (1) of Algorithm 7.11 so that it lies in 𝐅q[x,y]{\mathbf{F}}_{q}[x,y] and so that its zeros are permuted by the order-33 element [0111]\bigl{[}\begin{smallmatrix}0&-1\\ 1&-1\end{smallmatrix}\bigr{]} of PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}), so that it is easier to keep track of which elements of PGL2(𝐅q2)\operatorname{PGL}_{2}({\mathbf{F}}_{q^{2}}) in GG give rise to homogeneous sextic polynomials f𝐅q[x,y]f\in{\mathbf{F}}_{q}[x,y] that lie in the same PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbit. The details are too lengthy to include here, but are spelled out in the comments in the code, as well as in the followup paper [9]. Other improvements are described in the comments as well.

For our genus-33 implementation, we did not spend as much time optimizing, and there are very likely improvements that can be made.

Table 1. Sample timings (in seconds) to compute all hyperelliptic curves of genus 22 and 33 over 𝐅q{\mathbf{F}}_{q}. The second column gives timings for Magma’s built-in routines for genus 22. The third through fifth columns give timings for the techniques of this paper: the third for computing PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbit representatives of Sym6(𝐅q)\operatorname{Sym}^{6}({\mathbf{F}}_{q}), the fourth for computing genus-22 curves from these representatives, and the fifth for the total time for both. Similarly, the sixth through ninth columns give timings for computing genus-33 curves. Timings marked with an asterisk are estimates.
Genus 2 Genus 3
This paper This paper
qq Magma Sym6\operatorname{Sym}^{6} Curves Total Magma Sym8\operatorname{Sym}^{8} Curves Total
1717 7.97.9 0.160.16 0.020.02 0.180.18 52745274 20\phantom{0}\phantom{0}20 1\phantom{0}\phantom{0}1 21\phantom{0}\phantom{0}21
3131 52.752.7 0.770.77 0.060.06 0.830.83 9946399463\hbox to0.0pt{${}^{*}$\hss} 304\phantom{0}304 14\phantom{0}14 318\phantom{0}318
5959 327.1327.1 3.853.85 0.250.25 4.104.10 24086652408665\hbox to0.0pt{${}^{*}$\hss} 59325932 479479 64116411
127127 33083308\phantom{.0} 3636\phantom{.00} 22\phantom{.00} 3838\phantom{.00}
257257 2744827448\hbox to0.0pt{${}^{*}$\hss}\phantom{.0} 290290\phantom{.00} 1010\phantom{.00} 300300\phantom{.00}
509509 211655211655\hbox to0.0pt{${}^{*}$\hss}\phantom{.0} 23072307\phantom{.00} 7676\phantom{.00} 23842384\phantom{.00}

We ran some timing experiments to compare our Magma code to the built-in Magma functions that implement the algorithms of Mestre [19] and Cardona and Quer [4] for genus-22 curves, and the algorithms of Lercier and Ritzenthaler [16] for genus-33 curves. We give some sample timings in Table 1, taken by running Magma (V2.28-8) on one core of an Apple M1 Max processor with 64GB RAM. For our algorithm, we divide our timings into two steps: computation of the PGL2(𝐅q)\operatorname{PGL}_{2}({\mathbf{F}}_{q}) orbit representatives of Sym2g+2(𝐅q)\operatorname{Sym}^{2g+2}({\mathbf{F}}_{q}) and computation of the isomorphism classes of curves. Our algorithm includes a computation of the automorphism groups of the curves, which gives us a consistency check, since the sum over all hyperelliptic curves of genus gg over 𝐅q{\mathbf{F}}_{q} of 11 over the size of the automorphism group is equal to q2g1q^{2g-1} [3, Proposition 7.1].

We compare our genus-22 timings to those of applying the Magma command

Twists(HyperellipticCurveFromG2Invariants([a,b,c]))

to all triples (a,b,c)(a,b,c) of elements of 𝐅q{\mathbf{F}}_{q} and then retrieving the polynomials that define the resulting curves. For q>127q>127 we estimate the time for the Magma builtin functions by running the above command on 10,00010{,}000 random triples (a,b,c)(a,b,c) and multiplying the time taken by q3/104q^{3}/10^{4}; these estimates are indicated with asterisks. We see that our genus-22 code is running approximately 9090 times faster than Magma’s internals.

We compare our genus-33 timings to those of applying the Magma command

TwistedHyperellipticPolynomialsFromShiodaInvariants(S)

to all Shioda invariants with nonzero discriminants, obtained by applying

ShiodaAlgebraicInvariants(V : ratsolve := true)

to every element VV of the 55-dimensional weighted projective space over 𝐅q{\mathbf{F}}_{q} with weights [2,3,4,5,6,7][2,3,4,5,6,7] and discarding those with discriminant 0. For q=31q=31 and q=59q=59 we estimate Magma’s times as before. It appears that our genus-33 code is running several hundred times faster than Magma’s internals.

For genus-22 curves over 𝐅509{\mathbf{F}}_{509}, our code spent 42.46%42.46\% of the time on Galois type (6)(6), 16.06%16.06\% on type (3,3)(3,3), and 12.55%12.55\% on type (5,1)(5,1), with the remaining 29%29\% of the time divided among the remaining eight types. For genus-33 curves over 𝐅59{\mathbf{F}}_{59}, our code spent 26.49%26.49\% of the time on Galois type (7,1)(7,1), 25.77%25.77\% on type (8)(8), 19.45%19.45\% on type (2,2,2,2)(2,2,2,2), and 7.87%7.87\% on type (4,4)(4,4), with the remaining 20%20\% of the time divided among the remaining eighteen types.

We note that memory handling issues may have slowed the genus-33 computation for q=59q=59, which reemphasizes the point, made in the introduction, that it would be good to have a version of our algorithm for higher genera that requires less space. We have not yet implemented the low-memory algorithm from [9] to see whether that will help improve our timings for larger qq.

References