Endomorphism algebras of geometrically split abelian surfaces over $\mathbb{Q}$

We determine the set of geometric endomorphism algebras of geometrically split abelian surfaces defined over $\mathbb{Q}$. In particular we find that this set has cardinality 92. The essential part of the classification consists in determining the set of quadratic imaginary fields $M$ with class group $\mathrm{C}_2 \times \mathrm{C}_2$ for which there exists an abelian surface $A$ defined over $\mathbb{Q}$ which is geometrically isogenous to the square of an elliptic curve with CM by $M$. We first study the interplay between the field of definition of the geometric endomorphisms of $A$ and the field $M$. This reduces the problem to the situation in which $E$ is a $\mathbb{Q}$-curve in the sense of Gross. We can then conclude our analysis by employing Nakamura's method to compute the endomorphism algebra of the restriction of scalars of a Gross $\mathbb{Q}$-curve.

Let A be an abelian variety of dimension g ≥ 1 defined over a number field k of degree d. Let us denote by A Q its base change to Q. We refer to End(A Q ), the Qalgebra spanned by the endomorphisms of A defined over Q, as the Q-endomorphism algebra of A. For a fixed choice of g and d, it is conjectured that the set of possibilities for End(A Q ) is finite. A slightly stronger form of this conjecture, applying to endomorphism rings of abelian varieties over number fields, has been attributed to Coleman in [BFGR06].
Hereafter, let A denote an abelian surface defined over Q. In the case that A is geometrically simple (that is, A Q is simple), the previous conjecture stands widely open. If A is principally polarized and has CM it has been shown (see [MU01], [BS17], and [KS23]) that End(A Q ) is one of 13 possible quartic CM fields. However, narrowing down to a finite set the possible quadratic real fields and quaternion division algebras over Q which occur as End(A Q ) for some A has escaped all attempts of proof. See also [OS18] for recent more general results which prove Coleman's conjecture for CM abelian varieties.
In the present paper, we focus on the case that A is geometrically split, that is, the case in which A Q is isogenous to a product of elliptic curves, which we will assume from now on. Let A be the set of possibilities for End(A Q ), where A is a geometrically split abelian surface over Q.
Let us briefly recall how scattered results in the literature ensure the finiteness of A (we will detail the arguments in Section 4). Indeed, if A Q is isogenous to the product of two non-isogenous elliptic curves, then the finiteness (and in fact the precise description) of the set of possibilities for End(A Q ) follows from [FKRS12,Proposition 4.5]. If, on the contrary, A Q is isogenous to the square of an elliptic curve, then the finiteness of the set of possibilities for End(A Q ) was established by Shafarevich in [Sha96] (see also [Cre92] and [Gon11] for the determination of the precise subset corresponding to modular abelian surfaces). In the present work, we aim at an effective version of Shafarevich's result. Our starting point is [FG18,Theorem 1.4], which we recall in our particular setting.
Theorem 1.1 ( [FG18]). If A is an abelian surface defined over Q such that A Q is isogenous to the square of an elliptic curve E/Q with complex multiplication (CM) by a quadratic imaginary field M , then the class group of M is 1, C 2 , or C 2 × C 2 .
It should be noted that several other works can be used to see that, in the situation of the theorem, the exponent of the class group of M divides 2 (see [Sch07] or [Kan11], for example).
While it is an easy observation that an abelian surface A as in the theorem can be found for each quadratic imaginary field M with class group 1 or C 2 (see [FG18,Remark 2.20] and also Section 4), the question whether such an A exists for each of the fields M with class group C 2 ×C 2 is far from trivial. The aforementioned results are thus not sufficient for the determination of the set A. The main contribution of this article is the following theorem. The only imaginary quadratic fields with class group C 2 × C 2 whose discriminant does not belong to (1.1) are With Theorem 1.2 at hand, the determination of the set A follows as a mere corollary (see §4 for the proof). , where M is a quadratic imaginary field with class group 1, C 2 , or C 2 × C 2 and distinct from those listed in (1.2). In particular, the set A has cardinality 92.
The paper is organized in the following manner. In Section 2 we attach a crepresentation ̺ V of degree 2 to an abelian surface A defined over Q such that A Q is isogenous to the square of an elliptic curve E/Q with CM by M . It is well known that E is a Q-curve and that one can associate a 2-cocycle c E to E. A c-representation is essentially a representation up to scalar and it is thus a notion closely related to that of projective representation. In the case of the crepresentation ̺ V attached to A, the scalar that measures the failure of ̺ V to be a proper representation is precisely the 2-cocycle c E . Choosing the language of c-representations instead of that of projective representations has an unexpected payoff: the tensor product of a c-representation ̺ and its contragradient c-representation ̺ * is again a proper representation. We show that ̺ V ⊗ ̺ * V coincides with the representation of G Q on the 4 dimensional M -vector space End(A Q ). This representation has been studied in detail in [FS14] and the tensor decomposition of End(A Q ) is exploited in Theorems 2.20 and 2.27 to obtain obstructions on the existence of A. These obstructions extend to the general case those obtained in [FG18, §3.1, §3.2] under very restrictive hypotheses. The c-representation point of view also allows us to understand in a unified manner what we called group theoretic and cohomological obstructions in [FG18]. It should be noted that one can define analogues of ̺ V in other more general situations. For example, a parallel construction in the context of geometrically isotypic abelian varieties potentially of GL 2 -type has been exploited in [FG19] to determine a tensor factorization of their Tate modules. This can be used to deduce the validity of the Sato-Tate conjecture for them in certain cases.
In Section 3, we describe a method of Nakamura to compute the endomorphism algebra of the restriction of scalars of certain Gross Q-curves (see Definition 2.9 below for the precise definition of these curves). Then we apply this method to all Gross Q-curves with CM by a field M of class group C 2 × C 2 . This computation plays a key role in the proof of Theorem 1.2, both in proving the existence of the abelian surfaces for the fields M different from those listed in (1.2), and in proving the non-existence for the fields of (1.2).
In Section 4 we culminate the proofs of Theorem 1.2 and Corollary 1.3 by assembling together the obstructions and existence results from Sections 2 and 3. We essentially show that we can use the results of Section 2 to reduce to the case of Gross Q-curves, and then we deal with this case using the results of Section 3 Notations and terminology. For k a number field, we will work in the category of abelian varieties up to isogeny over k. Note that isogenies become invertible in this category. Given an abelian variety A defined over k, the set of endomorphisms End(A) of A defined over k is endowed with a Q-algebra structure. More generally, if B is an abelian variety defined over k, we will denote by Hom(A, B) the Qvector space of homomorphisms from A to B that are defined over k. We note that for us End(A) and Hom(A, B) denote what some other authors call End 0 (A) and Hom 0 (A, B). We will write A ∼ B to mean that A and B are isogenous over k. If L/k is a field extension, then A L will denote the base change of A from k to L. In particular, we will write A L ∼ B L if A and B become isogenous over L, and we will write Hom(A L , B L ) to refer to what some authors write as Hom L (A, B).
Acknowledgements. Fité is thankful to the organizers of the workshop "Arithmetic Aspects of Explicit Moduli Problems" held at BIRS (Banff) in May 2017, where he explained Theorem 1.1 and raised the question on the existence of an abelian surface over Q with End(A Q ) ≃ M 2 (M ) for an M with class group C 2 × C 2 . We thank Andrew Sutherland and John Voight for providing a positive answer to this question by pointing out the existence of an abelian surface (actually the Jacobian of a genus 2 curve) with the desired property for the field M = Q( √ −132). We also thank Noam Elkies for providing three additional genus 2 curves over Q, these covering the fields M = Q( √ −408), Q( √ −435), and Q( √ −708). These four examples motivated the present paper. We are grateful to Marco Streng for alerting us of the existence of [BS17] and [KS23]

