Congruence subgroup \(\Gamma_0(N)\) - Arithmetic Subgroups of $\SL_2(\ZZ)$

Skip to content
Back to top
View this page
Edit this page

# Congruence subgroup \(\Gamma_0(N)\)

class sage.modular.arithgroup.congroup_gamma0.Gamma0_class(level)

  Bases: `GammaH_class`

  The congruence subgroup \(\Gamma_0(N)\).

  coset_reps()

    Return representatives for the right cosets of this congruence subgroup in \(\SL_2(\ZZ)\) as a generator object.

    Use `list(self.coset_reps())` to obtain coset reps as a list.

    EXAMPLES:

    Sage

        sage: list(Gamma0(5).coset_reps())
        [
        [1 0]  [ 0 -1]  [1 0]  [ 0 -1]  [ 0 -1]  [ 0 -1]
        [0 1], [ 1  0], [1 1], [ 1  2], [ 1  3], [ 1  4]
        ]
        sage: list(Gamma0(4).coset_reps())
        [
        [1 0]  [ 0 -1]  [1 0]  [ 0 -1]  [ 0 -1]  [1 0]
        [0 1], [ 1  0], [1 1], [ 1  2], [ 1  3], [2 1]
        ]
        sage: list(Gamma0(1).coset_reps())
        [
        [1 0]
        [0 1]
        ]

    Python

        >>> from sage.all import *
        >>> list(Gamma0(Integer(5)).coset_reps())
        [
        [1 0]  [ 0 -1]  [1 0]  [ 0 -1]  [ 0 -1]  [ 0 -1]
        [0 1], [ 1  0], [1 1], [ 1  2], [ 1  3], [ 1  4]
        ]
        >>> list(Gamma0(Integer(4)).coset_reps())
        [
        [1 0]  [ 0 -1]  [1 0]  [ 0 -1]  [ 0 -1]  [1 0]
        [0 1], [ 1  0], [1 1], [ 1  2], [ 1  3], [2 1]
        ]
        >>> list(Gamma0(Integer(1)).coset_reps())
        [
        [1 0]
        [0 1]
        ]

  dimension_new_cusp_forms(k=2, p=0)

    Return the dimension of the space of new (or \(p\)-new) weight \(k\) cusp forms for this congruence subgroup.

    INPUT:

    - `k` – integer (default: 2); the weight. Not fully implemented for \(k = 1\).

    - `p` – integer (default: 0); if nonzero, compute the \(p\)-new subspace

    OUTPUT: integer

    ALGORITHM:

    This comes from the formula given in Theorem 1 of http://www.math.ubc.ca/~gerg/papers/downloads/DSCFN.pdf

    EXAMPLES:

    Sage

        sage: Gamma0(11000).dimension_new_cusp_forms()
        240
        sage: Gamma0(11000).dimension_new_cusp_forms(k=1)
        0
        sage: Gamma0(22).dimension_new_cusp_forms(k=4)
        3
        sage: Gamma0(389).dimension_new_cusp_forms(k=2,p=17)
        32

    Python

        >>> from sage.all import *
        >>> Gamma0(Integer(11000)).dimension_new_cusp_forms()
        240
        >>> Gamma0(Integer(11000)).dimension_new_cusp_forms(k=Integer(1))
        0
        >>> Gamma0(Integer(22)).dimension_new_cusp_forms(k=Integer(4))
        3
        >>> Gamma0(Integer(389)).dimension_new_cusp_forms(k=Integer(2),p=Integer(17))
        32

  divisor_subgroups()

    Return the subgroups of SL2Z of the form Gamma0(M) that contain this subgroup, i.e. those for M a divisor of N.

    EXAMPLES:

    Sage

        sage: Gamma0(24).divisor_subgroups()
        [Modular Group SL(2,Z),
         Congruence Subgroup Gamma0(2),
         Congruence Subgroup Gamma0(3),
         Congruence Subgroup Gamma0(4),
         Congruence Subgroup Gamma0(6),
         Congruence Subgroup Gamma0(8),
         Congruence Subgroup Gamma0(12),
         Congruence Subgroup Gamma0(24)]

    Python

        >>> from sage.all import *
        >>> Gamma0(Integer(24)).divisor_subgroups()
        [Modular Group SL(2,Z),
         Congruence Subgroup Gamma0(2),
         Congruence Subgroup Gamma0(3),
         Congruence Subgroup Gamma0(4),
         Congruence Subgroup Gamma0(6),
         Congruence Subgroup Gamma0(8),
         Congruence Subgroup Gamma0(12),
         Congruence Subgroup Gamma0(24)]

  gamma_h_subgroups()

    Return the subgroups of the form \(\Gamma_H(N)\) contained in `self`, where \(N\) is the level of `self`.

    EXAMPLES:

    Sage

        sage: G = Gamma0(11)
        sage: G.gamma_h_subgroups()  # optional - gap_package_polycyclic
        [Congruence Subgroup Gamma0(11),
         Congruence Subgroup Gamma_H(11) with H generated by [3],
         Congruence Subgroup Gamma_H(11) with H generated by [10],
         Congruence Subgroup Gamma1(11)]
        sage: G = Gamma0(12)
        sage: G.gamma_h_subgroups()  # optional - gap_package_polycyclic
        [Congruence Subgroup Gamma0(12),
         Congruence Subgroup Gamma_H(12) with H generated by [7],
         Congruence Subgroup Gamma_H(12) with H generated by [11],
         Congruence Subgroup Gamma_H(12) with H generated by [5],
         Congruence Subgroup Gamma1(12)]

    Python

        >>> from sage.all import *
        >>> G = Gamma0(Integer(11))
        >>> G.gamma_h_subgroups()  # optional - gap_package_polycyclic
        [Congruence Subgroup Gamma0(11),
         Congruence Subgroup Gamma_H(11) with H generated by [3],
         Congruence Subgroup Gamma_H(11) with H generated by [10],
         Congruence Subgroup Gamma1(11)]
        >>> G = Gamma0(Integer(12))
        >>> G.gamma_h_subgroups()  # optional - gap_package_polycyclic
        [Congruence Subgroup Gamma0(12),
         Congruence Subgroup Gamma_H(12) with H generated by [7],
         Congruence Subgroup Gamma_H(12) with H generated by [11],
         Congruence Subgroup Gamma_H(12) with H generated by [5],
         Congruence Subgroup Gamma1(12)]

  generators(algorithm='farey')

    Return generators for this congruence subgroup.

    INPUT:

    - `algorithm` – string; either `'farey'` (default) or `'todd-coxeter'`

    If `algorithm` is set to `'farey'`, then the generators will be calculated using Farey symbols, which will always return a minimal generating set. See `farey_symbol` for more information.

    If `algorithm` is set to `'todd-coxeter'`, a simpler algorithm based on Todd-Coxeter enumeration will be used. This tends to return far larger sets of generators.

    EXAMPLES:

    Sage

        sage: Gamma0(3).generators()
        [
        [1 1]  [-1  1]
        [0 1], [-3  2]
        ]
        sage: Gamma0(3).generators(algorithm='todd-coxeter')
        [
        [1 1]  [-1  0]  [ 1 -1]  [1 0]  [1 1]  [-1  0]  [ 1  0]
        [0 1], [ 0 -1], [ 0  1], [3 1], [0 1], [ 3 -1], [-3  1]
        ]
        sage: SL2Z.gens()
        (
        [ 0 -1]  [1 1]
        [ 1  0], [0 1]
        )

    Python

        >>> from sage.all import *
        >>> Gamma0(Integer(3)).generators()
        [
        [1 1]  [-1  1]
        [0 1], [-3  2]
        ]
        >>> Gamma0(Integer(3)).generators(algorithm='todd-coxeter')
        [
        [1 1]  [-1  0]  [ 1 -1]  [1 0]  [1 1]  [-1  0]  [ 1  0]
        [0 1], [ 0 -1], [ 0  1], [3 1], [0 1], [ 3 -1], [-3  1]
        ]
        >>> SL2Z.gens()
        (
        [ 0 -1]  [1 1]
        [ 1  0], [0 1]
        )

  index()

    Return the index of `self` in the full modular group.

    This is given by

    \[\begin{split}N \prod_{\substack{p \mid N \\ \text{$p$ prime}}}\left(1 + \frac{1}{p}\right).\end{split}\]

    EXAMPLES:

    Sage

        sage: [Gamma0(n).index() for n in [1..19]]
        [1, 3, 4, 6, 6, 12, 8, 12, 12, 18, 12, 24, 14, 24, 24, 24, 18, 36, 20]
        sage: Gamma0(32041).index()
        32220

    Python

        >>> from sage.all import *
        >>> [Gamma0(n).index() for n in (ellipsis_range(Integer(1),Ellipsis,Integer(19)))]
        [1, 3, 4, 6, 6, 12, 8, 12, 12, 18, 12, 24, 14, 24, 24, 24, 18, 36, 20]
        >>> Gamma0(Integer(32041)).index()
        32220

  is_even()

    Return `True` precisely if this subgroup contains the matrix -1.

    Since \(\Gamma0(N)\) always contains the matrix -1, this always returns `True`.

    EXAMPLES:

    Sage

        sage: Gamma0(12).is_even()
        True
        sage: SL2Z.is_even()
        True

    Python

        >>> from sage.all import *
        >>> Gamma0(Integer(12)).is_even()
        True
        >>> SL2Z.is_even()
        True

  is_subgroup(right)

    Return `True` if `self` is a subgroup of `right`.

    EXAMPLES:

    Sage

        sage: G = Gamma0(20)
        sage: G.is_subgroup(SL2Z)
        True
        sage: G.is_subgroup(Gamma0(4))
        True
        sage: G.is_subgroup(Gamma0(20))
        True
        sage: G.is_subgroup(Gamma0(7))
        False
        sage: G.is_subgroup(Gamma1(20))
        False
        sage: G.is_subgroup(GammaH(40, []))
        False
        sage: Gamma0(80).is_subgroup(GammaH(40, [31, 21, 17]))
        True
        sage: Gamma0(2).is_subgroup(Gamma1(2))
        True

    Python

        >>> from sage.all import *
        >>> G = Gamma0(Integer(20))
        >>> G.is_subgroup(SL2Z)
        True
        >>> G.is_subgroup(Gamma0(Integer(4)))
        True
        >>> G.is_subgroup(Gamma0(Integer(20)))
        True
        >>> G.is_subgroup(Gamma0(Integer(7)))
        False
        >>> G.is_subgroup(Gamma1(Integer(20)))
        False
        >>> G.is_subgroup(GammaH(Integer(40), []))
        False
        >>> Gamma0(Integer(80)).is_subgroup(GammaH(Integer(40), [Integer(31), Integer(21), Integer(17)]))
        True
        >>> Gamma0(Integer(2)).is_subgroup(Gamma1(Integer(2)))
        True

  ncusps()

    Return the number of cusps of this subgroup \(\Gamma_0(N)\).

    EXAMPLES:

    Sage

        sage: [Gamma0(n).ncusps() for n in [1..19]]
        [1, 2, 2, 3, 2, 4, 2, 4, 4, 4, 2, 6, 2, 4, 4, 6, 2, 8, 2]
        sage: [Gamma0(n).ncusps() for n in prime_range(2,100)]
        [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]

    Python

        >>> from sage.all import *
        >>> [Gamma0(n).ncusps() for n in (ellipsis_range(Integer(1),Ellipsis,Integer(19)))]
        [1, 2, 2, 3, 2, 4, 2, 4, 4, 4, 2, 6, 2, 4, 4, 6, 2, 8, 2]
        >>> [Gamma0(n).ncusps() for n in prime_range(Integer(2),Integer(100))]
        [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]

  nu2()

    Return the number of elliptic points of order 2 for this congruence subgroup \(\Gamma_0(N)\).

    The number of these is given by a standard formula: 0 if \(N\) is divisible by 4 or any prime congruent to -1 mod 4, and otherwise \(2^d\) where d is the number of odd primes dividing \(N\).

    EXAMPLES:

    Sage

        sage: Gamma0(2).nu2()
        1
        sage: Gamma0(4).nu2()
        0
        sage: Gamma0(21).nu2()
        0
        sage: Gamma0(1105).nu2()
        8
        sage: [Gamma0(n).nu2() for n in [1..19]]
        [1, 1, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 2, 0, 0]

    Python

        >>> from sage.all import *
        >>> Gamma0(Integer(2)).nu2()
        1
        >>> Gamma0(Integer(4)).nu2()
        0
        >>> Gamma0(Integer(21)).nu2()
        0
        >>> Gamma0(Integer(1105)).nu2()
        8
        >>> [Gamma0(n).nu2() for n in (ellipsis_range(Integer(1),Ellipsis,Integer(19)))]
        [1, 1, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 2, 0, 0]

  nu3()

    Return the number of elliptic points of order 3 for this congruence subgroup \(\Gamma_0(N)\). The number of these is given by a standard formula: 0 if \(N\) is divisible by 9 or any prime congruent to -1 mod 3, and otherwise \(2^d\) where d is the number of primes other than 3 dividing \(N\).

    EXAMPLES:

    Sage

        sage: Gamma0(2).nu3()
        0
        sage: Gamma0(3).nu3()
        1
        sage: Gamma0(9).nu3()
        0
        sage: Gamma0(7).nu3()
        2
        sage: Gamma0(21).nu3()
        2
        sage: Gamma0(1729).nu3()
        8

    Python

        >>> from sage.all import *
        >>> Gamma0(Integer(2)).nu3()
        0
        >>> Gamma0(Integer(3)).nu3()
        1
        >>> Gamma0(Integer(9)).nu3()
        0
        >>> Gamma0(Integer(7)).nu3()
        2
        >>> Gamma0(Integer(21)).nu3()
        2
        >>> Gamma0(Integer(1729)).nu3()
        8

sage.modular.arithgroup.congroup_gamma0.Gamma0_constructor(N)

  Return the congruence subgroup Gamma0(N).

  EXAMPLES:

  Sage

      sage: G = Gamma0(51) ; G # indirect doctest
      Congruence Subgroup Gamma0(51)
      sage: G == Gamma0(51)
      True
      sage: G is Gamma0(51)
      True

  Python

      >>> from sage.all import *
      >>> G = Gamma0(Integer(51)) ; G # indirect doctest
      Congruence Subgroup Gamma0(51)
      >>> G == Gamma0(Integer(51))
      True
      >>> G is Gamma0(Integer(51))
      True