Sato-Tate distributions of twists of the Fermat and the Klein quartics

We determine the limiting distribution of the normalized Euler factors of an abelian threefold A defined over a number field k when A is geometrically isogenous to the cube of a CM elliptic curve defined over k. As an application, we classify the Sato-Tate distributions of the Jacobians of twists of the Fermat and Klein quartics, obtaining 54 and 23, respectively, and 60 in total. We encounter a new phenomenon not visible in dimensions 1 or 2: the limiting distribution of the normalized Euler factors is not determined by the limiting distributions of their coefficients.

; its roots come in complex conjugate pairs and lie on the unit circle, as shown by Weil in [36].
As constructed by Serre in [26], the Sato-Tate group ST(A) is a compact real Lie subgroup of USp(2g), defined up to conjugacy in GL 2g (C), that comes equipped with a map that assigns to each prime p / ∈ S a semisimple conjugacy class s This conjecture has been proved for abelian varieties of dimension one (elliptic curves) over a totally real [15] or CM number field [1], and in several special cases for abelian varieties of higher dimension, including abelian varieties with potential CM [19].
For each s ∈ X, we write det(1 − sT ) =: For 0 ≤ j ≤ 2g we have a j ∈ I j and a j = a 2g−j for 0 ≤ j ≤ 2g, since the eigenvalues of any conjugacy class of USp(2g) come in complex conjugate pairs on the unit circle. Consider the maps where is defined by (s) = (a 1 , . . . , a g ) and j is the projection to the jth component. Let μ I (resp. μ I j ) denote the projection of the measure μ by the map (resp. j ). We will call μ I the joint coefficient measure and the set of measures {μ I j } j , the independent coefficient measures. The measures μ I and μ I j are, respectively, determined by their moments M n 1 ,...,n g [μ I ] := I a n 1 1 · · · a n g g μ I (a 1 , . . . , a g ), M n [μ I j ] := I j a n j μ I j (a j ), (1.1) for n 1 , . . . , n g ≥ 0 and n ≥ 0. We denote by a j (A)(p), or simply a j (p), the jth coefficient j (s(p)) of the normalized L-polynomial, and by a(A)(p), or simply a(p), the g-tuple (s(p)) of coefficients of the normalized L-polynomial. We can now consider the following successively weaker versions of the generalized Sato-Tate conjecture: (ST ) The sequence {a(p)} p is equidistributed on I with respect to μ I . (ST ) The sequences {a j (p)} p are equidistributed on I j with respect to μ I j , for 1 ≤ j ≤ g. Let A be an abelian variety defined over a number field k also of dimension g, and let X , μ , μ I , μ I j be the data associated with A corresponding to X, μ, μ I , μ I j , respectively. The following implications are immediate: (1. 3) The classification of Sato-Tate groups of elliptic curves and abelian surfaces together with the explicit computation of their Haar measures implies that for g ≤ 2 the converses of the implications in (1.3) both hold; see [10]. In this article, we show that for g = 3, there are cases in which the converse of the second implication of (1.3) fails to hold. 1 Main result. In this article, we obtain the counterexamples alluded to in the previous paragraph by searching among abelian threefolds defined over a number field that are Q-isogenous to the cube of an elliptic curve with complex multiplication (CM). More precisely, we obtain a complete classification of the Sato-Tate groups, the joint coefficient measures, and the independent coefficient measures of the Jacobians of twists of the Fermat and the Klein quartics (which are both Q-isogenous to the cube of a CM elliptic curve). The Fermat and Klein quartics are, respectively, given by the equations C 0 1 : x 4 + y 4 + z 4 = 0,C 0 7 : x 3 y + y 3 z + z 3 x = 0, (1.4) and they have the two largest automorphism groups among all genus 3 curves, of sizes 96 and 168, respectively. Our main result is summarized in the following theorem.

Theorem 1 The following hold:
(i) There are 54 distinct Sato-Tate groups of twists of the Fermat quartic. These give rise to 54 (resp. 48) distinct joint (resp. independent) coefficient measures. (ii) There are 23 distinct Sato-Tate groups of twists of the Klein quartic. These give rise to 23 (resp. 22) distinct joint (resp. independent) coefficient measures. (iii) There are 60 distinct Sato-Tate groups of twists of the Fermat or the Klein quartics.
One motivation for our work is a desire to extend the classification of Sato-Tate groups that is known for dimensions g ≤ 2 to dimension 3. Of the 52 Sato-Tate groups that arise for abelian surfaces (see [10, Table 10] for a list), 32 can be realized as the Sato-Tate group of the Jacobian of a twist of one of the two genus 2 curves with the largest automorphism groups, as shown in [12]; these groups were the most difficult to treat in [10] and notably include cases missing from the candidate list of trace distributions identified in [21,Table 13]. While the classification of Sato-Tate groups in dimension 3 remains open, the 60 Sato-Tate groups identified in Theorem 1 and explicitly described in Sect. 3.3 are likely to include many of the most delicate cases and represent significant progress toward this goal.
Overview of the paper. This article can be viewed as a genus 3 analog of [12], where the Sato-Tate groups of the Jacobians of twists of the curves y 2 = x 5 − x and y 2 = x 6 + 1 were computed. However, there are two important differences in the techniques we use here; these are highlighted in the paragraphs below that outline our approach. We also note [13], where the Sato-Tate groups of the Jacobians of certain twists of the genus 3 curves y 2 = x 7 − x and y 2 = x 8 + 1 are computed, and [2], where the Sato-Tate groups of the Jacobians of twists of the curve y 2 = x 8 − 14x 4 + 1 are determined. Like the Fermat and Klein quartics we consider here, these three curves represent extremal points in the moduli space of genus 3 curves, but they are all hyperelliptic, and their automorphism groups are smaller (of order 24, 32, 48, respectively).
As noted above, the Sato-Tate conjecture is known for abelian varieties that are Qisogenous to a product of CM abelian varieties [19,Cor. 15]. It follows that we can determine the set of independent coefficient measures {μ I j } j by computing the sequences {M n [a j ]} j,n , and similarly for μ I and the sequences {M n 1 ,...,n g [a]} n 1 ,...,n g . Closed formulas for these sequences are determined in Sect. 2 in the more general setting of abelian threefolds defined over a number field k that are Q-isogenous to the cube of an elliptic curve defined over k; see Proposition 2.2 and Corollary 2.4. This analysis closely follows the techniques developed in [12, §3].
In Sect. 3, we specialize to the case of Jacobians of twists of the Fermat and Klein quartics. In Sect. 3.2, we obtain a complete list of possibilities for {M n [a j ]} j,n : there are 48 in the Fermat case, 22 in the Klein case, and 54 when combined; see Corollary 3.12. We also compute lower bounds on the number of possibilities for {M n 1 ,n 2 ,n 3 [a]} n 1 ,n 2 ,n 3 by computing the number of possibilities for the first several terms (up to a certain conveniently chosen bound) of this sequence. These lower bounds are 54 in the Fermat case, 23 in the Klein case, and 60 when combined; see Proposition 3.13.
The first main difference with [12] arises in Sect. 3.3, where we compute the Sato-Tate groups of the twists of the Fermat and Klein quartics using the results of [3]. Such an analysis would have been redundant in [12], since a complete classification of Sato-Tate groups of abelian surfaces was already available from [10]. We show that there are at most 54 in the Fermat case, and at most 23  The second main difference with [12] arises in Sect. 3.4, where we provide explicit equations of twists of the Fermat and Klein quartics that realize each of the possible Sato-Tate groups. Here, the computational search used in [12] is replaced by techniques developed in [22,23] that involve the resolution of certain Galois embedding problems, and a moduli interpretation of certain twists X E (7) of the Klein quartic as twists of the modular curve X(7), following [14]. In order to apply the latter approach, which also plays a key role in [25], we obtain a computationally effective description of the minimal field over which the automorphisms of X E (7) are defined (see Propositions 3.34 and 3.35), a result that may have other applications.
Finally, in Sect. 3.5, we give an algorithm for the efficient computation of the Lpolynomials of twists of the Fermat and Klein quartics. This algorithm combines an average polynomial-time for computing Hasse-Witt matrices of smooth plane quartics [18] with a result specific to our setting that allows us to easily derive the full L-polynomial at p from the Frobenius trace using the splitting behavior of p in certain extensions; see Proposition 3.38. Our theoretical results do not depend on this algorithm, but it played a crucial role in our work by allowing us to check our computations and may be of independent interest.
Notation. Throughout this paper, k denotes a number field contained in a fixed algebraic closure Q of Q. All the field extensions of k, we consider are algebraic and assumed to lie in Q. We denote by G k the absolute Galois group Gal(Q/k). For an algebraic variety X defined over k and a field extension L/k, write X L for the algebraic variety defined over L obtained from X by base change from k to L. For abelian varieties A and B defined over k, we write A ∼ B if there is an isogeny from A to B that is defined over k. We use M T to denote the transpose of a matrix M. We label the isomorphism class ID(H) = n, m of a finite group H according to the Small Groups Library [4], in which n is the order of H and m distinguishes the isomorphism class of H from all other isomorphism classes of groups of order n.