c-representations and k-curves
The goal of this section is to obtain obstructions to the existence of abelian surfaces defined over Q such that End(A Q ) ≃ M 2 (M ), where M is a quadratic imaginary field. To this purpose, we analyze the interplay between the k-curves and c-representations that arise from them.
2.1. c-representations: general definitions. Let V be a vector space of finite dimension over a field k and let G be a finite group. We say that a map is a c-representation (of the group G) if ̺ V (1) = 1 and there exists a map Remark 2.1. The following properties follow easily from the definition: i) Note that we have In particular, c V (σ, σ −1 ) = c V (σ −1 , σ). ii) Note that if c V (·, ·) = 1, the notion of c-representation corresponds to the usual notion of representation.
Let V and W be c-representations of the group G. Let T = Hom(V, W ) denote the space of k-linear maps from V to W . A homomorphism of c-representations from V to W is a k-linear map f ∈ T such that for every v ∈ V and σ ∈ G.
Consider now the map Proposition 2.2. The map ̺ T together with the map c T : with the structure of a c-representation. Before proving the proposition we show a particular case. In the case that W is k equipped with the trivial action of G, let us write V * = T and ̺ * = ̺ T . In this case, ̺ * (σ) is the inverse transpose of ̺ V (σ). The assertion of the proposition is then immediate from (2.1).
The following two lemmas, whose proof is straightforward, imply the proposition.
Lemma 2.3. The maps Corollary 2.5. When V = W , the c-representation T is in fact a representation.
2.2. k-curves: general definitions. We briefly recall some definitions and results regarding Q-curves and, more generally, k-curves with complex multiplication. More details can be found in [FG18, §2.1] and the references therein (especially [Que00], [Rib92], and [Nak04]). Let E/Q be an elliptic curve and let k be a number field, whose absolute Galois group we denote by G k .
Definition 2.6. We say that E is a k-curve if for every σ ∈ G k there exists an isogeny µ σ : σ E → E.
Definition 2.7. We say that E is a Ribet k-curve if E is a k-curve and the isogenies µ σ can be taken to be compatible with the endomorphisms of E, in the sense that the following diagram commutes for all σ ∈ G k and all ϕ ∈ End(E). . ii) We warn the reader that in the present paper we are using a slightly different terminology from that of [FG18]: as in [FG18] the only relevant notion was that of a Ribet k-curve, we called Ribet k-curves simply k-curves.
Let K be a number field containing k. We say that an elliptic curve E/K is a k-curve defined over K (resp. a Ribet k-curve defined over K) if E Q is a k-curve (resp. a Ribet k-curve). We will say that E is completely defined over K if, in addition, all the isogenies µ σ : σ E → E can be taken to be defined over K. Suppose from now on that E is a k-curve defined over K with CM by an imaginary quadratic field M . Fix a system of isogenies {µ σ : σ E → E} σ∈G k . By enlarging K if necessary, we can always assume that K/k is Galois and that E is completely defined over K. We will equip End(E) with the following action. For σ ∈ Gal(K/k) and ϕ ∈ End(E) define then this action is trivial. If we regard M as a Gal(K/k)-module by means of the natural Galois action (which is actually the trivial action when k contains M ) and End(E) endowed with the action defined above, then the identification of End(E) with M becomes a Gal(K/k)-equivariant isomorphism. The map for ̺, σ, τ ∈ Gal(K/k), and is then a 2-cocycle 1 . Denote by γ K E the cohomology class in H 2 (Gal(K/k), M × ) corresponding to c K E . The class γ K E only depends on the K-isogeny class of E.
The next result is a consequence of Weil's descent criterion, extended to varieties up to isogeny by Ribet ([Rib92, §8]).
Theorem 2.11 (Ribet-Weil). Suppose that E is a Ribet k-curve completely defined over K (and hence M ⊆ k). Let L be a number field with k ⊆ L ⊆ K, and consider the restriction map If res(γ K E ) = 1, there exists an elliptic curve C/L such that E ∼ C K . 2.3. M -curves from squares of CM elliptic curves. Let M be a quadratic imaginary field. Let A be an abelian surface defined over Q such that A Q is isogenous to E 2 , where E is an elliptic curve defined over Q with CM by M . Let K/Q denote the minimal extension over which By the theory of complex multiplication, K contains the Hilbert class field H of M . Note also that K/Q is Galois and the possibilities for Gal(K/Q) can be read from [FKRS12, Table 8]. For our purposes, it is enough to recall that Here, C r denotes the cyclic group of r elements, D r denotes the dihedral group of 2r elements, and A 4 (resp. S 4 ) stands for the alternating (resp. symmetric) group on 4 letters.
We can (and do) assume that E is in fact defined over K, and then we have that For the purposes of this article, we need to consider the following (slightly more general) situation: Let N/M be a Galois subextension of K/M , and let E * be a Ribet M -curve which is completely defined over N and such that E Q ∼ E * Q . Observe that there always exist N and E * satisfying these conditions, for example by taking N = K and E * = E; but in §2.4 and §2.5 below we will exploit certain situations where N K and E * = E.
Then we can consider two cohomology classes: the class γ K E attached to E, and the class γ N E * attached to E * . We recall the following key result about γ K E , which is a particular case of [FG18, Corollary 2.4].
Theorem 2.12. The cohomology class γ K E is 2-torsion. Denote by U the set of roots of unity of M and put P = M × /U . The same argument of [FG18, Proof of Theorem 2.14] proves the following decomposition of 1 Actually, this is the inverse of the cocycle considered in [FG18], but this does not affect any of the results that we will use. (2.7) we will denote by (γ ± ,γ) its components under the isomorphism (2.7); we will refer to γ ± as the sign component and toγ as the degree component.
In order to study the relation between γ K E and γ N E * , define L/K to be the smallest extension such that E * L and E L are isogenous. Since all the endomorphisms of E are defined over K, this is also the smallest extension L/K such that Hom One can also characterize L/K as the minimal extension such that Now consider the following piece of the inflation-restriction exact sequence and therefore t(v) belongs to H 2 (Gal(K/M ), {±1}).
Observe that from Theorem 2.12 one cannot deduce that the class γ N E * is 2torsion, since A N is not isogenous to (E * ) 2 in general. By Lemma 2.13, what we do deduce is that inf K N (γ N E * ) 2 = 1. Therefore, once again by the inflation-restriction exact sequence The following technical lemma will be used in §2.5 below.
Lemma 2.14. Suppose that N/M is abelian and that By (2.11) and (2.12) we can suppose that there exists a map d : We see that 2.4. c-representations from squares of CM elliptic curves. Keep the notations from Section 2.3. We will denote by V the M -module Hom(E * L , A L ). Fix a system of isogenies {µ σ : σ E * → E * } σ∈Gal(L/M) . We do not have a natural action of Gal(L/M ) on V , but the next lemma says that we can use the chosen system of isogenies to define a c-action on V .
Lemma 2.15. The map Proof. This is tautological: Let now R denote the M -module End(A K ). It is equipped with the natural Galois conjugation action of Gal(L/M ), which factors through Gal(K/M ) and which we sometimes will write as ̺ R (σ)(ψ) = σ ψ. Let T denote Hom(V, V ), equipped with the c-representation structure given by Lemma 2.15 and Proposition 2.2. Note that by Corollary 2.5, we know that T is actually a M [Gal(L/M )]-module.
Lemma 2.16. The map is an isomorphism of c-representations (and thus of M [Gal(L/M )]-modules).
Proof. The fact that Φ is a morphism of c-representations is straightforward: where we have used Remark 2.1 in the second and last equalities. The lemma follows by noting that Φ is clearly injective and that both R and T have dimension 4 over M .
We now describe the M [Gal(K/M )]-module structure of R. It follows from (2.5) that the order r of an element σ ∈ Gal(K/M ) is 1, 2, 3, 4, or 6.
Remark 2.18. Note that this lemma is proven in [FS14, Proposition 3.4] under the strong running hypothesis of that paper: in our setting that hypothesis would say that there exists E * defined over M such that A Q ∼ E * 2 Q (i.e., that N can be taken to be M , in the notation of the previous section).
Proof. We claim that Tr(̺ R ) ∈ M is in fact rational. Let us postpone the proof of this claim until the end of the proof of the lemma. Assuming it, we have that But if ̺ R Q is the representation afforded by R regarded as an 8 dimensional module over Q, we have (2.14) Tr M/Q (Tr(̺ R (σ))) = Tr(̺ R Q )(σ) = 2(2 + ζ r + ζ r ), where the last equality is [FKRS12, Proposition 4.9]. The comparison of (2.13) and (2.14) concludes the proof of the lemma.
We turn now to prove the rationality of Tr ̺ R . We first recall the aforementioned proof (that of [FS14, Proposition 3.4]) which uses the fact that we can choose E * to be defined over M . In this case, we have that V is an M [Gal(L/M )]-module, that Tr(̺ V * ) is a sum of roots of unity so that Tr(̺ V * ) = Tr(̺ V ), and hence that Tr(̺ R ) = Tr(̺ V ) · Tr ̺ V belongs to Q.
For the general case, assume that Tr ̺ R does not belong to Q. Since it is a sum of roots of unity of orders diving either 4 or 6, then M would be Q(i) or Q( √ −3), but then we could take a model of E * defined over M , and by the above paragraph, the trace Tr ̺ R would be rational, which is a contradiction.

