# Compute generators of $\Gamma_0(N)$

I have found in a paper the group $$\Gamma_0(18)$$ can be generated by the following list of matrices:

• $$\displaystyle \left( \begin{array}{rr} 7 & -1 \\ 36 & 5 \end{array} \right)$$

• $$\displaystyle \left( \begin{array}{rr} 13 & -8 \\ 18 & -11 \end{array} \right)$$

• $$\displaystyle \left( \begin{array}{rr} 71 & -15 \\ 90 & -9 \end{array} \right)$$

• $$\displaystyle \left( \begin{array}{rr} 55 & -13 \\ 72 & -17 \end{array} \right)$$
• $$\displaystyle \left( \begin{array}{rr} 7 & -2 \\ 18 & -5 \end{array} \right)$$
• $$\displaystyle \left( \begin{array}{rr} 31 & -25 \\ 36 & -29 \end{array} \right)$$
• $$\displaystyle \left( \begin{array}{rr} 1 & 1 \\ 0 & 1 \end{array} \right)$$
• $$\displaystyle \left( \begin{array}{rr} -1 & 0 \\ 0 & -1 \end{array} \right)$$

E.g. $$31 \times (-29) - 36 \times (-25) = -899+900=1$$ In fact, $$36, 18, 19 \equiv 0 \pmod {18}$$.

These generators look arbitrary. Is there a list of generators of $$\Gamma_0(N)$$ for $$N < 100$$ ?

Is there a computer program or algorithm for finding generators of congruence groups, example using a linear algebra package such as sage ?

• By using the known presentation of ${\rm SL}(2,{\mathbb Z})$ and expressing the congruence subgroups as kernels of homomorphisms onto a finite group, you could use standard algorithms (available in GAP or Magma) for computing generators of these kernels as subgroups of a group defined by a finite presentation. I don't know whether that's the easiest way to do it! Mar 10, 2020 at 13:34
• Googling "sage congruence subgroup", the first hit is doc.sagemath.org/html/en/reference/arithgroup/sage/modular/… which tells you how to list generators. The online Sage interface sagecell.sagemath.org lists the generators of $\Gamma_0(N)$ quickly for $N$ up to at least 5000.
– Bort
Mar 10, 2020 at 13:34
• See also this Math.SE question: math.stackexchange.com/questions/1758302/… Mar 11, 2020 at 7:27
• There are also theoretical results for every $N$ (and even presentations of $\Gamma_0(N)$): see this article by Lascurain Orive ams.org/journals/ecgd/2002-06-03/S1088-4173-02-00073-5/… Mar 11, 2020 at 9:10
• There are even geometric algorithms for arbitrary finite-index subgroups using Farey symbols. See arxiv.org/abs/1809.04030v2 just after Théorème 1.10. Mar 11, 2020 at 9:26

sage should have what you need.
Check under the documentation for the modular group. Specifically under generators you can find a couple of working examples for finding the generating set for $$\Gamma_0(3)$$.