---
title: "Accessing the Invariants"
canonical: "https://docs.magma-maths.org/v2.30-1/ArithmeticGeometry/LFunctions/invariants.html"
source: "https://docs.magma-maths.org/v2.30-1/ArithmeticGeometry/LFunctions/invariants.md"
part: "Arithmetic Geometry"
chapter: "L-Functions"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Arithmetic Geometry", "source": "https://docs.magma-maths.org/v2.30-1/ArithmeticGeometry/index-arithmetic-geometry.md"}
  - {"title": "L-Functions", "source": "https://docs.magma-maths.org/v2.30-1/ArithmeticGeometry/LFunctions/index-lfunctions.md"}
prev: {"title": "General $L$-series", "source": "https://docs.magma-maths.org/v2.30-1/ArithmeticGeometry/LFunctions/general.md"}
next: {"title": "Modifying the $L$-function", "source": "https://docs.magma-maths.org/v2.30-1/ArithmeticGeometry/LFunctions/modifyL.md"}
intrinsics:
  - {"name": "LCfRequired", "signature": "LCfRequired(L): LSer -> RngIntElt"}
  - {"name": "LGetCoefficients", "signature": "LGetCoefficients(L, N): LSer, RngIntElt -> List"}
  - {"name": "EulerFactor", "signature": "EulerFactor(L, p): LSer, RngIntElt -> RngElt"}
  - {"name": "Degree", "signature": "Degree(L): LSer -> RngIntElt"}
  - {"name": "Conductor", "signature": "Conductor(L): LSer -> RngElt"}
  - {"name": "Sign", "signature": "Sign(L): LSer -> RngElt"}
  - {"name": "MotivicWeight", "signature": "MotivicWeight(L): LSer -> RngIntElt"}
  - {"name": "GammaFactors", "signature": "GammaFactors(L): LSer -> SeqEnum"}
  - {"name": "LSeriesData", "signature": "LSeriesData(L): LSer -> Info"}
  - {"name": "BadPrimeData", "signature": "BadPrimeData(L): LSer -> SeqEnum"}
  - {"name": "Factorization", "signature": "Factorization(L): LSer -> SeqEnum[Tup]"}
  - {"name": "Factorisation", "signature": "Factorisation(L): LSer -> SeqEnum[Tup]"}
examples:
  - "ex-f37c5f"
  - "ex-52681e"
---

<a id="invariants"></a>
<a id="lseries-invariants"></a>
# Accessing the Invariants

<a id="function-lcfrequired-lser"></a>
## `LCfRequired(L): LSer -> RngIntElt`