2.5.
Obstructions. Keep the notations from Section 2.4 and Section 2.3. Let S denote the normal subgroup of Gal(K/M ) generated by the square elements. In this section, we make the following hypotheses. Theorem 2.20. Under Hypothesis 2.19, we have: First of all, note that E * is completely defined over N . Thus we can, and do, assume that c L E * is the inflation of c N E * . Let s ∈ Gal(L/M ) be a lift of σ. By part ii) of Hypothesis 2.19, we have that [L : K] ≤ 2. Therefore, the order of s divides 2r. We then have where we have used that c N E * (σ 2e ,σ 2e ′ ) = 1 for any pair of integers e, e ′ . Let α and β be the eigenvalues of ̺ V (s). By (2.16), we have that α 2r = c N E * (σ,σ) r , from which we deduce that ω r α 2 = c N E * (σ,σ) ∈ M × , where ω r is a (not necessarily primitive) r-th root of unity.
Until the end of this section, we make the following additional assumption on M . We will first see that γ = resγ K E is trivial. Recall the decomposition (2.7) of the 2-torsion cohomology classes into degree and sign components H 2 (Gal(K/N ), M × )[2] ≃ H 2 (Gal(K/N ), {±1}) × Hom(Gal(K/N ), P/P 2 ), and the notation γ ± (resp.γ) for the sign component (resp. degree component) of γ. Since Gal(K/N ) ≃ C 3 is the subgroup of Gal(K/M ) generated by the squares, we have thatγ is trivial. Since we see that γ ± is also trivial. By Theorem 2.11, there exists an elliptic curve E * defined over N such that E * K ∼ E. To see that E * is completely defined over N , on the one hand, note that since M = Q(i), Q( √ −3), then E * and any Galois conjugate σ E * of it are isogenous over a quadratic extension of N . On the other hand, since E * K ∼ E and E is completely defined over K, we have that the smallest field of definition of Hom(E * Q , σ E * Q ) is contained in K. Since K/N is a cubic extension, we deduce that E * and σ E * are in fact isogenous over N . ii) an element t such that tst −1 = t a for 1 ≤ a ≤ 2r such that a ≡ −1 (mod r).
Proof. This is obvious when Gal(L/M ) is dihedral. For the other options allowed by Proposition 2.23, recall that QD 8 ≃ s, t | s 8 , t 2 , tsts 5 , Q 16 ≃ s, t | s 8 , t 2 s 4 , tst −1 s . Until the end of this section, we will assume that E * is as in the previous corollary. Let s and t be also as in the corollary, and let σ and τ be the images of s and t under the projection map Gal(L/M ) → Gal(K/M ) .
Recall also the projection map· : Gal(K/M ) → Gal(N/M ) and note thatσ andτ are non-trivial elements of Gal(N/M ).

