# The Hecke Algebra

## `HeckeBound(M): ModSym -> RngIntElt`

A positive integer $n$ such that the Hecke operators $T_1, \ldots, T_n$ generate the Hecke algebra as a ${\mathbb{Z}}$-module. When the character is trivial, the default bound is $(k/12)\cdot[{\rm SL}_2({\mathbb{Z}}):\Gamma_0(N)]$. That this suffices follows from [[Sturm, 1987](../../references.md#cite-sturm-congruence)], as is explained in [[Agashe and Stein, 2002](../../references.md#cite-agashe-stein-appendix)]. When the character of the space of modular symbols $M$ is nontrivial, the default bound is twice the above bound; however, *it is not known that this bound is large enough in all cases in which the character is nontrivial*, so one may wish to increase the bound using `SetHeckeBound`.

## `SetHeckeBound(M, n): ModSym, RngIntElt -> RngIntElt`

Many computations require a bound $n$ such that $T_1,\ldots, T_n$ generate the Hecke algebra associated to the space of modular symbols $M$ as a ${\mathbb{Z}}$-module. This command allows you to set the bound that is used internally. Setting it too low can result in functions quickly producing incorrect results.

## `HeckeAlgebra(M : Bound): ModSym -> AlgMat`

The Hecke algebra associated to the space of modular symbols $M$. This is an algebra `TQ` over ${\mathbb{Q}}$, such that `Generators(TQ)` is a set that generates the ring ${\mathbb{Z}}[T_1,T_2,T_3,\ldots]$, as a ${\mathbb{Z}}$-module. If the optional integer parameter `Bound` is set, then `HeckeAlgebra` only computes the algebra generated by those $T_n$, with $n\leq$ `Bound`.

## `DiscriminantOfHeckeAlgebra(M : Bound): ModSym -> RngIntElt`

The discriminant of the Hecke algebra associated to the space of modular symbols $M$. If the optional parameter `Bound` is set, then the discriminant of the algebra generated by only those $T_n$, with $n\leq$ `Bound`, is computed instead.

## `HeckeEigenvalueRing(M : parameters): ModSym -> Rng, Map`

```magma
Bound: RngIntElt                    Default: -1
```

The order generated by the Fourier coefficients of one of the $q$-expansions of a newform corresponding to the space of modular symbols $M$, along with a map from the ring containing the coefficients of `qExpansion(A)` to the order. If the optional parameter `Bound` is set, then the order generated only by those $a_n$, with $n \leq$ `Bound`, is computed.

## `HeckeEigenvalueField(M): ModSym -> Fld, Map`

The number field generated by the Fourier coefficients of one of the $q$-expansions of a newform corresponding to the space of modular symbols $M$, along with a map from the ring containing the coefficients of `qExpansion(M)` to the number field. We require that $M$ be defined over ${\mathbb{Q}}$.

## `Example: Hecke Algebra (ex-1119e4)`

In this example, we compute the discriminant of the Hecke algebra of prime level $389$.

```magma
> M := ModularSymbols(389,2,+1);
> C := CuspidalSubspace(M);
> DiscriminantOfHeckeAlgebra(C);
62967005472006188288017473632139259549820493155023510831104000000
> Factorization($1);
[ <2, 53>, <3, 4>, <5, 6>, <31, 2>, <37, 1>, <389, 1>, <3881, 1>,
<215517113148241, 1>, <477439237737571441, 1> ]

```

The prime $389$ is the only prime $p<10000$ such that $p$ divides the discriminant of the Hecke algebra associated to $S_2(\Gamma_0(p))$. It is an open problem to decide whether or not there are any other such primes. Are there infinitely many?