The number of Dirichlet coefficients $a_n$ that have to be calculated in order to compute the values $L(s)$. This function can be also used with a user-defined $L$-series before its coefficients are set, see Section [Specifying the Coefficients Later](https://docs.magma-maths.org/v2.30-1/ArithmeticGeometry/LFunctions/general.md#cflater).

<a id="function-lgetcoefficients-lser-rngintelt"></a>
## `LGetCoefficients(L, N): LSer, RngIntElt -> List`

Compute the vector of first $N$ coefficients `[*` $a_1,...,a_N$ `*]` of the $L$-series given by $L$.

<a id="function-eulerfactor-lser-rngintelt"></a>
## `EulerFactor(L, p): LSer, RngIntElt -> RngElt`

```magma
Degree   : RngIntElt                    Default: 
Precision: RngIntElt                    Default: 
```

Given an L-series and a prime $p$, this computes the $p$th Euler factor, either as a polynomial or a power series. The optional parameter `Degree` will truncate the series to that length, and the optional parameter `Precision` is of use when the series is defined over the complex numbers.

<a id="function-degree-lser"></a>
## `Degree(L): LSer -> RngIntElt`

The degree of an $L$-function.

<a id="function-conductor-lser"></a>
## `Conductor(L): LSer -> RngElt`

Conductor of the L-series (real number, usually an integer). This invariant enters the functional equation and measures the ‘size’ of the object to which the L-series is associated. Evaluating an $L$-series takes time roughly proportional to the square root of the conductor.

<a id="function-sign-lser"></a>
## `Sign(L): LSer -> RngElt`

Sign in the functional equation of the $L$-series. This is a complex number of absolute value 1, or 0 if the sign has not been computed yet. (Calling `CFENew` or `CheckFunctionalEquation(L)` or any evaluation function sets the sign.)

<a id="function-motivicweight-lser"></a>
## `MotivicWeight(L): LSer -> RngIntElt`

The motivic weight of an $L$-function.

<a id="function-gammafactors-lser"></a>
## `GammaFactors(L): LSer -> SeqEnum`

A sequence of Gamma factors $\lambda_1,\ldots,\lambda_d$ for $L(s)$. Each one represents a factor $\Gamma((s+\lambda_i)/2)$ entering the functional equation of the $L$-function.

With the previous two intrinsics, see also `HodgeStructure`.

<a id="function-lseriesdata-lser"></a>
## `LSeriesData(L): LSer -> Info`

Given an $L$-series $L$, this function returns the weight, the conductor, the list of $\gamma$-shifts, the coefficient function, the sign, the poles of $L^*(s)$, and the residues of $L^*(s)$ as a tuple of length 7. If Sign $=0$, this means it has not been computed yet. Residues$=[]$ means they have not yet been computed. From this data, $L$ can be re-created with a general `LSeries` call (see Section [Constructing a General $L$-Series](https://docs.magma-maths.org/v2.30-1/ArithmeticGeometry/LFunctions/general.md#gensig)).

<a id="function-badprimedata-lser"></a>
## `BadPrimeData(L): LSer -> SeqEnum`

Given an $L$-series $L$, this returns an array of bad prime data, each entry being a 3-tuple $\langle p,v,U \rangle$ where $p$ is the prime, $v$ is the conductor valuation at $p$, and $U$ is the (possibly trivial) Euler factor at $p$.

<a id="example-ex-f37c5f"></a>
## `Example: Coefficients of a Modular Form L-Series (ex-f37c5f)`

For a modular form, the $q$-expansion coefficients are the same as the Dirichlet coefficients of the associated $L$-series:

```magma
> f := Newforms("30k2")[1,1];
> qExpansion(f,10);
q - q^2 + q^3 + q^4 - q^5 - q^6 - 4*q^7 - q^8 + q^9 + O(q^10)
> Lf := LSeries(f);
> LGetCoefficients(Lf,20);
[* 1, -1, 1, 1, -1, -1, -4, -1, 1, 1, 0, 1, 2, 4, -1, 1, 6, -1, -4, -1 *]
```

The elliptic curve of conductor 30 that corresponds to $f$ has, of course, the same $L$-series.

```magma
> E := EllipticCurve(f); E;
Elliptic Curve defined by y^2 + x*y + y = x^3 + x + 2 over Rational Field
> LE := LSeries(E);
> LGetCoefficients(LE,20);
[* 1, -1, 1, 1, -1, -1, -4, -1, 1, 1, 0, 1, 2, 4, -1, 1, 6, -1, -4, -1 *]
```

Now we change the base field of $E$ to a number field $K$ and evaluate the $L$-series of $E/K$ at $s=2$.

```magma
> P<x> := PolynomialRing(Integers());
> K := NumberField(x^3-2);
> LEK := LSeries(E,K);
> i := LSeriesData(LEK); i;
<2, [ 0, 0, 0, 1, 1, 1 ], 8748000, function(p, d [ Precision ]) ... end
   function, 1, [], []>
```

The conductor of this $L$-series (second entry) is not that small and this is an indication that the calculations of $L(E/K,2)$ to the required precision (30 digits) will take some time. We can also ask how many coefficients will be used in this calculation.

```magma
> LCfRequired(LEK);
24636
```

Decreasing the precision will help somewhat.

```magma
> LSetPrecision(LEK,9);
> LCfRequired(LEK);
3364
```

Magma now automatically does a factorization of the $L$-series (see the Arithmetic section).

```magma
> LEK`prod;
[
    <L-series of twist of Elliptic Curve defined by y^2 + x*y + y = x^3 + x + 2
    over Rational Field by Artin representation S3: (1,1,1) of ext<Q|x^3-2>, 1>,
    <L-series of twist of Elliptic Curve defined by y^2 + x*y + y = x^3 + x + 2
    over Rational Field by Artin representation S3: (2,0,-1) of ext<Q|x^3-2>,
    conductor 108, 1>
]
```

<a id="function-factorization-lser"></a>
## `Factorization(L): LSer -> SeqEnum[Tup]`

<a id="function-factorisation-lser"></a>
## `Factorisation(L): LSer -> SeqEnum[Tup]`

If an $L$-series is represented internally as a product of other $L$-series, say $L(s)=\prod_i L_i(s)^{n_i}$, return the sequence `[...<L_i,n_i>...]`.

<a id="example-ex-52681e"></a>
## `Example: Factorization of L-Series (ex-52681e)`

```magma
> L := RiemannZeta();
> Factorization(L);
[ <L-series of Riemann zeta function, 1> ]
> R<x> := PolynomialRing(Rationals());
> K := SplittingField(x^3-2);
> L := LSeries(K);
> Factorization(L);
[
    <L-series of Riemann zeta function, 1>,
    <L-series of Artin representation S3: (1,-1,1) of ext<Q|x^6+108>, conductor
3, 1>,
    <L-series of Artin representation S3: (2,0,-1) of ext<Q|x^6+108>, conductor
108, 2>
]
```