Restriction of scalars of Gross Q-curves
For the convenience of the reader, in this section we review some results of Nakamura [Nak04] on Gross Q-curves, to which we refer for more details and proofs.
Let M be an imaginary quadratic field. Throughout this section, we make the following hypothesis.
ii) M has class group isomorphic to C 2 × C 2 . This list can be easily obtained from [Wat04], for example. Among them, only −340 is exceptional.
Then, by Proposition 2.10, there exists a Gross Q-curve E with CM by M , which is thus completely defined over the Hilbert class field H of M . The aim of the present section is to describe Nakamura's method for computing the endomorphism algebra of the restriction of scalars of a Gross Q-curve, which we will then apply to all Gross Q-curves attached to M satisfying Hypothesis 3.1. Our account of Nakamura's method will be only in the particular case where M has class group C 2 × C 2 , which is the case of interest to us.
As seen in Section 2.2, one can associate to E a cohomology class γ E := γ H E in the group 3.1. Hecke characters of Gross Q-curves. The first step is to compute a set of Hecke characters whose associated elliptic curves represent all the equivalence classes of Gross Q-curves.
Local characters. We begin by defining certain local characters that will be used to describe the Hecke characters. Let I M be the group of ideles of M . If p is a prime of M , we denote by U p = O × M,p the group of local units. Also, for a rational prime p put U p = p|p U p .
Suppose that p is odd and inert in M . Then define η p as the unique character η p : U p → {±1} such that η p (−1) = (−1) p−1 2 . Suppose now that 2 is ramified in M and write D = 4m. If m is odd, then Define η −4 : U 2 → {±1} to be the character with kernel 3 − 2 √ m, 5 . If m is even then Define η 8 to be the character with kernel 1 + √ m, −1 and η −8 the character with kernel 1 + √ m, −5 .
Hecke characters. Let U M = p U p be the maximal compact subgroup of I M . Let S be a finite set of primes of M and put U S = p∈S U p . Suppose that η : U S → {±1} is a continuous homomorphism such that η(−1) = −1. Next, we explain how to construct from η a Hecke character φ : I M → C × (not uniquely determined) that gives rise, in certain cases, to a Gross Q-curve.
First of all, extend η to a character that we denote by the same name η : U M → {±1} by composing with the projection U M → U S . Now this character η can be extended to a characterη : . For future reference, it will be useful to have the following formula for φ evaluated at certain principal ideals.
Lemma 3.3. Suppose that (α) is a principal ideal of M such that v p (α) = 0 for all p ∈ S, and denote by α S ∈ U S the natural image of α in U S . Then Proof. If we write (α) = q∈T q vq(α) , where T denotes the support of (α), then where φ q denotes the restriction of φ to M q and α q the image of α in M q . Observe that by hypothesis S ∩ T = ∅, and that if q ∈ S ∪ T , then φ q (α q ) = 1, since α q belongs to U q and φ |Uq =η |Uq = 1. Therefore, we can write where we have used that η has order 2. Then, by (3.1) we have that For example, if D has some prime factor q ≡ 3 (mod 4), put η 0 = η q . If all the odd primes dividing D are congruent to 1 modulo 4, then D = 8m for some odd m and we define η 0 to be η −8 . If we denote by φ 0 : I M → C × a Hecke character attached to η 0 by the above construction, then the Hecke character ψ 0 = φ 0 • N H/M is the Hecke character attached to a Gross Q-curve over H.
Denote byω 1 ,ω 2 the generators of W/W 0 , and define ω i =ω i • N H/M . Now let k/H be a quadratic extension such that k/Q is Galois and k/M is non-abelian. Such quadratic extensions exist by [Nak04, Theorem 1]. Denote by χ : I H → {±1} the Hecke character attached to k/H. By [Nak04, Theorem 2], the eight equivalence classes of Q-curves over H are represented by the Hecke characters ψ 0 · ω with ω ∈ ω 1 , ω 2 , χ . Observe that, in particular, this set of Hecke characters does not depend on the choice of k (any k which is Galois over Q and non-abelian over M will produce the same set of Hecke characters).

