# Building Blocks

The abelian variety $A_f/{\mathbb{Q}}$ associated to a newform $f$ is isogenous over $\overline{{\mathbb{Q}}}$ to a power ${B_f}^r$ of some simple variety $B_f$, which is called a “building block”. This section is concerned with computations related to the field of definition of $B_f$, and its endomorphism algebra.

The functions in this section take spaces of modular symbols, and *must have sign* $+1$. For instance, the modular symbols of level $N$, weight $2$ and sign $+1$ are obtained from `ModularSymbols(N,2,1)`. (These spaces have the same dimension as the corresponding spaces of modular forms.) Furthermore, the space of symbols is expected to be *cuspidal, new and irreducible over* ${\mathbb{Q}}$ (in other words, the corresponding space of cusp forms is spanned by a single Galois orbit of newforms).

*Acknowledgement:* This section was contributed by Jordi Quer. For more details of the theory, and some tables, see [[Quer, 2009](../../references.md#cite-quer-building-blocks)].

## Background and Notation

Let $f=\sum_{n=1}^\infty a_n q^n\in S_2^{new}(N,\varepsilon)$ be a newform of weight $2$, level $N$ and Nebentypus $\varepsilon$. Let $E$ be the number field generated by the coefficients $a_n$, and let $F$ be the field generated by the numbers $\mu_p := {a_p^2/\varepsilon(p)}$ for primes $p$ not dividing $N$.

The abelian variety $A_f/{\mathbb{Q}}$ attached to $f$ (that is, associated to the space spanned by $f$ and its conjugates) is a variety of dimension equal to the degree $[E:{\mathbb{Q}}]$ with endomorphism algebra ${\operatorname{End}}_{{\mathbb{Q}}}(A_f) \otimes {\mathbb{Q}}$ isomorphic to $E$.

The variety $A_f$ has complex multiplication if there is a nontrivial character $\chi$ (necessarily of order $2$) such that $a_p=\chi(p) a_p$ for all $p$ not dividing $N$, and in this case the variety $B_f$ is an elliptic curve with complex multiplication by the quadratic field fixed by the kernel of $\chi$.

We assume for the rest of this section that $A_f$ has no complex multiplication. Then, the field $F$ is totally real, and $E/F$ is an abelian extension. $E$ is totally real when $\varepsilon$ is trivial, and otherwise $E$ is a CM field. The endomorphism algebra ${\operatorname{End}}(B_f) \otimes {\mathbb{Q}}$ is a division algebra with centre $F$. It is either equal to $F$, and then $\dim(B_f)=[F:{\mathbb{Q}}]$ and $r=[E:F]$, or otherwise is a quaternion algebra over $F$, and then $\dim(B_f)=2[F:{\mathbb{Q}}]$ and $r=[E:F]/2$.

For every element $s\in G_F$ there exists a unique primitive Dirichlet character $\chi_s$, which only depends on the action of $s$ on the field $E$, such that $a_p^s =\chi_s(p) a_p$ for all $p$ not dividing $N$. The characters $\chi_s$ are called the *inner twists* of the form $f$.

Let $F_\delta$ be the extension of $F$ generated by the square roots of the elements $\mu_p\in F$ (for $p$ not dividing $N$). Note that $E F_\delta=E(\sqrt{\varepsilon})$, the field obtained by adjoining square roots of the character values, which is either $E$ or a quadratic extension of $E$. We may associate to each $s \in {\operatorname{Gal}}(F_\delta/F)$ a primitive quadratic Dirichlet character $\psi_s$, defined by $\sqrt{\mu_p}^s=\psi_s(p) \sqrt{\mu_p}$ (for $p$ not dividing $N$). These are called the *quadratic degree characters* of the form $f$. They are related with the inner twists of $f$ by the identity $\chi_s(p)=\psi_s(p)\sqrt{\varepsilon(p)}^s/\sqrt{\varepsilon(p)} .$

Let $K_P/{\mathbb{Q}}$ be the field fixed by the kernel of the homomorphism $\delta : G_{{\mathbb{Q}}} \to  F^*/F^{*2}$ that sends $Frob_p$ to $\mu_p$ for all $p$ not dividing $N$ with $a_p$ nonzero. (This is enough to determine the homomorphism, because the primes with $a_p=0$ have density zero). This homomorphism is returned by `DegreeMap` (the syntax uses the notation below).

The Galois group $Gal(K_P/{\mathbb{Q}})$ is abelian of exponent $2$; choose a basis $\sigma_1,...,\sigma_r$. Let $\psi_1,...,\psi_r$ be the basis of ${\operatorname{Hom}}(Gal(K_P/{\mathbb{Q}}), {\mathbb{Z}}/2)$ dual to the basis $\{\sigma_i\}$, and consider the $\psi_i$’s as characters on $G_{{\mathbb{Q}}}$. Also let $t_i$ be a quadratic discriminant such that ${\mathbb{Q}}(\sqrt{t_i}) \subset K_P$ is the field fixed by the kernel of $\psi_i$.

Denote by $\gamma_\varepsilon$ the element of $Br({\mathbb{Q}})[2]$ given by the two-cocycle sending $\sigma,\tau$ to $\sqrt{\varepsilon(\sigma)} \sqrt{\varepsilon(\tau)} {\sqrt{\varepsilon(\sigma\tau)}}^{-1}.$ Then the class in $Br(F)[2]$ of the endomorphism algebra ${\operatorname{End}}^0(B_f)$ is the restriction to $F$ of $\gamma_\varepsilon \prod(t_i,\delta(\sigma_i)).$ This is computed by `BrauerClass`.

In general the smallest fields of definition up to isogeny for $B_f$ are quadratic extensions of $K_P$. It is sometimes possible to “descend” $B_f$ (up to isogeny) to the field $K_P$. The obstruction to this descent lies in $Br(K_P)[2]$, and is given by the restriction of $\gamma_\varepsilon$ to $K_P$. This is computed by `ObstructionDescentBuildingBlock`.

### `BoundedFSubspace(epsilon, k, degrees): GrpDrchElt, RngIntElt, [RngIntElt] -> [ ModSym ]`

A sequence containing the irreducible subspaces of the modular symbols of weight $k$ and Nebentypus character $\epsilon$ corresponding to non-CM newforms for which the degree $[F:{\mathbb{Q}}]$ of the centre of the endomorphism algebra (of the associated abelian variety) is in the sequence $degrees$.

### `HasCM(M : parameters): ModSym -> BoolElt, RngIntElt`

### `IsCM(M : parameters): ModSym -> BoolElt, RngIntElt`

```magma
Proof: BoolElt                    Default: false
```

Return `true` if and only if the modular abelian variety attached to the given space of modular symbols has complex multiplication. When the level is larger than $100$, an unproved bound is used in the computation, unless `Proof` is set to `true`.

### `InnerTwists(A : parameters): ModAbVar -> [ GrpDrchElt ]`

### `InnerTwists(M : parameters): ModSym -> [ GrpDrchElt ]`

```magma
Proof: BoolElt                    Default: false
```

The inner twists of the newform $f = \sum a_n q^n$ corresponding to the given space of modular symbols, or to the given modular abelian variety. This should be irreducible over ${\mathbb{Q}}$, and $f$ should not have CM, and only spaces of modular symbols with sign $+1$ are accepted.

The inner twists are Dirichlet characters satisfying $\chi_s(p) = a_p^s/a_p$ (for primes $p$ not dividing the level), where $s$ is in the absolute Galois group of ${\mathbb{Q}}$.

*Warning:* when the level is larger than $100$, a non-rigorous bound is used in the computation, unless `Proof` is set to `true`. Even in that case, the returned twists are only checked to be inner twists up to precision $10^{-5}$.

### `DegreeMap(M : parameters): ModSym -> [ Tup ], Fld`

```magma
Proof: BoolElt                    Default: false
```

The homomorphism $\delta : G_{{\mathbb{Q}}} \to  F^*/F^{*2}$ (as defined in the introduction), attached to the given space $M$ of modular symbols (which should be new, irreducible over ${\mathbb{Q}}$, and have sign $+1$). The second object returned is $F$. The first object returned is a sequence of tuples $<t_i, f_i>$, where $t_i \in {\mathbb{Q}}$ are quadratic discriminants and $f_i \in F$. The $t_i$ determine a basis $\sigma_i$ of ${\operatorname{Gal}}(K_P/{\mathbb{Q}})$ as in the introduction, and $\delta$ is the map sending $\sigma_i$ to $f_i$.

### `BrauerClass(M): ModSym -> SeqEnum`

Given a space of modular symbols $M$ corresponding to a newform $f$, this function computes the Brauer class of the endomorphism algebra of the associated abelian variety $A_f$ (or motive $M_f$). The endomorphism algebra is either a number field $F$ (in which case an empty sequence is returned), or a quaternion algebra over a number field $F$. The corresponding class in the Brauer group $Br(F)[2]$ is specified by returning the sequence of places of $F$ that ramify in the quaternion algebra.

The given space $M$ should be irreducible over ${\mathbb{Q}}$, and have sign $+1$, and $f$ should not have CM.

### `ObstructionDescentBuildingBlock(M): ModSym -> SeqEnum`

Given a space of modular symbols $M$ corresponding to a newform $f$, this function computes the obstruction to “descending” the building block $B_f$ to the field $K_P$ (for definitions, see the introduction). The obstruction to the existence of a building block over $K_P$ isogenous to $B_f$ is an element of the Brauer group $Br(K_P)[2]$. (More precisely, for any field $L$ there exists such a building block over $L$ if and only if $L$ is an extension of $K_P$ over which this Brauer element splits.) The Brauer class is specified by returning the sequence of places of $K_P$ where the class is not locally trivial.

The given space $M$ should be irreducible over ${\mathbb{Q}}$, and have sign $+1$, and $f$ should not have CM.

### `Example: Complements Complements (ex-0906d5)`

The lowest level where a nontrivial obstruction occurs is $28$, with a character of order $6$. We find that the space of modular symbols (with sign $1$) for this character has dimension $2$ over the field of character values.

```magma
> Chi28 := FullDirichletGroup(28);
> chi := Chi28.1*Chi28.2;
> Chi28;
Group of Dirichlet characters of modulus 28
   over Cyclotomic Field of order 6 and degree 2
> Order(Chi28), Order(chi);
12 6
>  M28chi := CuspidalSubspace( ModularSymbols(chi, 2, 1));
> M28chi;
Modular symbols space of level 28, weight 2, character $.1*$.2, and dimension
2 over Cyclotomic Field of order 6 and degree 2
> qEigenform(M28chi);
q + (1/3*(-zeta_6 - 1)*a - zeta_6)*q^2 + a*q^3 + 1/3*(4*zeta_6 - 2)*a*q^4 +
    (zeta_6 - 2)*q^5 + (-zeta_6*a + (2*zeta_6 - 1))*q^6 + 1/3*(-zeta_6 - 4)*a*q^7
    + O(q^8)
> Parent(Coefficients(qEigenform(M28chi))[2]);
Univariate Quotient Polynomial Algebra in a
   over Cyclotomic Field of order 6 and degree 2
   with modulus a^2 + 3*zeta_6

```

So the q-eigenform is defined over a quadratic extension of ${\mathbb{Q}}(\zeta_6)$, In fact, this extension is ${\mathbb{Q}}(\zeta_6, i)$. Since the space `M28chi` has dimension $2$ over ${\mathbb{Q}}(\zeta_6)$, it is irreducible over ${\mathbb{Q}}(\zeta_6)$. The corresponding abelian variety over ${\mathbb{Q}}$ therefore has dimension $4$.

```magma
> A := ModularAbelianVariety(M28chi);
> A;
Modular abelian variety of dimension 4 and level 2^2*7 over Q with sign 1
> delta, F := DegreeMap(M28chi);
> F;
Rational Field

```

This means that $A$ is isogenous to $B^2$ for some abelian variety $B$ over $\overline{{\mathbb{Q}}}$ of dimension 2, and that the endomorphism algebra of $B$ is a quaternion algebra over $F = {\mathbb{Q}}$.

```magma
> BrauerClass(M28chi);
[ 2, 3 ]

```

This means the endomorphism algebra of $B$ is the quaternion algebra over ${\mathbb{Q}}$ ramified only at 2 and 3. Now we determine the possible fields of definition of $B$.

```magma
> delta;  // This came from DegreeMap, above.
[ <-7, 3> ]

```

In particular, this tells us that $K_P = {\mathbb{Q}}(\sqrt{-7})$.

```magma
> ObstructionDescentBuildingBlock(M28chi);
[ Place at Prime Ideal
Two element generators:
    [2, 0]
    [0, 1],
Place at Prime Ideal
Two element generators:
    [2, 0]
    [3, 1] ]
> Universe($1);  // What are these places elements of?
Set of Places of Number Field with defining polynomial x^2 + 7
over the Rational Field

```

The obstruction is given as a list of places of ${\mathbb{Q}}(\sqrt{-7})$. Recall that $B$ can be defined over any extension of $K_P$ for which the obstruction is trivial. In this case, any extension of ${\mathbb{Q}}(\sqrt{-7})$ which splits the quaternion algebra over ${\mathbb{Q}}(\sqrt{-7})$ ramified at the two primes above $2$.