Equidistribution results for cubes of CM elliptic curves
Let A be an abelian variety over k of dimension 3 such that A Q ∼ E 3 Q , where E is an elliptic curve defined over k with complex multiplication (CM) by an imaginary quadratic field M. Let L/k be the minimal extension over which all the homomorphisms from E Q to A Q are defined. We note that kM ⊆ L, and we have Hom(E Q , A Q ) Hom(E L , A L ) and A L ∼ E 3 L . Let σ and σ denote the two embeddings of M into Q. Consider where the tensor product is taken via the embedding σ : M → Q. Letting Gal(L/kM) act trivially on Q, it acquires the structure of a Q[Gal(L/kM)]-module of dimension 3 (resp. 9) over Q, and similarly for σ . For each τ ∈ Gal(L/kM), we write so that a 1 (θ ) = − Tr θ and a 3 (θ) = − det(θ ).

Remark 2.3
In the statement of the proposition, we included the hypothesis that a 3 (θ ) is rational, which is satisfied for Jacobians of twists of the Fermat and Klein curves (see Section 3.1), because this makes the formulas considerably simpler. This hypothesis is not strictly necessary; one can similarly derive a more general formula without it.

Corollary 2.4 Let A be an abelian variety of dimension 3 defined over k with
where E is an elliptic curve defined over k with CM by the quadratic imaginary field M, with k = kM. Suppose that a 3 (θ )(τ ) is rational for τ ∈ G := Gal(L/kM). Then, i with respect to a measure that is continuous up to a finite number of points and therefore uniquely determined by its moments. For n ≥ 1, Here, o(n) denotes the number of elements in Gal(L/k) not in G of order n, and r 1 (τ ) and r 2 (τ ) are the real and imaginary parts of a 3 (θ )(τ )a 2 (θ )(τ )a 1 (θ )(τ ), respectively.
Proof For primes of k that split in kM, we invoke Proposition 2.2. Let N be such that τ N = 1 for every τ ∈ Gal(L/k) \ G (the present proof shows a posteriori that one can take N = 24, but for the moment it is enough to know that such an N exists). For primes p of k that are inert in kM, we will restrict our analysis to those also satisfy: (a) p has absolute residue degree 1, that is, where ζ 4N is a primitive 4N th root of unity.
These conditions exclude only a density zero set of primes and thus do not affect the computation of moments. Now define D(T, τ ) := det(1 − θ Q (E, A)(τ )T ) for τ ∈ Gal(L/k) \ G, and let p be such that Frob p = τ . In the course of the proof of [12,Cor. 3.12], it is shown that: Since L p (E, T ) = 1 + T 2 and the roots of D(T, τ ) are N th roots of unity, it follows from (i) that the roots of L p (A, T ) are 4N th roots of unity. In particular, a 1 (A)(p), a 2 (A)(p), which combined with (c) implies a 1 (A)(p) = a 3 (A)(p) = 0. This yields the desired moment formulas for a 1 (A k ) and a 3 (A k ), leaving only a 2 (A k ) to consider. From (2.5), we see that L(A, T ) has rational coefficients. Both L p (E, T ) and D(T, τ ) have integer coefficients, hence so does L p (E, θ Q (E, A), T ). Moreover, L p (E, θ Q (E, A), T ) is also primitive, which by (i) and Gauss' Lemma implies that L(A, T ) has integer coefficients. The Weil bounds then imply (see [20,Prop. 4], for example) that the polynomial L p (A, T ) has the form 1 + aT 2 + aT 4 + T 6 =: P a (T ), (2.6) form some a ∈ {−1, 0, 1, 2, 3}. To compute the moments of a 2 (A k ), it remains only to determine how often each value of a occurs as τ ranges over G. We have (2.7) The integer ord(τ ) is even and then condition (ii) and the specific shape of the P a (T ) imply that the only possible orders of τ are 2, 4, 6, 8, 12. If ord(τ ) = 2, then all the roots of L p (E, θ Q (E, A), T ) are of order 4. By (i), so are the roots of P a (T ), and (2.7) implies that a = 3. If ord(τ ) = 4, then all the roots of L p (E, θ Q (E, A), T ) are of order dividing 4. Thus so are the roots of P a (T ), which leaves the two possibilities a = −1 or a = 3. But (ii) implies that the latter is not possible: if a = 3, then the roots of D(T, τ ) would all be of order dividing 2 and this contradicts the fact that τ has order 4. Thus a = −1.
If ord(τ ) = 6, then by (ii) we have a = −1, 1, 3 (otherwise the order of τ would not be divisible by 3). If a = 2, then again by (ii) the polynomial D(T, τ ) would have a root of order at least 12, which is impossible for ord(τ ) = 6. Thus a = 0.
If ord(τ ) = 8, then L p (E, θ Q (E, A), T ) has at least 8 roots of order 8 and thus P a (T ) has at least a root of order 8. Thus a = 1.