3.2.
Method for computing the endomorphism algebra. Let p 1 and p 2 be prime ideals of M that generate the class group and that are coprime to the conductors of ψ 0 , ω 1 , ω 2 , and χ. Let L i be the decomposition field of p i in H, and F i the maximal totally real subfield of L i .
Suppose that E is a Gross Q-curve over H with Hecke character of the form 2 . Then φ(p i ) + φ(p i ) generates a quadratic number field Q( √ n i ), and the endomorphism algebra D E = End(B E ) is isomorphic to the biquadratic field Q( √ n 1 , √ n 2 ) (cf. [Nak04, Proposition 7, Theorem 3]).
Remark 3.4. Observe that φ(p i ) + φ(p i ) can be computed if one knows the two quantities φ(p 2 i ) and φ(p ipi ). Since p 2 i and p ipi are principal, one can compute φ(p 2 i ) and φ(p ipi ) by means of (3.2). Suppose now that the Hecke character of E is of the form ψ = ψ 0 χω a 1 ω b 2 . Then D E is a quaternion algebra over Q, say D E ≃ t1,t2 Q . The t i can be computed as follows (see [Nak04,Proposition 7]). First of all, let n 1 and n 2 be the rational numbers defined as in the previous paragraph for the character ψ/χ = ψ 0 ω a 1 ω b 2 .

