# Arithmetic with $L$-series

With the exception of some modular forms, all the built-in $L$-series have weakly multiplicative coefficients, so that $L(s)=\sum a_n/n^s$ with $a_{mn}=a_ma_n$ for $m$, $n$ coprime. For two such $L$-series, Magma allows the user to construct their product and, provided that it makes sense, their quotient.

There are also various methods to construct a new $L$-function from old $L$-functions, namely tensor products and symmetrizations. The notion of Hodge structure is also useful to have.

## `L1 * L2: LSer, LSer -> LSer`

```magma
Poles    : SeqEnum                      Default: []
Residues : SeqEnum                      Default: []
Precision: RngIntElt                    Default: 
```

Let $L_1(s)$ and $L_2(s)$ be two $L$-series of the same weight whose coefficients are weakly multiplicative, that is, they satisfy $a_{mn}=a_ma_n$ for $m,n$ coprime. This function constructs their product $L(s)=L_1(s)L_2(s)$.

If one of the $L$-series has zeros that cancel the poles of the other $L$-series, the user should specify the list of poles for $L_1^*(s)L_2^*(s)$ using the `Poles` parameter and the corresponding residues using the `Residues` parameter. See Section [Terminology](general.md#terminology) for the terminology and Section [Constructing a General $L$-Series](general.md#gensig) for the format of the poles and residues parameters.

The number of digits of precision to which the values $L(s)$ are to be computed may be specified using the `Precision` parameter. If it is omitted, the precision is taken to be that of the default real field.

## `L1 / L2: LSer, LSer -> LSer`

```magma
Poles    : SeqEnum                      Default: []
Residues : SeqEnum                      Default: []
Precision: RngIntElt                    Default: 
```

Let $L_1(s)$ and $L_2(s)$ be two $L$-series whose coefficients $a_{mn}$ are weakly multiplicative, that is, they satisfy $a_{mn}=a_ma_n$ for $m,n$ coprime. This function constructs their quotient $L(s)=L_1(s)/L_2(s)$.

This function assumes (but does not check!) that this quotient exists and is a genuine $L$-function with finitely many poles.

If $L_2(s)$ happens to have zeros that give poles in the quotient, the user must specify the list of poles of $L_1^*(s)/L_2^*(s)$ using the `Poles` parameter and the corresponding residues using the `Residues` parameter. See Section [Terminology](general.md#terminology) for the terminology and Section [Constructing a General $L$-Series](general.md#gensig) for the format of `Poles` and `Residues`.

The number of digits of precision to which the values $L(s)$ are to be computed may be specified using the `Precision` parameter. If it is omitted, the precision is taken to be minimum of that of the inputs.

## Hodge Structure

Magma can compute with Hodge structures of an $L$-series. In the sense of Deligne [[Deligne, 1979](../../references.md#cite-deligne-rootnumber), Table 5.3], this is printed as a series of $\langle p,q\rangle$ pairs and $\langle p,p,\epsilon\rangle$ triples, where the former have $p<q$ and correspond to $H^{p,q}$ and $H^{q,p}$, and with the latter $F_\infty=(-1)^{p+\epsilon}$ is the action of complex conjugation on $H^{p,p}$. An alternative printing (of the `HodgeVector`) can be obtained from the vararg `PrintHodgeVector` or `PHV` when creating a Hodge structure.

Hodge structures of the same weight (possibly negative) can be added or subtracted (though virtual Hodge structures are not currently allowed). They can also be tensored and inverted (the latter negates all $p,q$) via the multiplication operator and `Dual`.

### `HasHodgeStructure(L): LSer -> BoolElt, HodgeStruc`

### `HodgeStructure(L): LSer -> HodgeStruc`

Given an $L$-series, determine if it has a Hodge structure. The `HodgeStructure` intrinsic can also be applied to various other objects.

### `HodgeStructure(X): SeqEnum -> HodgeStruc`

Given a sequence (or other aggregate) of tuples corresponding to Hodge $(p,q)$’s, construct the given Hodge structure. Here both $(p,q)$ and $(q,p)$ must be given (for redundancy), and $(p,p,\epsilon)$ must have its sign given as a third element in the tuple.

### `HodgeStructure(w, G): RngIntElt, SeqEnum -> HodgeStruc`

Given a weight and a sequence of $\gamma$-shifts, return the Hodge structure.

### `Dual(HS): HodgeStruc -> HodgeStruc`

Given a Hodge structure, negate all the $(p,q)$’s.

### `TateTwist(HS, k): HodgeStruc, RngIntElt -> HodgeStruc`

Given a Hodge structure and an integer, take the Tate twist of the structure. This subtracts $k$ from all the $p$ and $q$, decreasing the weight by $2k$. This corresponds to translating the $L$-function in the complex plane.

### `Translate(L, z): LSer, RngIntElt -> LSer`

### `Translate(L, z): LSer, FldRatElt -> LSer`

Given an $L$-series, translate it by the given integer (or rational).

### `GammaFactors(HS): HodgeStruc -> SeqEnum`

### `GammaShifts(HS): HodgeStruc -> SeqEnum`

### `Degree(HS): HodgeStruc -> RngIntElt`

### `Weight(HS): HodgeStruc -> RngIntElt`

The $\gamma$-factors (or shifts), degree, and (motivic) weight of a Hodge structure.

### `EffectiveHodgeStructure(HS): HodgeStruc -> HodgeStruc, RngIntElt`

The Hodge structure obtained by shifting so that all $p,q\ge 0$ with at least one of them equal to zero. Also returns the shift amount.

### `RootNumber(HS): HodgeStruc -> FldCycElt`

The root number at $\infty$ of a Hodge structure, which is a 4th root of unity.

Note that this is the reciprocal of that given by Deligne in [[Deligne, 1979](../../references.md#cite-deligne-rootnumber), Table 5.3].

### `TensorProduct(H1, H2): HodgeStruc, HodgeStruc -> HodgeStruc`

This is the standard operation on Hodge structures, also accessible via the ‘*’ operator.

### `SymmetricPower(HS, m): HodgeStruc, RngIntElt -> HodgeStruc`

The $m$th symmetric power of a Hodge structure.

### `Determinant(HS): HodgeStruc -> HodgeStruc`

The determinant of a Hodge structure.

### `AlternatingSquare(HS): HodgeStruc -> HodgeStruc`

The alternating square of Hodge structure. The general symmetrization intrinsic for Hodge structures has not been implemented at this time, but these last examples are probably the more interesting cases.

### `HodgeVector(HS): HodgeStruc -> SeqEnum, RngIntElt`

Given a Hodge structure, return its Hodge vector, and the Tate twist to make it effective. This is an array of $h^{p,q}$ starting which the first nonzero.

### `CriticalPoints(HS): HodgeStruc -> SeqEnum`

### `CriticalPoints(L): LSer -> SeqEnum`

Given a Hodge structure or an L-series with a Hodge structure, return its critical points. In the case that the list is infinite, it will be truncated at height 100.

### `ImaginaryTwist(HS): HodgeStruc -> HodgeStruc`

Take the tensor product with the nontrivial weight 0 Hodge structure.

### `Example: Lseries Hodge Struc (ex-271a08)`

Some examples of Hodge structures and operations.

```magma
> LE := LSeries(EllipticCurve("11a"));
> HE := HodgeStructure(LE); HE;
Hodge structure of weight 1 given by <0,1>
> Lf := LSeries(Newforms(CuspForms(9,4))[1][1]);
> Hf := HodgeStructure(Lf); Hf;
Hodge structure of weight 3 given by <0,3>
> PR := Translate(LE,1)*Lf;
> HodgeStructure(PR);
Hodge structure of weight 3 given by <0,3> <1,2>
> TateTwist(HE,-1)+Hf; // direct sum
Hodge structure of weight 3 given by <0,3> <1,2>
> TP := TensorProduct(LE,Lf);
> HodgeStructure(TP);
Hodge structure of weight 4 given by <0,4> <1,3>
> HE*Hf; // tensor product
Hodge structure of weight 4 given by <0,4> <1,3>
> RootNumber(HodgeStructure([[0,0,1]])); // imag quad field
-zeta_4
> RootNumber(HE); // elliptic curve
-1
> RootNumber(Hf); // wt 4 modform
1
> assert SymmetricPower(HE,2) eq HodgeStructure(SymmetricPower(LE,2));
> CriticalPoints(SymmetricPower(Hf,2));
[ 1, 3, 4, 6 ]
>   CriticalPoints(ImaginaryTwist(SymmetricPower(Hf,2)));
[ 2, 5 ]

```

## Tensor Products

The above discussion with Hodge structure folds nicely into the `TensorProduct` machinery.

### `TensorProduct(L1, L2, ExcFactors): LSer, LSer, [<>] -> LSer`

### `TensorProduct(L1, L2, ExcFactors, K): LSer, LSer, [<>], FldNum -> LSer`

### `TensorProduct(L1, L2): LSer, LSer -> LSer`

### `TensorProduct(L1, L2, K): LSer, LSer, FldNum -> LSer`

```magma
BadPrimes: SeqEnum                      Default: []
Precision: RngIntElt                    Default: 
Sign     : FldComElt                    Default: 
```

Let $L_1$ and $L_2$ be $L$-functions such that $L_1(s)=L(V_1,s)$ and $L_2(s)=L(V_2,s)$ are associated to systems of $l$-adic representations $V_1$ and $V_2$ (à la Serre). This function computes their tensor product $L(s)=L(V_1\otimes V_2,s)$. This can be used, for example, to twist an $L$-function by characters or higher-dimensional Artin representations (see Examples [Example: ex5](../../AlgebraicGeometry/Schemes/introduction.md#example-ex-8febb0), [Example: ex6](../../AlgebraicGeometry/Schemes/introduction.md#example-ex-7c74bf)).

Note that, in particular, both $L_1(s)$ and $L_2(s)$ must have integer conductor, weakly multiplicative coefficients and an underlying Hodge structure (which is computed from the $\gamma$-shifts). The argument `ExcFactors` (or the vararg `BadPrimes`) is a list of tuples of the form $\langle p,v \rangle$ or $\langle p, v, F_p(x) \rangle$ that give, for each of the primes $p$ where $V_1$ and $V_2$ both have bad reduction, the valuation $v$ of the conductor of $V_1\otimes V_2$ at $p$ and the inverse local factor at $p$. If the data is not provided for such a prime $p$, Magma will attempt to compute the local factors by assuming that the inertia invariants behave well at $p$,

$$
(V_1\otimes V_2)^{I_p} = V_1^{I_p}\otimes V_2^{I_p}.
$$

It will also compute the conductor exponents by predicting the tame and wild degrees from the degrees of the local factors, but this does not work if both $V_1$ and $V_2$ are wildly ramified at $p$.

The sign in the functional equation of $L(V_1\otimes V_2,s)$ cannot be determined from the signs of the factors, so it will be calculated numerically from the functional equation. If the sign is known, the user may specify it by means of the `Sign` parameter.

The number of digits of precision to which the values $L(s)$ are to be computed may be specified using the `Precision` parameter. If it is omitted, the precision is taken to be the minimal precision among the tensor parts.

Some tensor products can induce poles, particularly when tensoring an $L$-series with itself. Also in some cases, the tensor product will be taken over ${\bf Q}$ unless the user specifies otherwise.

However, if $L_1$ and $L_2$ have Euler products over the same field $K$, this field can be given as an additional argument, and the tensor product will be taken with respect to that field. Namely, we take two $L$-functions with Euler products over a field $K$:

$$
L_1(M,s)=\prod_{\mathfrak{p}}\prod_{i=1}^{m}
   \bigl(1-\alpha_i({\mathfrak{p}})/{\rm N}{\mathfrak{p}}^s\bigr)^{-1}\quad{\rm and}\quad
   L_2(N,s)=\prod_{\mathfrak{p}}\prod_{j=1}^{n} \bigl(1-\beta_j({\mathfrak{p}})/{\rm N}{\mathfrak{p}}^s\bigr)^{-1},
$$

where $M$ and $N$ are of degrees $m$ and $n$ respectively, and we ignore bad Euler factors in the above. Their tensor product is an $L$-function of degree $mn$ given by

$$
L(A\otimes B,s)=\prod_{\mathfrak{p}}\prod_{i=1}^{m}\prod_{j=1}^{n}
   \bigl(1-\alpha_i({\mathfrak{p}})\beta_j({\mathfrak{p}})/{\rm N}{\mathfrak{p}}^s\bigr)^{-1}.
$$

It is not clear in general how to compute bad Euler factors, and even the gamma factors can be tricky. Internally, the functionality tries to compute a “Hodge structure” corresponding to the gamma factors of each object, with the “Hodge structure” for the tensor product then following via combinatorics, before passing back to the gamma factors.

### `Example: Ec Tensorprod (ex-8a6681)`

A tensor product of two elliptic curves over ${\bf Q}$.

```magma
> E1 := EllipticCurve("11a");
> E2 := EllipticCurve("17a");
> L1 := LSeries(E1);
> L2 := LSeries(E2);
> L := TensorProduct(L1, L2, []);
> LSeriesData(L); // level is 11^2 * 17^2
<3, [ -1, 0, 0, 1 ], 34969, function(p, d [ Precision ]) ... end function, 0,
   [], []>
> CFENew(L);
0.000000000000000000000000000000

```

### `Example: Level1 Modform (ex-0e486d)`

A tensor product of two modular forms of level 1.

```magma
> f1 := ModularForms(1,12).2;
> f2 := ModularForms(1,26).2;
> L1 := LSeries(f1);
> L2 := LSeries(f2);
> L := TensorProduct(L1, L2, []);
WARNING: Modular form is not known to be a newform
WARNING: Modular form is not known to be a newform
> LSeriesData(L); // weight is (12-1)+(26-1)+1 -- motivic weight is 11+25
<37, [ -11, -10, 0, 1 ], 1, function(p, d [ Precision ]) ... end function, 0,
   [], []>
> CFENew(L);
0.000000000000000000000000000000
> Pi(RealField(30))^2 * Evaluate(L,24) / Evaluate(L,25);
9.87142857142857142857142857142
> 691/70.; // Ramanujan congruence
9.87142857142857142857142857142

```

### `Example: Siegel Modular Form (ex-f0736e)`

An example related to Siegel modular forms (see [[van Geemen and van Straten, 1993](../../references.md#cite-geemen-straten), §8.7]).

```magma
> E := EllipticCurve("32a"); // congruent number curve
> chi := DirichletGroup(32).1; // character of conductor 4 lifted
> MF := ModularForms(chi, 3); // weight 3 modular forms on Gamma1(32,chi)
> NF := Newforms(MF);
> NF[1][1]; // q-expansion of the desired form
q + a*q^3 + 2*q^5 - 2*a*q^7 - 7*q^9 - a*q^11 + O(q^12)
> Parent(Coefficient(NF[1][1], 3)); // defined over Q(i)
Number Field with defining polynomial x^2 + 16 over the Rational Field
> f1, f2 := Explode(ComplexEmbeddings(NF[1][1])[1]);
> L1 := LSeries(E);
> L2 := LSeries(f1); // first complex embedding
> L := TensorProduct(L1, L2, [ <2, 9> ]); // conductor 2^9 (guessed)
WARNING: Modular form is not known to be a newform
> time CFENew(L);
3.15544362088404722164691426113E-30
Time: 1.900

```

### `Example: Tensprod OverK (ex-f991ed)`

An example of a tensor product over a field larger than the rationals.

```magma
> K<s> := QuadraticField(-3);
> I := Factorization(3 * IntegerRing(K))[1][1];
> H := HeckeCharacterGroup(I^2);
> G := Grossencharacter(H.0, [[1, 0]]); // canonical character
> E := EllipticCurve([1, (3+s)/2, 0, (1+s)/2, 0]);
> Norm(Conductor(E));
73
> LG := LSeries(G);
> LE := LSeries(E);
> TP := TensorProduct(LE, LG, [<I, 5>], K); // ensure 3-part correct
> LSetPrecision(TP, 9); // there is another factor of 3 from K
> LCfRequired(TP); // approx for old CheckFunctionalEquation
1642
> CFENew(TP);
0.000000000

```

### `Example: Consani Scholten (ex-1ad661)`

Another example of a tensor product over a field larger than the rationals. This comes from work of Consani and Scholten [[Consani and Scholten, 2001](../../references.md#cite-consani-scholten)], and the motivic realisation was later proven by Dieufelait, Pacetti, and Schütt [[Dieulefait *et al.*, 2012](../../references.md#cite-dps2012)].

```magma
> K := NumberField(x^2 - 5) where x is PolynomialRing(Rationals()).1;
> SetStoreModularForms(K, true); // to save computation time
> f5 := Factorization(5*Integers(K))[1][1];
> H := HilbertCuspForms(K,2*3*f5,[2,4]);
> N := NewformDecomposition(NewSubspace(H)); // 4-dimensional
> f11 := Factorization(11*Integers(K))[1][1]; // get right form
> f := [f : f in N | HeckeEigenvalue(Eigenform(f),f11) in
>                                           {2*K.1-58,-2*K.1-58}][1];
> Lf := LSeries(Eigenform(f));
> psi := HeckeCharacterGroup(f5,[1,2]).1;
> Lpsi := LSeries(psi);
> R := PolynomialRing(Integers());
> TP := TensorProduct(Lf,Lpsi,[<f5,3,R!1>],K); // 5^4 in all, 1 from K

```

The above constructs the $L$-series of a specific Hilbert modular form of weight $[2,4]$ of level $6\sqrt 5$ over ${\bf Q}(\sqrt 5)$, and then twists it by a nontrivial Hecke character. This corresponds to twisting the Fourier coefficients by a Dirichlet character of this field, which yields a Hilbert modular form at level $6(\sqrt 5)^2$. We construct this latter form below.

We then compare the $L$-series data (to ensure that Magma correctly worked with the Hodge structure over the real quadratic field in the tensor product), and Euler factors up to 100 (a weak check). The use of `CFENew` or `CheckFunctionalEquation` to (say) 6 digits takes a few minutes, so we omit it here.

```magma
> H := HilbertCuspForms(K, 2*3*f5^2, [2,4]);
> time N := NewformDecomposition(NewSubspace(H));
Time: 1.410
> g := [g : g in N | Dimension(g) eq 1 and
>                  HeckeEigenvalue(Eigenform(g),f11) in {2*K.1-58,-2*K.1-58}][1];
> Lg := LSeries(Eigenform(g));
> assert forall{ i : i in [1..3] |
>                LSeriesData(TP)[i] eq LSeriesData(Lg)[i] };
> // weak check of Euler factors
> assert forall{ p : p in PrimesUpTo(100) |
>                EulerFactor(TP, p : Degree:=1, Integral) eq
>                EulerFactor(Lg, p : Degree:=1, Integral) };
> // weak check of Euler over K
> assert forall{ p : p in PrimesUpTo(100, K) |
>                Round(Coefficient(EulerFactor(TP, p), 1)) eq
>                Round(Coefficient(EulerFactor(Lg, p), 1)) };

```

## Symmetric Powers

Symmetric power $L$-functions form a natural analogue to tensor products. Here we essentially tensor an $L$-function with itself repeatedly, but remove redundant factors.

In the case of $GL(1)$, the $k$th symmetric power is simply the $L$-function associated to the $k$th power of the underlying character, though we must be careful to ensure primitivity (this disregards the bad primes). Explicitly, we have

$$
L({\rm Sym}^k\psi,s)=\prod_{{\mathfrak{p}}} \Bigl(1-\psi({\mathfrak{p}})^k/{\rm N}{\mathfrak{p}}^s\Bigr)^{-1},
$$

(again ignoring bad primes) and so the eigenvalues are just the $k$th powers of the original. It is relatively easy to compute the bad Euler factors, given those for $L(\psi,s)$.

In the case of $GL(2)$, the $k$th symmetric power is an $L$-function of degree $(k+1)$ over the field of definition, given by

$$
L({\rm Sym}^k A,s)=\prod_{{\mathfrak{p}}}\prod_{i=0}^k
\Bigl(1-\alpha_1({\mathfrak{p}})^{k-i}\alpha_2({\mathfrak{p}})^i/{\rm N}{\mathfrak{p}}^s\Bigr)^{-1},
$$

where $\alpha_1({\mathfrak{p}})$ and $\alpha_2({\mathfrak{p}})$ are the eigenvalues at the prime ${\mathfrak{p}}$. In the case of elliptic curves, one can use the fact that $\alpha_1(p)\alpha_2(p)=p$ to rewrite these via symmetric functions.

A similar definition can be made for higher degree $L$-functions, yielding that the $k$th symmetric power of an $L$-function of degree $d$ will have degree ${k+d-1\choose d-1}$.

If the object itself has a natural powering operation (as with, say, Hecke characters), Magma will simply take the primitivization therein. The bad Euler factors have been explicitly calculated for elliptic curves over the rationals in [[Martin and Watkins, 2006](../../references.md#cite-martin-watkins)] and [[Dummigan *et al.*, 2009](../../references.md#cite-dummigan-martin-watkins)]. In other cases, the user will likely have to provide them. Furthermore, the full ability to take symmetric powers over fields other than the rationals is not yet fully implemented.

More general symmetrizations are also possible, with the determinant and the alternating square perhaps being the most useful.

### `Determinant(L): LSer -> LSer`

```magma
Translate: BoolElt                    Default: false
```

This computes the determinant $L$-series, returned as a translate of an $L$-function of a Dirichlet character.

### `SymmetricPower(L, m): LSer, RngIntElt -> LSer`

```magma
BadPrimes: SeqEnum                    Default: []
```

Return the $L$-series corresponding to the $m$th symmetric power of $L$. The `BadPrimes` vararg consists of $\langle p,f,E\rangle$ triples, where $p$ is a prime, $f$ the conductor exponent, and $E$ a polynomial that gives the Euler factor at that prime.

### `Example: Lseries Sympow (ex-2b6618)`

Some basic code, showing the special cases where Magma will just take the power of the underlying object.

```magma
> G := FullDirichletGroup(3*5*7);
> chi := G.1*G.2*G.3;
> L := LSeries(chi);
> LS3 := SymmetricPower(L, 3);
> Lc3 := LSeries(chi^3);
> Evaluate(LS3, 1);
0.843964498053507794372984784472 + 0.199232992137116783033645803753*i
> Evaluate(Lc3, 1);
0.843964498053507794372984784472 + 0.199232992137116783033645803753*i

```

### `Example: Sympow Gross (ex-833dcd)`

In this example we take symmetric powers of the $L$-function of a Grossencharacter.

```magma
> K := QuadraticField(-23);
> I := Factorization(23 * IntegerRing(K))[1][1];
> G := HeckeCharacterGroup(I);
> psi := G.1^14;
> L := LSeries(psi);
> LS5 := SymmetricPower(L, 5);
> Lp5 := LSeries(psi^5);
> Evaluate(LS5, 1);
0.870801884824381647583631149814 + 0.622589291563954831229726530813*i
> Evaluate(Lp5, 1);
0.870801884824381647583631149814 + 0.622589291563954831229726530813*i
> GR := Grossencharacter(psi, [[1,0]]);
> L := LSeries(GR);
> LS4 := SymmetricPower(L, 4);
> Lp4 := LSeries(GR^4);
> Evaluate(LS4, 3);
4.48608491213433366278327243071 + 0.424809367967343270765667919450*i
> Evaluate(Lp4, 3);
4.48608491213433366278327243071 + 0.424809367967343270765667919450*i

```

### `Example: Sympow Ec (ex-b9aa14)`

An example with symmetric powers of elliptic curves. In the case of the symmetric square of 389A, the `ModularDegree` code will do the same calculation, but more efficiently.

```magma
> E := EllipticCurve("389a");
> L := LSeries(E);
> L2 := SymmetricPower(L, 2);
> LSeriesData(L2);
<3, [ 0, 1, 0 ], 151321, function(p, d) ... end function, 1, [], []>
> LSetPrecision(L2, 9);
> Evaluate(L2, 2);
3.17231145
> ($1 * Conductor(E)) / (2 * Pi(RealField()) * FundamentalVolume(E));
40.0000000
> ModularDegree(E);
40

```

### `Example: Sympow Ec2 (ex-5c1fea)`

This is an example where a higher symmetric power has a vanishing central value. It comes from work of Buhler, Schoen, and Top [[Buhler *et al.*, 1997](../../references.md#cite-buhler-schoen-top)], who also compute that the observed analytic rank of the symmetric cube of 2379b is 4.

```magma
> E := EllipticCurve("73a"); // conductor 73
> L := LSeries(E);           // note this is < 389 (!)
> L3 := SymmetricPower(L, 3);
> LSeriesData(L3); // Magma knows the Sign is +1
<4, [ 0, -1, 1, 0 ], 389017, function(p, d) ... end function, 1, [], []>
> LSetPrecision(L3, 9);
> CentralValue(L3); // analytic rank 2
-1.14998623E-16

```

### `Symmetrization(L, p): LSer, SeqEnum -> LSer`

```magma
BadPrimes: SeqEnum                      Default: []
PoleOrder: RngIntElt                    Default: 0
Induction: BoolElt                      Default: true
```

The `Symmetrization` intrinsic is the general workhorse. It takes an $L$-function and a partition (weakly decreasing sequence of nonnegative integers) as inputs. The `BadPrimes` vararg is as with other cases, while `PoleOrder` specifies that an appropriate translate of the Riemann $\zeta$-function will be a factor of the result (Magma knows about this is some cases). Finally, the `Induction` vararg controls how $GL(1)$ objects over fields larger than **Q** are handled.

Magma will reduce the symmetrization, so that, for example, the $\{6,4\}$-symmetrization of a degree 2 $L$-function will just be the translate by 4 of its symmetric square. However, the practical symmetrizations that can be computed are still rather limited. Thus, for reasons of efficiency, Magma contains hardcoded formulas for small degree examples. For degree 2 these include all symmetric powers. For degree 3 it includes the symmetric cube, the alternating square ($\{1,1\}$-symmetrization), and $\{2,1\}$-symmetrization, not to mention the determinant (which is always available). For degree 4 Magma has the symmetric and alternating squares, and for degree 5 the alternating square is available. Furthermore, for objects such as Artin representations, `Symmetrization` can be applied to the object itself, and the resulting $L$-function is (highly) imprimitive, easing computations.

### `IsOrthogonal(L): LSer -> BoolElt`

### `IsSymplectic(L): LSer -> BoolElt`

```magma
AssumeTrue : BoolElt                    Default: false
AssumeFalse: BoolElt                    Default: false
```

Given an $L$-function return whether it is orthogonal (respectively symplectic). Firstly this means it is self-dual, that is it has real coefficients (a check is done for the first few values). If the motivic weight is odd, then it is symplectic but not orthogonal. If the degree is odd, then it is orthogonal but not symplectic. If both the degree and motivic weight are even, then currently the user must specify `AssumeTrue` or `AssumeFalse` for a result to be given.

### `OrthogonalSymmetrization(L, p): LSer, SeqEnum -> LSer`

### `SymplecticSymmetrization(L, p): LSer, SeqEnum -> LSer`

```magma
BadPrimes: SeqEnum                      Default: []
PoleOrder: RngIntElt                    Default: 0
```

Given an orthogonal $L$-function and a suitable partition $p$, return the orthogonal symmetrization. Referring to Section [Symmetrization](../../RepresentationTheory/CharactersOfFiniteGroups/constructing-characters.md#chtr-symmetrization), the symmetrization of $L$ can factor into smaller parts. In particular, one can throw out “old” factors, and concentrate on those that are truly new. In general, one should have that the degree exceeds twice the number of parts in the partition (see the “modification rules” in the above reference), as these form a basis for the representation space (up to twisting).

In degree 2, the relevant partitions are of the form $(m)$, and all the orthogonal symmetrizations themselves have degree 2. In degree 3, again the relevant partitions are singletons, and the orthogonal $m$th power has degree $2m+1$. Magma allows one to consider $m\le 4$ via hand-coded formulas. In degree 4 the practical partitions are $(2)$ and $(2,2)$, these leading to degree 9 and 10 $L$-functions respectively.

Similarly one can compute the symplectic symmetrization of a symplectic $L$-function. The only (interesting) available case is for degree 4 $L$-functions, when the $(1,1)$ partition gives a $L$-function of degree 5.

### `Example: General Symm (ex-631189)`

Here we consider some general symmetrizations. We first take a modular form of level 25 and weight 4, so a degree 2 $L$-function of motivic weight 3, and take various symmetrizations of it.

```magma
> x := PolynomialRing(Integers()).1;
> Lf := LSeries(Newforms(ModularForms(25,4))[1][1]);
> S2 := Symmetrization(Lf,[2] : BadPrimes:=[<5,2,1+125*x>]);
> CFENew(S2);
0.000000000000000000000000000000
> S31 := Symmetrization(Lf,[3,1] : BadPrimes:=[<5,2,1+5^7*x>]);
> CFENew(S31);
0.000000000000000000000000000000
> LSetPrecision(Lf,10);
> S3 := Symmetrization(Lf,[3] : BadPrimes:=[<5,4,1>]);
> CFENew(S3);
0.0000000000
> S4 := Symmetrization(Lf,[4] : BadPrimes:=[<5,4,1-125^2*x>]);
> CFENew(S4);
5.820766091E-11

```

Another (unitary) example in degree 2 is from a weight 2 newform with complex character. Here we take a “semistable” example, as for such $L$-functions it is relatively easy to compute the bad prime info.

```magma
> f := Newforms(CuspForms(FullDirichletGroup(13).1^2,2))[1][1];
> L := LSeries(f : Embedding:=func<x|Conjugates(x)[1]>);
> BP := [<13,2,Polynomial([1,-(-Coefficient(EulerFactor(L,13),1))^2])>];
> S2 := Symmetrization(L,[2] : BadPrimes:=BP);
> CFENew(S2); // deg 3, conductor 169
0.000000000000000000000000000000
> LSetPrecision(L,15);
> BP := [<13,3,Polynomial([1,-(-Coefficient(EulerFactor(L,13),1))^3])>];
> S3 := Symmetrization(L,[3] : BadPrimes:=BP);
> CFENew(S3); // deg 4, conductor 13^3
8.88178419700125E-16
> LSetPrecision(L,5);
> BP := [<13,4,Polynomial([1,-(-Coefficient(EulerFactor(L,13),1))^4])>];
> S4 := Symmetrization(L,[4] : BadPrimes:=BP);
> CFENew(S4); // deg 5, conductor 13^4
0.00000

```

### `Example: Orthog Symm (ex-401e29)`

We next take a degree 3 $L$-function of (motivic) weight 2, and compute its symmetric cube. Note that this is a degree 10 $L$-function, but when the input is orthogonal this original $L$-function (translated appropriately) appears as a factor.

```magma
> H := HypergeometricData([1,1,1],[2,2,2]);
> L := LSeries(H,2 : BadPrimes:=[<2,8,1>],SaveEuler:=10000);
> LSetPrecision(L,5);
> assert IsOrthogonal(L); // degree 3 weight 2
> S3 := Symmetrization(L,[3] : BadPrimes:=[<2,26,1>]);
> [Degree(x[1]) : x in Factorization(S3)];
[ 8, 3 ]
> CFENew(S3); // 2^18 for deg 7 factor
0.045944

```

It would be more efficient to compute the above information using `OrthogonalSymmetrization`. Note that the `BadPrimes` vararg in the first form referred to the whole $L$-functions, while when using this second form we center on the degree 7 constituent.

```magma
> O3 := OrthogonalSymmetrization(L,[3] : BadPrimes:=[<2,18,1>]);
> Degree(O3);
7
> CFENew(O3); // L-coeffs already computed, thanks to SaveEuler
0.00000

```

The $\{2,1\}$-symmetrization of a degree 3 $L$-function has degree 8, and when the input is orthogonal there is a degree 3 constituent corresponding to the $L$-function.

```magma
> LSetPrecision(L,20);
> S21 := Symmetrization(L,[2,1] : BadPrimes:=[<2,20,1>]); // deg 8
> CFENew(S21);
0.00000000000000000000
> LT := Translate(L,2);
> CFENew(S21/LT);
0.00000000000000000000

```

The degree 5 constituent is the orthogonal symmetric square twisted by the determinant.

```magma
> D := Determinant(L); D;
Translation by 3 of L-series of Kronecker character -4
> O2 := OrthogonalSymmetrization(L,[2] : BadPrimes:=[<2,10,1>]);
> CFENew(O2);
0.00000000000000000000
> TP := TensorProduct(O2,D : BadPrimes:=[<2,12,1>]);
> Q := Translate(S21/LT,2);
> P := PrimesUpTo(100);
> assert &and[EulerFactor(TP,p) eq EulerFactor(Q,p) : p in P];

```

Be careful here! It turns out that `CFENew` works to 12 digits for the quotient of $S_{21}$ with the `Determinant`, but in fact there is no such factorization at the level of $L$-functions (the issue is likely that the lowest height zero on the critical line for the `Determinant` is rather large, and thus the poles in the $L$-quotient do not contribute much).

```magma
> CFENew(S21/LT/D);       // the product of these
2.5742151368679484303E-6
> CFENew(LT/D);           // last two is ~ 10^(-12)
6.3865388810908029459E-5

```

A superior way to detect constituents is through taking a Selberg inner product; here this would just be looking at the average $c_p$ value when twisting by the appropriate Dirichlet character.

The $\{1,1\}$-symmetrization (or alternating square) of a degree 3 $L$-function is actually a translate of the original $L$-function tensored with its determinant.

```magma
> S := Symmetrization(L,[1,1] :  BadPrimes:=[<2,8,1>]);
> DL := TensorProduct(D,L : BadPrimes:=[<2,8,1>]);
> T := Translate(DL,-2);
> assert &and[EulerFactor(T,p)  eq EulerFactor(S,p) : p in P];

```

### `Example: Symplectic Symm (ex-d40acc)`

We consider a degree 4 symplectic $L$-function. Note that when the base $L$-function has degree 4, one needs to compute the quadratic term of the Euler factor to be able to compute the symmetrizations, and depending on the type of $L$-function, this can be quite time-consuming. Our first example is identified by the internal Magma machinery as coming from an elliptic curve over a quadratic field, which allows faster computations of the coefficients. We take its alternating square, which yields a degree 6 $L$-function that has a translated Riemann $\zeta$-function as a factor.

```magma
> x := PolynomialRing(Integers()).1;
> H := HypergeometricData([4,4],[1,1,2,2]);
> L := LSeries(H,2 : Precision:=10);
> assert IsSymplectic(L); // degree 4 weight 1
> L`parent;
Elliptic Curve defined by y^2 + x*y + $.1*y = x^3 + $.1*x^2 over Number Field
   with defining polynomial x^2 - 1/512 over the Rational Field
> S := Symmetrization(L,[1,1] : BadPrimes:=[<2,16,1-2*x>]);
> Degree(S);
6
> CFENew(S);
0.0000000000
> Factorization(S)[2];
<Translation by 1 of L-series of Riemann zeta function, 1>

```

Alternatively, we can compute this via the symplectic symmetrization, when we don’t have to specify the bad prime information corresponding to the $\zeta$-function.

```magma
> S := SymplecticSymmetrization(L,[1,1] :  BadPrimes:=[<2,16,1>]);
> Degree(S);
5
> CFENew(S);
0.0000000000

```

Another example comes from hypergeometric motives, where here the conductor is sufficiently small so that the slowdown from computing quadratic coefficients is not too problematic.

```magma
> H := HypergeometricData([4,2,2,2,2],[1,1,1,1,1,1]);
> L := LSeries(H,1 : Precision:=10); // t=1 degeneration
> Conductor(L); // degree 4, conductor 2^8, motivic wt 5
256
> S := SymplecticSymmetrization(L,[1,1] : BadPrimes:=[<2,8,1>]);
> time CFENew(S);
0.0000000000
Time: 2.300

```

An additional source of such $L$-functions could be Grössencharacters, though these are inductions from $GL(1)$.

```magma
> K<zeta5> := CyclotomicField(5);
> p5 := Factorization(5*Integers(K))[1][1];
> psi := HeckeCharacterGroup(p5^2).0;
> GR := Grossencharacter(psi,[[3,0],[1,2]]);
> L := LSeries(GR :  Precision:=15);
> S := SymplecticSymmetrization(L,[1,1] : BadPrimes:=[<5,6,1>]);
> CFENew(S); // S is imprimitive
0.000000000000000
> Q := S/Translate(LSeries(KroneckerCharacter(5)),3);
> CFENew(Q);
0.000000000000000

```

### `Example: More Orthog (ex-5e5bc4)`

Here are some examples involving the higher orthogonal symmetrizations. Again we note that computing the quadratic term of the underlying $L$-function can sometimes be quite time-consuming.

```magma
> _<x> := PolynomialRing(Integers());
> H := HypergeometricData([2,2,2],[1,1,1]);
> L := LSeries(H,2 : BadPrimes:=[<2,9,1>],Precision:=5);
> BP := [<2,18,1-16*x>];
> O4 := OrthogonalSymmetrization(L,[4] : BadPrimes:=BP);
> CFENew(O4); // OSym^4(deg3) // deg 9
0.00000
> H := HypergeometricData([2,2,2,2,2],[1,1,1,4]);
> L := LSeries(H,1); // degree 4, weight 4, cond 2^7
> BP := [<2,15,1-16*x>];
> O2 := OrthogonalSymmetrization(L,[2] : BadPrimes:=BP);
> LSetPrecision(O2,5); // only 450 terms required, but slow!
> time CFENew(O2); // OSym^2(deg4) // deg 9
0.00000
Time: 21.420

```

With this latter selection of $L$, one can verify (using about 1000 terms to get 3 digits, taking 5 minutes) that the orthogonal symmetrization $L^{[2,2]}$ has conductor $2^{21}$ and trivial Euler factor at 2. This is fully in line with a computation from (wild) Swan slopes.

### `Example: Final Symm Examples (ex-8645f8)`

We are able to give a computed example of an $L^{[2,2]}$ orthogonal symmetrization of a degree 4 $L$-function. It turns out to be imprimitive (in fact, with a factor of $\zeta$, but factors even further it seems), though $L$ itself is primitive.

```magma
> _<x> := PolynomialRing(Integers());
> H := HypergeometricData([2,2,2,2,2],[1,1,1,1,1]);
> L := LSeries(H,1 : SaveEuler:=10^4); // degree 4, weight 4, cond 2^8
> LSetPrecision(L,5);
> BP := [<2,12,(1-2^8*x)^2*(1+2^8*x)^2>]; // Swan conductor 16-10 or 6
> O22 := OrthogonalSymmetrization(L,[2,2] : BadPrimes:=BP,PoleOrder:=1);
> time CFENew(O22); // OSym^[2,2](deg4) // deg 10
1.5259E-5
Time: 6.910
> BP := [<2,12,(1+2^8*x^2)*(1+2^4*x)>]; // Swan conductor 15-9 or 6
> O2 := OrthogonalSymmetrization(L,[2] : BadPrimes:=BP);
> time CFENew(O2); // OSym^2(deg4) // deg 9
0.00000
Time: 0.220

```

It is difficult to give an example of a *primitive* $L$-function of degree 5 and nonzero weight for which the $\{1,1\}$-symmetrization is computable reasonably fast; one example here is the $t=1$ hypergeometric motive from $[4,4,4]$ and $[1,2,2,2,2,2]$, whose $L^{\{1,1\}}$ has conductor $2^{24}$ and trivial Euler factor.

Having no better example, we rely on the 4th symmetric power of an elliptic curve $L$-function, which is primitive though not wholly generic. Indeed, the resulting $\{1,1\}$-symmetrization is itself imprimitive. Importantly, the coefficients can be computed fast.

```magma
> _<x> := PolynomialRing(Integers());
> E := EllipticCurve("128a");
> L := LSeries(E);
> S4 := SymmetricPower(L,4 : Precision:=5);
> Degree(S4), Conductor(S4); // 2^10, slopes 5/3,5/3,5/3,0,0
5 1024
> BP :=[<2,24,1+16*x>]; // Swan conductor (5/3)*9
> S11 := Symmetrization(S4,[1,1] : BadPrimes:=BP);
> time CFENew(S11); // Sym^[1,1](deg5) // deg 10
0.00000
Time: 1.910

```