The Fermat and Klein quartics
The Fermat and the Klein quartics admit models over Q given by the equationsC 0 1 andC 0 7 of (1.4), respectively. The Jacobian ofC 0 1 is Q-isogenous to the cube of an elliptic curve defined over Q (see Proposition 3.1), but this is not true forC 0 7 , which leads us to choose a different model for the Klein quartic. Let us define C 0 1 :=C 0 1 and C 0 7 : x 4 + y 4 + z 4 + 6(xy 3 The model C 0 7 is taken from [7, (1.22)], and its Jacobian is Q-isogenous to the cube of an elliptic curve defined over Q, as we will prove below. One can explicitly verify that the curve C 0 7 is Q-isomorphic to the Klein quartic by using (3.3) below to show that One similarly verifies that C 0 1 is Q-isomorphic to the Fermat quartic by using (3.2) below to show ID(Aut((C 0 1 ) Q(i) )) 96, 64 .
Let E 0 1 and E 0 7 be the elliptic curves over Q given by the equations with Cremona labels 64a4 and 49a3, respectively. We note that j(E 0 1 ) = 2 6 · 3 3 and j(E 0 7 ) = −3 3 · 5 3 , thus E 0 1 has CM by the ring of integers of Q(i), and E 0 7 has CM by the ring of integers of Q( √ −7). For future reference, let us fix some notation. The automorphisms Thus there exists an abelian surface B defined over Q with Jac(C 0 Then, the subgroup s 1 , t 1 ⊆ Aut(C 0 1 ), isomorphic to the symmetric group on 4 letters S 4 , would inject into (End(Jac(C 0 1 )) ⊗ C) × . There are two options for this C-algebra: it is either GL 1 (C) r or GL 2 (C) × GL 1 (C) s , with r, s ∈ Z ≥0 . In either case, we reach a contradiction with the fact that S 4 has no faithful representations whose irreducible constituents have degrees at most 2. Thus, E 0 1 is a Q-factor of B and Jac(C 0 , we may reproduce the argument above to show that Jac(C 0 where E, E , and E are either E 0 7 or E 0 7 ⊗ χ, where χ is the quadratic character of M. But E 0 7 ⊗ χ ∼ E 0 7 , since E 0 7 has CM by M, and the result follows.
Remark 3.2 To simplify notation, for the remainder of this article d is either 1 or 7, and we write , and s, t, u for s d , t d , u d . When d is not specified, it means we are considering both values of d simultaneously.

Twists
, is a representative of the cohomology class corresponding to C. Let K /k (resp. L/k) denote the minimal extension over which all endomorphisms of Jac(C) Q (resp. all homomorphisms from Jac(C) Q to E 0 Q ) are defined. LetK /k (resp.L/k) denote the minimal extension over which all automorphisms of C Q (resp. all isomorphisms from C Q to C 0 Q ) are defined. .12) and (3.13). From the proof of Proposition 3.1, we know that Jac(C)K ∼ E 3 , where E is an elliptic curve defined overK with CM by M. This implies K =K M and L =LM, as in the proof of [12,Lem. 4.2].

Lemma 3.3 We have the following inclusions and equalities of fields:
We now associate with C 0 a finite group G 0 that will play a key role in the rest of the article.
where Gal(M/Q) acts on Aut(C 0 M ) in the obvious way (coefficient-wise action on rational maps). It is straightforward to verify that We remark that G C 0 7 PGL(F 7 ).
As in [12, §4.2], we have a monomorphism of groups where Res k kM λ φ denotes the restriction of λ φ from Gal(L/k) to Gal(L/kM).

Lemma 3.5 Let C be a twist of C 0 . Then:
Tr Table 3a), Table 3b).
Proof In the proof of Lemma 3.18, we will construct an explicit embedding In this basis, with the above embedding the representation θ E 0 ,C 0 is given by where A s , A t , and A u are as in (3.12) and (3.13). The lemma follows.

Proposition 3.7 The fields K and L coincide. 3
Proof Note that L/K is the minimal extension over which an isomorphism between E 0 Q and E Q is defined. It follows that L = K (γ 1 /n ) for some γ ∈ K , with n = 4 for d = 1 and n = 2 for d = 7; see [28,Prop. X.5.4]. In either case, Gal(L/K ) is cyclic of order dividing 4 (note that Q(ζ n ) ⊆ K ). Suppose that L = K , let ω denote the element in Gal(L/K ) of order 2, and write K 0 = L ω . Fix an isomorphism ψ 1 : E 0 L → E L and an isogeny ψ 2 : Remark 3.8 By Proposition 3.7, and the identities (2.3) and (3.5), the independent and joint coefficient measures of Jac(C) depend only on the conjugacy class of λ φ (Gal(K /k)) in G C 0 . In Proposition 3.22, we will see that this also applies to the Sato-Tate group of Jac(C). For this reason, henceforth, subgroups H ⊆ G C 0 will be considered only up to conjugacy.
Noting that [G C 0 : G 0 ] = 2, for any subgroup H of G C 0 there are two possibilities: Remark 3. 10 We make the following observations regarding H ⊆ G C 0 and cases (c 1 ) and (c 2 ): . From the definition of λ φ , we must then have H 0 = λ φ (Gal(K /kM)). The case (c 1 ) corresponds to kM = k, and the case (c 2 ) corresponds to k = kM. (ii) There are 83 subgroups H ⊆ G C 0 1 up to conjugacy, of which 24 correspond to case (c 1 ) and 59 correspond to case (c 2 ). In Table 4 we list the subgroups in case (c 2 ). For any subgroup H in case (c 1 ), there exists a subgroup H in case (c 2 ) such that H 0 = H; thus the subgroups in case (c 1 ) can be recovered from Table 4 by looking at the column for H 0 . (iii) There are 23 subgroups H ⊆ G C 0 7 up to conjugacy, of which 12 correspond to case (c 1 ) and 11 correspond to case (c 2 ). For all but 3 exceptional subgroups H in case (c 1 ), there exists a subgroup H in case (c 2 ) such that H 0 = H. In Table 5, we list the subgroups in case (c 2 ) as well as the 3 exceptional subgroups, which appear in rows #3, #8, and #12 of Table 5. As in (ii), the non-exceptional subgroups in case (c 1 ) can be recovered from Table 5 by looking at the column for H 0 , which for the exceptional groups is equal to H. Tables 4 and 5 are presented as follows. First, generators of H 0 ⊆ G 0 Aut(C 0 M ) are given in terms of the generators s, t, u for Aut(C 0 M ) listed in (3.2) and (3.3). For the 3 exceptional subgroups of Table 5 we necessarily have H = H 0 , and for the others, H is identified by listing an element h ∈ Aut(C 0 M ) such that where τ is the generator of Gal(M/Q).

Moment sequences
We continue with the notation of Sect. 3.1. If C is a k-twist of C 0 , we define the joint and independent coefficient moment sequences where a(C) and a j (C) denote a(Jac(C)) and a j (Jac(C)), respectively, as defined in Sect. 1; recall that these moment sequences are defined by and uniquely determine corresponding measures μ I and μ I j , respectively. Using Lemma 3.5 and (3.5), we can apply Corollary 2.4 to compute the moments M n [a j (C)] for any n, and as explained in Sect. 3.2.2, it is easy to compute M n 1 ,n 2 ,n 3 [a(C)] for any particular values of n 1 , n 2 , n 3 . Magma scripts [6] to perform these computations are available at [11], which we note depend only on the pairs (H, H 0 ) (or just H 0 when k = kM) listed in Tables 4 and 5, and are otherwise independent of the choice of C.

Independent coefficient moment sequences
We now show that for any twist of the Fermat or Klein quartic, each of the independent coefficient moment sequences (and hence the corresponding measures) is determined by the first several moments.

Proposition 3.11
Let C and C be k-twists of C 0 . For each i = 1, 2, 3 there exists a positive integer N i such that if Moreover, one can take N 1 = 6, N 2 = 6, N 3 = 10.
For the Fermat case, with the notation for conjugacy classes as in Table 3a, let x 1 (resp. x 2 , x 3 , x 4 , x 5 ) denote the proportion of elements in Gal(L/k) lying in the conjugacy class 1a (resp. 2a ∪ 2b ∪ 4c ∪ 4d, 3a, 4a ∪ 4b, 8a ∪ 8b); note that by Lemma 3.5, we are interested in the representation with character χ 8 listed in Table 3a, which motivates this partitioning of conjugacy classes.
Let y 1 (resp. y 2 , y 3 ) denote the proportion of elements in Gal(L/k) which do not lie in Gal(L/kM) and have order 2 (resp. 4,8). Applying Corollary 2.4, one finds that for n ≥ 1 we have Evaluating (3.7) at n = 1, 2, 3 yields an invertible linear system in In the Klein case one proceeds analogously. With the notation of Table 3b, let x 1 (resp. x 2 , x 3 , x 4 ) denote the proportion of elements in Gal(L/k) lying in the conjugacy class 1a (resp. 2a ∪ 4a, 3a, 7a ∪ 7b), and let y 1 , y 2 , y 3 be as in the Fermat case. Now . These proportions are, as before, determined by the first several moments (never more than are needed in the Fermat case), and the result follows. We spare the reader the lengthy details.
With Proposition 3.11 in hand we can completely determine the moment sequences M n [a i (C)] that arise among k-twists C of C 0 by computing the moments M n [a i (C)] for n ≤ N i for the 59 pairs (H, H 0 ) listed in Table 4 in the case C 0 = C 0 1 , and for the 14 pairs (H, H 0 ) listed in Table 5 (as described in Remark 3.10). Note that each pair (H, H 0 ) with H = H 0 gives rise to two moments sequences M n [a i (C)] for each i, one with k = kM and one with k = kM.
After doing so, one finds that in fact Proposition 3.11 remains true with N 2 = 4 and N 3 = 4. The value of N 1 cannot be improved, but one also finds that the sequences M n [a 2 (C)] and M n [a 3 (C)] together determine the sequence M n [a 1 (C)], and in fact just two well-chosen moments suffice.  Table 6 for each of the 60 distinct joint coefficient moment measures obtained in the next section (this includes all the independent coefficient measures).

Joint coefficient moments
Instead of giving closed formulas for M n 1 ,n 2 ,n 3 [a(C)], analogous to those derived for M n [a j (C)] in Corollary 2.4, let us explain how to compute M n 1 ,n 2 ,n 3 [a(C)] for specific values of n 1 , n 2 , n 3 (this will suffice for our purposes). Suppose k = kM (the other case is similar). By (2.3), we may naturally regard the quantity a 1 (C) n 1 a 2 (C) n 2 a 3 (C) n 3 (3.8) as an element of the formal polynomial ring Q[α 1 ,ᾱ 1 ]/(α 1ᾱ1 − 1). The moment M n 1 ,n 2 ,n 3 [a(C)] is simply the constant term of (3.8). For N ≥ 0 and each pair (H, H 0 ) in Tables 4 and 5, one can then compute truncated joint moment sequences By explicitly computing M ≤4 joint (C) for all the pairs (H, H 0 ) listed in Tables 4 and 5, we obtain the following proposition. Computing M ≤N joint (C) with N = 5, 6, 7, 8, does not increase any of the lower bounds in Proposition 3.13, leading one to believe they are tight. We will prove this in the next section, but an affirmative answer to the following question would make it easy to directly verify such a claim. for all n 1 + · · · + n g ≤ N g , then (3.9) holds for all n 1 , . . . , n g ≥ 0. Is there an explicit and effectively computable upper bound for N g ?
Lacking an answer to Question, 3.14, in order to determine the exact number of distinct joint coefficient measures, we take a different approach. In the next section, we will classify the possible Sato-Tate groups of twists of the Fermat and Klein quartics. This classification yields an upper bound that coincides with the lower bound of Proposition 3.13. Table 6 also lists z 1 = [z 1,0 ], z 2 = [z 2,−1 , z 2,0 , z 2,1 , z 2,2 , z 2,3 ], and z 3 = [z 3,0 ], where z i,j denotes the density of the set of primes p for which a i (C)(p) = j. For these, we record the following lemma.

Here,ō(n) is as in Corollary 2.4 and o(n) denotes the number of elements of order n in H 0 .
Proof The formula for z 1 is immediate from (2.3) and the study of the polynomial (2.6) in the proof of Corollary 2.4, together from the fact that τ ∈ Gal(L/k) satisfies a 1 (θ )(τ ) = 0 if and only if τ has order 3 (as can be seen from Table 3). The formula for z 2 follows from a similar reasoning, once one observes that again a 2 (θ)(τ ) = 0 if and only if τ has order 3, and the discussion of the end of Corollary 2.4. Note also that, as G C 0 contains no elements of order 12, we haveō(12) = 0.
For z 3 , it suffices to note that a 3 (τ ) does not vanish.

Sato-Tate groups
In this section, for any twist C of C 0 , we explicitly construct ST(Jac(C)), which to simplify notation we denote by ST(C). The first step is to compute a (non-canonical) embedding (6) (see [24] for a very similar approach).
with f Y = ∂f ∂Y , is a basis of the regular differentials 1 (C 0 M ). If we denote by ω i the regular differential of the ith copy of E 0 M in (E 0 M ) 3 , then is a basis of the regular differentials 1 (E 0 M ) 3 .
Consider the isomorphism with respect to the cup product, and use this basis to obtain an isomorphism Then, define Finally, define the matrices Remark 3.17 From now on, we fix the following notation: denote by A 3 the 3-diagonal embedding of a subset A of GL 2 in GL 6 . Throughout this section, we consider the general symplectic group GSp 6 /Q, the symplectic group Sp 6 /Q, and the unitary symplectic group USp(6) with respect to the symplectic form given by the 3-diagonal embedding (J 2 ) 3 .
The following theorem gives an explicit description of the Sato-Tate group of a twist of the Fermat or Klein quartic corresponding to a subgroup H of the group Theorem 3. 21 The following hold: (i) The monomorphism of Lemma 3.18 extends to a monomorphism where τ denotes the non-trivial element of Gal(M/Q). (ii) Let φ : C Q → C 0 Q denote a k-twist of C 0 and write H := λ φ (Gal(K /k)) ⊆ G C 0 . The Sato-Tate group of Jac(C) is given by Proof To prove (i) it is enough to note that ι((1, τ )) 2 = 1 in USp(6)/ −1 and that ι ((1, τ )) acts by matrix conjugation on ι(Aut(C 0 M )) as τ acts by Galois conjugation on Aut(C 0 M ). If C 0 = C 0 1 (resp. C 0 = C 0 7 ), the latter is equivalent to which is straightforward to check.
For (ii), we consider only the case kM = k, since the case k = kM can be easily deduced from the case kM = k. Recall from [3] that ST(E 0 ) is a maximal compact subgroup of the algebraic Sato-Tate group AST(E 0 ) ⊗ C attached to E 0 . Recall that we have AST(E 0 ) = L(E 0 , 1) ∪ L(E 0 , τ ), where for σ ∈ Gal(kM/k) one has This induces a decomposition ST(E 0 ) = ST(E 0 , 1) ∪ ST(E 0 , τ ) that can be explicitly determined.
For the case C 0 = C 0 7 , we have Thus, a maximal compact subgroup of L(E 0 , 1)(C) is Analogously, Thus, a maximal compact subgroup of L(E 0 , τ )(C) is We can now apply [12, Lemma 2.3] exactly as in the case C 0 = C 0 1 to complete the proof.
The previous theorem describes the Sato-Tate group of a twist C of C 0 . Now suppose that C and C are both twists of C 0 . The next proposition gives an effective criterion to determine when ST(C) and ST(C ) coincide. Let H ⊆ G C 0 (resp. H ) be attached to C (resp. C ) as in Remark 3.10.

Proposition 3.22 If H and H are conjugate in G C 0 , then ST(C) and ST(C ) coincide.
Proof Since the Sato-Tate group is defined only up to conjugacy, is suffices to exhibit A ∈ GL 6 (C) such that A −1 ST(C)A = ST(C ). Let g ∈ G C 0 be such that H = g −1 Hg. It is straightforward to check that ι(G C 0 ) normalizes the group ST(E 0 , 1) 3 . In particular, by In the Fermat case, ST(C) and ST(C ) may coincide when H and H are not conjugate in G C 0 . We thus require a sharper criterion.

Definition 3.24
Let C and C be twists of C 0 and C 0 , respectively (here C 0 and C 0 both denote one of C 0 1 or C 0 7 , but possibly not the same curve in both cases), and let H and H be the corresponding attached groups. We say that H and H are equivalent if there exists an isomorphism : H → H (3.18) such that (H 0 ) = H 0 and for every h ∈ H 0 , we have Tr(j(h)) = Tr(j( (h))), (3.19) where H 0 and H 0 are defined as in Definition 3.9 and j denotes compositions ι 2 • ι 1 of the embeddings defined in Lemma 3.18 for C 0 and C 0 (two different maps j if C 0 = C 0 ).

Proposition 3.25 Let C and C be twists of C
from which the claim follows. In case (b), we have that both g and (g) have trace 0, as follows for example from the proof of Corollary 2.4 and the Chebotarev Density Theorem. The claim follows immediately.
If C 0 = C 0 , then we may assume without loss of generality that C is a twist of C 0 7 and C is a twist of C 0 1 . Now consider the isomorphism defined by sending an element of the form g = g 0 ι(h) to Tg 0 T −1 ι( (h)), where We now note that T ST(E 0 1 , 1)T −1 = ST(E 0 7 , 1), and the proof then proceeds exactly as above; the hypothesis C 0 = C 0 implies that we have for every h ∈ H 0 , and thus the matrix A from above can be taken in GL 3 (Q). Proof Determining whether two subgroups H and H are equivalent is a finite problem.
Using the computer algebra program [6], one can determine a set of representatives for equivalence classes of subgroups H that turn out to have size 54 in case (i), and of size 60 in case (ii). For the benefit of the reader, here we give a direct proof of (ii), assuming (i).
The 6 Sato-Tate groups of a twist of the Klein quartic that do not show up as the Sato-Tate group of a twist of the Fermat quartic are precisely those ruled out by the fact that H 0 contains an element of order 7 (those in rows #10, #13, #14 of Table 5), since 7 does not divide #G C 0 1 .
To show that the other 17 Sato-Tate groups of twists of the Klein quartic also arise for twists of the Fermat quartic, we proceed as follows. Let H ⊆ G C 0 7 correspond to a twist C of C 0 7 such that H 0 does not contain an element of order 7, and let H ⊆ C 0 1 correspond to a twist C of C 0 1 . In this case, from Table 3a, b, to ensure that H and H are equivalent it suffices to check that: (1) There exists an isomorphism : H → H such that (H 0 ) = H 0 ; (2) Tr(j(h)) = 1 for every h ∈ H 0 such that ord(h) = 4.
From Tables 4 and 5, it is trivial to check that for every H as above, one can always find a subgroup H such that condition (1) is satisfied. Condition (2) is vacuous except for rows #6, #7, #11, and #12 of Table 5. In these cases, a subgroup H for which condition (2) is also satisfied can be found by noting that both j(t 1 ) and j(t 3 1 u 1 t 1 u 3 1 ) have trace 1. More precisely, one finds that the Sato-Tate groups corresponding to these cases coincide with the Sato-Tate groups of rows #13, #20, #34, and #55 of Table 4, respectively.
Combining the lower and upper bounds proved in this section yields our main theorem, which we restate for convenience. These give rise to 60 (resp. 54) distinct joint (resp. independent) coefficient measures.

Corollary 3.27 If C and C are twists of C 0 corresponding to H and H , respectively, then ST(C) and ST(C ) coincide if and only if H and H are equivalent.
Remark 3.28 One could have obtained the lower bounds of Proposition 3.13 by computing the joint coefficient measures μ I of the Sato-Tate groups explicitly described in Theorem 3.21. This is a lengthy but feasible task that we will not inflict on the reader. We note that this procedure also allows for case-by-case verifications of the equalities M n 1 ,n 2 ,n 3 [μ I ] = M n 1 ,n 2 ,n 3 [a] and thus of the Sato-Tate conjecture in the cases considered.
where C d denotes the lattice of subgroups of G C 0 d up to conjugation. Parts (i) and (ii) of Theorem 1 imply that while the map ε 7 is a lattice isomorphism, the map ε 1 is far from being injective. Corollary 3.27 can now be reformulated by saying that two subgroups H, H ∈ C 1 lie in the same fiber of ε 1 if and only if they are equivalent.
In virtue of the above remark, one might ask about conditions on twists C and C corresponding to distinct but equivalent groups H and H that ensure their Jacobians have the same Sato-Tate group. One such condition is that Jac(C) and Jac(C ) are isogenous (recall that the Sato-Tate group of an abelian variety is an isogeny invariant). The next proposition shows that, under the additional hypothesis that K and K coincide, the previous statement admits a converse.

Proposition 3.30
Let C and C be k-twists of C 0 . Suppose that the corresponding subgroups H and H of G C 0 are equivalent and that the corresponding fields K and K coincide. Then, Jac(C) and Jac(C ) are isogenous.
Proof Let S be the set of primes of k which are of bad reduction for either Jac(C) or Jac(C ) or lie over the fixed prime . Note that by [27,Thm. 4.1] the set S contains the primes of k ramified in K or K . By Faltings' Isogeny Theorem [8,Korollar 2], it suffices to show that for every p / ∈ S, we have To obtain (3.20) for those p such that Frob p ∈ G kM , we will show that V (Jac(C) kM ) and V (Jac(C ) kM ) are isomorphic as Q [G kM ]-modules. Indeed, the fact that H and H are equivalent pairs implies that the restrictions from Aut(C 0 M ) to H 0 and H 0 of the representations θ E 0 ,C 0 attached to C and C are equivalent. Together with (3.5), this shows that θ M,σ (E 0 , Jac(C)) and θ M,σ (E 0 , Jac(C )) are equivalent representations. The desired Q [G kM ]-module isomorphism follows now from (2.2).

Remark 3.31
Let H and H be any two equivalent pairs attached to twists C and C of the same curve C 0 . As one can read from Tables 4 and 5 (and as we will see in the next section), one can choose C and C so that K and K coincide. It follows from Proposition 3.30 that on Table 4 (resp. Table 5) two curves C and C satisfy ST(C) = ST(C ) if and only if Jac(C) ∼ Jac(C ).
We conclude this section with an observation that is not directly relevant to our results but illustrates a curious phenomenon arising among the twists of the Fermat quartic in Table 4. Let be the curves listed in rows #5 and #8 of Table 4. As can be seen in Table 4, the groups ST(C 5 ) and ST(C 8 ) coincide, as do the respective fields K . Proposition 3.30 thus implies that the Jacobians of C 5 and C 8 are isogenous, but in fact more is true.
Proposition 3. 32 The curves C 5 and C 8 are not isomorphic (over Q), but their reductions C 5 andC 8 modulo p are isomorphic (over F p ) for every prime p > 3.
Proof The twists C 5 are C 8 of C 0 1 are not isomorphic because they arise from nonconjugate subgroups H of G C 0 1 . For the reductionsC 5 andC 8 , we first consider the case p ≡ 1 (mod 4). We claim that −4 is a fourth power modulo p; this follows from the factorization together with the fact that x 2 − 2x + 2 and x 2 + 2x + 2 have discriminant −4. It follows thatC 5 andC 8 are both isomorphic to 9x 4 + 9y 4 + z 4 = 0 (over F p ). Suppose now that p ≡ −1 (mod 4). Then, 9 is a fourth power modulo p since It follows thatC 5 andC 8 are both isomorphic to x 4 + y 4 − 4z 4 = 0 (over F p ).

Curve equations
In this section, we construct explicit twists of the Fermat and the Klein quartics realizing each of the subgroups H ⊆ G C H 0 ] = 2 that is realized by a twist with k = Q, allowing H 0 to be realized over a quadratic field as the base change to M of a twist defined over Q. (H, H 0 ) with the following pairs of GAP identifiers cannot be defined over a totally real field: 1 , 2, 1 ), ( 8, 1 , 4, 1 ), ( 8, 4 , 4, 1 ), ( 16, 6 , (8, 2 ).

Lemma 3.33 Twists of the Fermat or Klein quartics corresponding to pairs
Proof If k is totally real, then complex conjugation acts trivially on k but not on kM, giving an involution in H = Gal(K /k) with non-trivial image in H/H 0 = Gal(K /k)/Gal(K /kM). For the four pairs (H, H 0 ) listed in the lemma, no such involution exists.
In addition to listing equations and a field of definition k for a twist C associated with each subgroup H, in Tables 4 and 5 we also list the minimal field K over which all the endomorphisms of Jac(C) are defined, and we identify the conjugacy class of ST(C) and ST(C kM ), which depends only on H, not the particular choice of C. As noted in Remark 3.31, we have chosen twists C so that twists with the same Sato-Tate group have the same fields K and thus have isogenous Jacobians, by Proposition 3.30 (thereby demonstrating that the hypotheses of the proposition can always be satisfied).

Constructing the Fermat twists
The twists of the Fermat curve over any number field are parametrized in [23], and we specialize the parameters in Theorems 4.1, 4.2, 4.5 of [23] to obtain the desired examples. In every case, we are able to obtain equations with coefficients in Q, but as explained above, we cannot always take k = Q; the exceptions can be found in rows #4, #13, #27, #33 of Table 4. The parameterizations in [23] also allow us to determine the field L over which all the isomorphisms to (C 0 7 ) Q are defined, which by Lemma 3.3 and Proposition 3.7, this is the same as the field K over which all the endomorphisms of Jac(C 0 7 ) Q are defined. Specializing the parameters for each of the 59 cases with k = kM involves a lot of easy but tedious computations. The resulting equations are typically not particularly pleasing to the eye or easy to format in a table; in order to make them more presentable, we used the algorithm in [30] to simplify the equations. To give just one example, for the unique subgroup H with ID(H) = 24, 13 , the equation we obtain from specializing the parameterizations in [23] is 14x 4 − 84x 3 y + 392x 3 z + 588x 2 y 2 − 2940x 2 yz + 4998x 2 z 2 − 980xy 3 + 9996xy 2 z − 28812xyz 2 + 30184xz 3 + 833y 4 − 9604y 3 z + 45276y 2 z 2 − 90552yz 3 + 69629z 4 = 0, but the equation listed for this curve in row #48 of Table 4 is 3x 4 +4x 3 y+4x 3 z+6x 2 y 2 +6x 2 z 2 +8xy 3 +12xyz 2 + 5y 4 + 4y 3 z + 12y 2 z 2 + z 4 = 0.
We used of the number field functionality in [6] and [34] to minimize the presentation of the fields K listed in the tables (in particular, the function polredabs in PARI/GP).

Constructing the Klein twists
Twists of the Klein curve over arbitrary number fields are parametrized in Theorems 6.1 and 6.8 of [23], following the method described in [22], which is based on the resolution of certain Galois embedding problems. However, in the most difficult case, in which H = G C 0 7 has order 336, this Galois embedding problem is computationally difficult to resolve explicitly. This led us to pursue an alternative approach that exploits the moduli interpretation of twists of the Klein curve as twists of the modular curve X (7). As described in [14, §3] and [25, §4], associated with each elliptic curve E/Q is a twist X E (7) of the Klein quartic defined over Q that parameterizes isomorphism classes of 7-torsion Galois modules isomorphic to E [7], as we recall below. With this approach, we can easily treat the case H = G C 0 7 , and we often obtain twists with nicer equations. In one case, we also obtain a better field of definition k, allowing us to achieve the minimal possible degree [k : Q] in every case.
However, as noted in [25, §4.5], not every twist of the Klein curve can be written as X E (7) for some elliptic curve E/Q, and there are several subgroups H ⊆ G C 0 7 for which the parameterizations in [23] yield a twist of the Klein quartic defined over Q, but no twists of the form X E (7) corresponding to H exist. We are thus forced to use a combination of the two approaches. For twists of the form X E (7), we need to determine the minimal field over which the endomorphisms of Jac(X E (7)) are defined; this is addressed by Propositions 3.34 and 3. 35.
Let E/Q be an elliptic curve and let E [7] denote the F 7 [G Q ]-module of Q-valued points of the kernel of the multiplication-by-7 map [7] : E → E. The Weil pairing gives a G Qequivariant isomorphism 2 E [7] μ 7 , where μ 7 denotes the F 7 [G Q ]-module of 7th roots of unity. Let Y E (7) be the curve defined over Q described in [14, §3] and [25, §4]. For any field extension L/Q, the L-valued points of Y E (7) parametrize isomorphism classes of pairs (E , φ), where E /L is an elliptic curve and φ : E [7] → E [7] is a symplectic isomorphism. By a symplectic isomorphism, we mean a G L -equivariant isomorphism φ : E [7] → E [7] such that the diagram commutes, where the horizontal arrows are Weil pairings. Two pairs (E , φ) and (Ẽ ,φ) are isomorphic whenever there exists an isomorphism ε : E →Ẽ such thatφ = ε • φ.
We will use the moduli interpretation of X E (7) to determine the minimal field over which all of its automorphisms are defined. Recall that the action of G Q on E [7] gives rise to a Galois representation Let E,7 denote the composition π • E,7 , where π : GL 2 (F 7 ) → PGL 2 (F 7 ) is the natural projection.
Proposition 3. 34 The following field extensions of Q coincide: (i) The minimal extension over which all endomorphisms of Jac(X E (7)) are defined; (ii) The minimal extension over which all automorphisms of X E (7) are defined; (iii) The field Q ker E,7 ; (iv) The minimal extension over which all 7-isogenies of E are defined.
In particular, if K is the field determined by these equivalent conditions, then .

Proof
The equivalence of (i) and (ii) follows from 3.3, since X E (7) is a twist of C 0 7 . Following [25], let Aut ∧ (E [7]) denote the group of symplectic automorphisms of E [7]. Given a field extension F /Q, let us write E [7] F for the F 7 [G F ]-module obtained from E [7] by restriction from G Q to G F . Note that E [7] Q (Z/7Z) 2 . Under this isomorphism, for any g ∈ Aut ∧ (E[7] Q ), diagram (3.21) becomes . This action extends to X E (7), from which we obtain a homomorphism This homomorphism is non-trivial, since elements of its kernel induce automorphisms of E Q , but Aut(E Q ) is abelian and Aut ∧ (E [7]) Q SL 2 (F 7 ) is not, and it cannot be injective, since the group on the right has cardinality 168 < #SL 2 (F 7 ) = 336. The only non-trivial proper normal subgroup of SL 2 (F 7 ) is ±1 , and thus (3.24) induces a G Q -equivariant isomorphism By transport of structure, we now endow SL 2 (F 7 ) with a G Q -module structure that turns (3.23) into a G Q -equivariant isomorphism ϕ : Aut ∧ (E[7] Q ) ∼ → SL 2 (F 7 ). Now define : G Q → Aut(SL 2 (F 7 )) to be the representation associated with this G Q -module structure. Since the action of σ ∈ G Q on each g ∈ Aut ∧ (E[7] Q ) is defined by for P ∈ E [7], we have (σ )(ϕ(g)) = E,7 (σ ) · ϕ(g) · E,7 (σ ) −1 . The G Q -action is trivial on ±1 and thus descends to PSL 2 (F 7 ). Let us write PSL 2 (F 7 ) for PSL 2 (F 7 ) endowed with the G Q -action given by conjugation by E,7 . Then, (3.23) with (3.25) yield a G Q -equivariant isomorphism This implies that the field described in (ii) coincides with Q Ker( ) , and we now note that 7 ) is the field described in (iii). Now let P(E [7]) denote the projective space over E [7], consisting of its 8 linear F 7subspaces, equivalently, its 8 cyclic subgroups of order 7. The G Q -action on P(E [7]) gives rise to the projective Galois representation E,7 : G Q → Aut(P(E [7])) PGL 2 (F 7 ).
The minimal field extension K over which the G K -action on P(E [7]) becomes trivial is precisely the minimal field over which the cyclic subgroups of E [7] of order 7 all become Galois stable, equivalently, the minimal field over which all the 7-isogenies of E are defined. It follows that the fixed field of ker E,7 identified in (iii) is also the field described in (iv).
To explicitly determine the field over which all the 7-isogenies of E are defined, we rely on Proposition 3.35 below, in which 7 (X, Y ) ∈ Z[X, Y ] denotes the classical modular polynomial; the equation for 7 (X, Y ) is too large to print here, but it is available in [6] and can be found in the tables of modular polynomials listed in [33] that were computed via [5]; it is a symmetric in X and Y , and has degree 8 in both variables.
The equation 7 (X, Y ) = 0 is a canonical (singular) model for the modular curve Y 0 (7) that parameterizes 7-isogenies. If E 1 and E 2 are elliptic curves related by a 7-isogeny then 7 (j(E 1 ), j(E 2 )) = 0, and if j 1 , j 2 ∈ F satisfy 7 (j 1 , j 2 ) = 0, then there exist elliptic curves E 1 and E 2 with j(E 1 ) = j 1 and j(E 2 ) = j 2 that are related by a 7-isogeny. However, this 7-isogeny need not be defined over F ! The following proposition characterizes the relationship between F and the minimal field K over which all the 7-isogenies of E are defined. Proof Let S be the multiset of roots of 7 (j(E), Y ) in Q, viewed as a G k -set in which the action of σ ∈ G k preserves multiplicities: we have m(σ (r)) = m(r) for all σ ∈ G k , where m(r) denotes the multiplicity of r in S. Let P(E [7]) be the G k -set of cyclic subgroups P of E [7] of order 7. In characteristic zero every isogeny is separable, hence determined by its kernel up to composition with automorphisms; this yields a surjective morphism of G k -sets ϕ : P(E [7]) → S defined by P → j(E/ P ) with m(r) = #ϕ −1 (r) for all r ∈ S (note #P(E[7]) = 8 = r∈S m(r)). The G k -action on S factors through the G k -action on P(E [7]), and we thus have group homomorphisms If E does not have complex multiplication, then m(r) = 1 for all r ∈ S, since otherwise over Q we would have two 7-isogenies α, β : E Q → E with distinct kernels, and then (α • β) ∈ End(E Q ) is an endomorphism of degree 49 which is not ±7, contradicting End(E Q ) Z. It follows that ϕ and therefore φ is injective, so ker¯ E,7 = ker(φ •¯ E,7 ) and K = F .
If E does have complex multiplication, then End(E Q ) is isomorphic to an order in an imaginary quadratic field M. We now consider the isogeny graph whose vertices are jinvariants of elliptic curves E /FM with edges (j 1 , j 2 ) present with multiplicity equal to the multiplicity of j 2 as a root of 7 (j 1 , Y ). Since j(E) = 0, 1728, the component of j(E FM ) in this graph is an isogeny volcano, as defined in [31]. In particular, there are at least 6 distinct edges (j(E FM ), j 2 ) (edges with multiplicity greater than 1 can occur only at the surface of an isogeny volcano and the subgraph on the surface is regular of degree at most 2). It follows that m(r) > 1 for at most one r ∈ S.
The image of¯ E,7 is isomorphic to a subgroup of PGL 2 (F 7 ), and this implies that if E,7 (σ ) fixes more than 2 elements of P(E [7]) then σ ∈ ker¯ E,7 . This necessarily applies whenever¯ E,7 (σ ) lies in ker φ, since it must fix 6 elements, thus ker¯ E,7 = ker(φ •¯ E,7 ) and K = F . Remark 3.37 The first part of the proof of Proposition 3.35 also applies when j(E) is 0 or 1728, thus we always have F ⊆ K . Equality does not hold in general, but a direct computation finds that [K : F ] must divide 6 (resp. 2) when j(E) = 0 (resp. 1728), and this occurs when k = Q.
We now fix E as the elliptic curve y 2 = x 3 + 6x + 7 with Cremona label 144b1. Note that E,7 is surjective; this can be seen in the entry for this curve in the L-functions and Modular Forms Database [35] and was determined by the algorithm in [32]. It follows that Gal(Q(E [7])/Q) GL 2 (F 7 ), and Proposition 3.34 implies that we then have H := Gal(K /Q) PGL 2 (F 7 ).
For our chosen curve E, we have a = 6 and b = 7. Plugging these values into equation (3.22) and applying the algorithm of [30] to simplify the result yields the curve listed in entry #14 of Table 5 for H = G C 0 7 . To determine the field K , we apply Proposition 3.35. Plugging j(E) = 48384 into 7 (x, j(E)) and using PARI/GP to simplify the resulting polynomial, we find that K is the splitting field of the polynomial x 8 + 4x 7 + 21x 4 + 18x + 9.
We applied the same procedure to obtain the equations for C and the polynomials defining K that are listed in rows #4, #6, #9, #10 of Table 5 using the elliptic curves E with Cremona labels 2450ba1, 64a4, 784h1, 36a1, respectively, with appropriate adjustments for the cases with j(E) = 0, 1728 as indicated in Proposition 3.35. The curve in row #11 is a base change of the curve in row #6, and for the remaining 7 curves we used the parameterizations in [23].

Numerical computations
In the previous sections, we have described the explicit computation of several quantities related to twists C of C 0 = C 0 d , where C 0 d is our fixed model over Q for the Fermat quartic (d = 1) or the Klein quartic (d = 7), with Jac(C 0 ) ∼ (E 0 ) 3 , where E 0 = E 0 d is an elliptic curve over Q with CM by M = Q( √ −d) defined in (3.1). These include: • Explicit equations for twists C of C 0 corresponding to subgroups H of G C 0 ; • Defining polynomials for the minimal field K for which End(Jac(C) K ) = End(Jac(C) Q ); • Independent and joint coefficient moments of the Sato-Tate groups ST(Jac(C)).
These computations are numerous and lengthy, leaving many opportunities for errors, both by human and by machine. We performed several numerical tests to verify our computations.

Naïve point-counting
A simple but effective way to test the compatibility of a twist C/k and endomorphism field K is to verify that for the first several degree one primes p of k of good reduction for C that split completely in K , the reduction of Jac(C) modulo p is isogenous to the cube of the reduction of E 0 modulo the prime p := N (p). By a theorem of Tate, it suffices to check that L p (Jac(C), T ) = L p (E 0 , T ) 3 . For this task, we used optimized brute force point-counting methods adapted from [20, §3]. The L-polynomial L p (Jac(C), T ) is the numerator of the zeta function of C, a genus 3 curve, so it suffices to compute #C(F p ), #C(F p 2 ), #C(F p 3 ), reducing the problem to counting points on smooth plane quartics and elliptic curves over finite fields.
To count projective points (x : y : z) on a smooth plane quartic f (x, y, z) = 0 over a finite field F q , one first counts affine points (x : y : 1) by iterating over a ∈ F q , computing the number r of distinct F q -rational roots of g a (x) := f (x, a, 1) via r = deg(gcd(x q − x, g a (x))), and then determining the multiplicity of each rational root by determining the least n ≥ 1 for which gcd(g a (x), g a denotes the nth derivative of g a ∈ F q [x]; note that to compute gcd(x q − x, g a (x)) one first computes x q mod g a (x) using a squareand-multiply algorithm. Having counted affine points (x : y : 1), one then counts the F q -rational roots of f (x, 1, 0) and finally checks whether (1 : 0 : 0) is a point on the curve.
To optimize this procedure, one first seeks a linear transformation of f (x, y, z) that ensures g a (x) = f (x, a, 1) has degree at most 3 for all a ∈ F q ; for this, it suffices to translate a rational point to (1 : 0 : 0), which is always possible for q ≥ 37 (by the Weil bounds). This yields an O(p 3 (log p) 2+o(1) )-time algorithm to compute L p (Jac(C), T ) that is quite practical for p up to 2 12 , enough to find several (possibly hundreds) of degree one primes p of k that split completely in K .
Having computed L p (Jac(C), T ), one compares this to L p (E 0 , T ) 3 ; note that the polynomial L p (E 0 , T ) = pT 2 − a p T + 1 is easily computed via a p = p + 1 − #E 0 (F p ). If this comparison fails, then either C is not a twist of C 0 , or not all of the endomorphisms of Jac(C) Q are defined over K . The converse is of course false, but if this comparison succeeds for many degree-1 primes p it gives one a high degree of confidence in the computations of C and K . 4 Note that this test will succeed even when K is not minimal, but we also check that H Gal(K /k), which means that so long as C is a twist of C 0 corresponding to the subgroup H ⊆ G C 0 , the field K must be minimal.

An average polynomial-time algorithm
In order to numerically test our computations of the Sato-Tate groups ST(C), and to verify our computation of the coefficient moments, we also computed Sato-Tate statistics for all of our twists C/k of the Fermat and Klein quartics. This requires computing the Lpolynomials L p (Jac(C), T ) at primes p of good reduction for C up to some bound N , and it suffices to consider only primes p of prime norm p = N (p), since nearly all the primes of norm less than N are degree-1 primes. In order to get statistics that are close to the values predicted by the Sato-Tate group one needs N to be fairly large. We used N = 2 26 , which is far too large for the naive O(p 3 (log p) 2+o(1) )-time algorithm described above to be practical, even for a single prime p ≈ N , let alone all good p ≤ N .
In [18], Harvey and Sutherland give an average polynomial-time algorithm to count points on smooth plane quartics over Q that allows one to compute L p (Jac(C), T ) mod p for all good primes p ≤ N in time O(N (log N ) 3+o(1) ), which represents an average cost of O((log p) 4+o(1) ) per prime p ≤ N . This is achieved by computing the Hasse-Witt matrices of the reductions of C modulo p using a generalization of the approach given in [16,17] for hyperelliptic curves. In [18], they also give an O( √ p(log p) 1+o(1) )-time algorithm to compute L p (Jac(C), T ) mod p for a single good prime p, which allows one to handle reductions of smooth plane quartics C defined over number fields at degree one primes; this increases the total running time for p ≤ N to O(N 3/2+o(1) ), which is still feasible with N = 2 26 .
Having computed L p (Jac(C), T ) mod p, we need to lift this polynomial for (Z/pZ)[T ] to Z[T ], which is facilitated by Proposition 3.38 below. It follows from the Weil bounds that the linear coefficient of L p (Jac(C), T ) is an integer of absolute value at most 6 √ p. For p > 144, the value of this integer is uniquely determined by its value modulo p, and for p < 144 we can apply the naive approach described above. This uniquely determines the value in the column labeled F 1 (x) in Tables 1 and 2 of Proposition 3.38, which then determines the values in columns F 2 (x) and F 3 (s), allowing the integer polynomial L p (Jac(C), T ) ∈ Z[T ] to be completely determined.

Proposition 3.38
For τ in Gal(L/k), let s = s(τ ) and t = t(τ ) denote the orders of τ and the projection of τ on Gal(kM/k), respectively. For C a twist of C 0 , the following hold: pair (s, t) is one of the 9 pairs listed on Table 1 if C 0 = C 0 1 , and one of the 9 pairs listed on Table 2 Table 1 if C 0 = C 1 0 or Table 2 if C 0 = C 7 0 . For every prime p unramified in K of good reduction for both Jac(C) and E 0 , we have F (f L (p),f kM (p)) (a 1 (E 0 )(p)) = a 1 (Jac(C))(p), a 2 (Jac(C))(p), a 3 (Jac(C))(p) , (3.26) where f L (p) (resp. f kM (p)) is the residue degree of p in L (resp. kM).
Proof For every prime p unramified in K of good reduction for both Jac(C) and E 0 , write x p := a 1 (E 0 )(p) and y p := ± 4 − x 2 p . It follows from the proof of Proposition 2.2 that a 1 (Jac(C))(p) = − Re(a 1 (p))x p + Im(a 1 (p))y p , a 2 (Jac(C)(p)) = Re(a 2 (p))(x 2 p − 2) − Im(a 2 (p))x p y p + |a 1 (p)| 2 , a 3 (Jac(C)(p)) = −a 3 (p)(x 3 p − 3x p ) − Re(a 1 (p)a 2 (p))x p + Im(a 1 (p)a 2 (p))y p , from which one can easily derive the assertion of the proposition. Tables 7 and 8 Proposition 3.13. These were computed by averaging over all good primes of degree one and norm p ≤ 2 26 . For comparison, we also list the actual value of each moment, computed using the method described in Sect. 3.2.2. In every case, the moment statistics agree with the corresponding moments of the Sato-Tate groups to within 1.5 percent, and in almost all cases, to within 0.5 percent.