Computations and tables.
For each of the 23 non-exceptional imaginary quadratic fields of class group C 2 × C 2 , we have computed the 8 endomorphism algebras arising from restriction of scalars of Gross Q-curves. The results are displayed in Table 1. The notation is as follows: for the biquadratic fields, the notation (a, b) indicates the field Q( √ a, √ b); for the quaternion algebras, we write the discriminant of the algebra.
For a Gross Q-curve E, recall that we denote by B E the abelian variety over Q such that Res H/M E ∼ (B E ) M . Since B E is isogenous to its quadratic twist over M , this implies that We observe in Table 1 that for all discriminants except −195, −312, −555, −715, and −760, at least one of the quaternion algebras is the split algebra M 2 (Q) of discriminant 1. This implies that for the corresponding Gross Q-curve E the variety B E decomposes as with A/Q an abelian surface. Therefore, Res H/Q E decomposes as the fourth power of an abelian surface.
On the other hand, for the discriminants −195, −312, −555, −715, and −760 we see that B E is always simple: its endomorphism algebra is either a biquadratic field or a quaternion division algebra over Q. Therefore, Res H/Q E ∼ W 2 for some simple variety W of dimension 4. We record these findings in the following statement. We have used the software Sage [S + 14] and Magma [BCP97] to perform the computations of Table 1. The interested reader can find the code we used in https://github.com/xguitart/restriction_of_scalars_of_Q_curves.  Table 1. Endomorphism algebras of the restriction of scalars of Gross Q-curves. For the biquadratic fields, the notation (a, b) indicates the field Q( √ a, √ b); for the quaternion algebras, we write the discriminant of the algebra

Proof of the main theorems
We begin with a Lemma that will be used in the proof of Theorem 1.2. It is clear that we can always find p i , p j such that ±p i p j is not a square in M × , and therefore p i p j is not principal. Thus p i , p j generate the class group. Therefore, we can assume that any non-trivial element of Gal(H/K) is of the form σ q for some unramified prime q which is equivalent to either p i , p j or p i · p j . Here σ q stands for the Frobenius automorphism of H/K at q. Now we argue (and use the same notation) as in [Nak04, Proof of Theorem 3]. Namely, denote by u(q) the q-multiplication isogenies u(q) : σq E −→ E, and denote by c the 2-cocycle associated to E using the system of isogenies u(q) (together with the identity isogeny for 1 ∈ Gal(H/M )). Note that c E is any cocycle representing γ H E , and it may be different from c. But in any case they are cohomologous, which in particular implies that c(σ q , σ q ) = b 2 q · c E (σ q , σ q ) for some b q ∈ M × . (4.1) From display (6) and the display after that of loc. cit., since the order n of σ q is 2 in our case, we see that The proof is finished by observing that q 2 = αO M , where α ∈ M × is, up to an element of (M × ) 2 , equal to ±p i , ±p j , or ±p i · p j .
Proof of Theorem 1.2. For all the quadratic imaginary fields not listed in (1.2), we have constructed in the first part of Theorem 3.5 abelian surfaces defined over Q satisfying the hypothesis of the theorem. To rule out the remaining 6 fields, we proceed in the following way.
Let M be one of the fields in the list (1.2) and suppose that an abelian surface A satisfying the hypothesis of the theorem exists for M . Resume the notations from Section 2.4. As Gal(H/M ) ≃ C 2 × C 2 and H ⊆ K (by [FG18, Theorem 2.14]), the only possibilities for Gal(K/M ) are C 2 × C 2 , D 4 , and D 6 .
Suppose that Gal(K/M ) is C 2 × C 2 . Then K = H and thus E is a Gross Q-curve. By Proposition 2.10, we have that M is not exceptional and thus we cannot have M = Q( √ −340). For the other possibilities for M , we have seen in the second part of Theorem 3.5 that Res H/Q E does not have any simple factor of dimension 2, but this is a contradiction with the fact that A should be a factor of Res If M is non-exceptional, as noted in Remark 2.26, we can suppose that E * is in fact a Gross Q-curve. Then (4.2) is a contradiction with Lemma 4.1.
It remains to show that (4.2) also brings a contradiction if M = Q( √ −340) is the exceptional field. Put T = H τ , the fixed field byτ . Observe that M T H. If c H E * (τ ,τ ) = 1 then by Theorem 2.11 the curve E * is isogenous to a curve defined over T , and this is a contradiction with the fact that M (j E * ) = H.
Suppose now that c H E * (τ ,τ ) = −1. We will see that we can apply the above argument to an appropriate quadratic twist of E * . We now show how this claim allows us to produce the appropriate twisted curve (and we will prove the claim later on). Define C to be the S/H quadratic twist of E * . By [FG18,Lemma 3.13], the curve C is an M -curve completely defined over H and the cohomology classes of E * and C are related by If we identify Gal(S/M ) ≃ s, t|s 4 , t 2 , stst , then Gal(S/H) can be identified with the subgroup generated by s 2 and we can assume thatτ lifts to s. Let c S be a cocycle representing γ S . The usual construction that associates a cohomology class to (4.3) gives that c S (τ ,τ ) = s · s. Since s 2 is the non-trivial element of Gal(S/H), it corresponds to −1 under the isomorphism Gal(S/H) ≃ {±1}, so that c S (τ ,τ ) = −1.
We conclude that c H C (τ ,τ ) = c H E * (τ ,τ )c S (τ ,τ ) = 1, and as before this implies that C can be defined over T , which is a contradiction.
Proof Since they are all the split, the field S does exist in all three cases.  , where M is a quadratic imaginary field, depending on whether E has CM or not. Assume that we are in the former case. By Theorem 1.1, we have that M has class group 1, C 2 , or C 2 × C 2 . As explained in [FG18, Remark 2.20], for all fields M with class group 1 (resp. C 2 ), abelian surfaces A over Q with End(A Q ) ≃ M 2 (M ) can be easily found. Indeed, let E be an elliptic curve with CM by the maximal order of M and defined over Q (resp. Q(j E )). Then consider the square (resp. the restriction of scalars from Q(j E ) down to Q) of E. If M has class group C 2 × C 2 , invoke Theorem 1.2 to obtain 18 possibilities for M . Taking into account that there are 18 quadratic imaginary fields of class group C 2 (see [Wat04] for example), we obtain 46 possibilities for the endomorphism algebra of a geometrically split abelian surface over Q with Q-isogenous factors.
An open problem. We wish to conclude the article with an open question.
Question 4.4. Which is the subset of A made of the Q-endomorphism algebras End(Jac(C) Q ) of geometrically split Jacobians of genus 2 curves C defined over Q?
Again the most intriguing case is to determine how many of the 45 possibilities for M 2 (M ), with M a quadratic imaginary field, allowed by Theorem 1.2 for geometrically split abelian surfaces defined over Q still occur among geometrically split Jacobians of genus 2 curves C defined over Q. Looking at the more restrictive setting that requires Jac(C) to be isomorphic to the square of an elliptic curve with CM by the maximal order of M , Gélin, Howe, and Ritzenthaler [GHR19] have shown that there are 13 possibilities for such an M (all with class number ≤ 2).