def __init__(self, level): r""" The congruence subgroup `\Gamma_0(N)`. EXAMPLES:: sage: G = Gamma0(11); G Congruence Subgroup Gamma0(11) sage: TestSuite(G).run() sage: G is loads(dumps(G)) True TESTS:: sage: g = Gamma0(5)([1,1,0,1]) sage: g in Gamma0(7) True sage: g = Gamma0(5)([1,0,5,1]) sage: g in Gamma0(7) False sage: g = Gamma0(2)([1,0,0,1]) sage: g in SL2Z True """ CongruenceSubgroup.__init__(self, level)
def __cmp__(self, other): """ Compare self to other. The ordering on congruence subgroups of the form GammaH(N) for some H is first by level and then by the subgroup H. In particular, this means that we have Gamma1(N) < GammaH(N) < Gamma0(N) for every nontrivial subgroup H. EXAMPLES:: sage: G = GammaH(86, [9]) sage: G.__cmp__(G) 0 sage: G.__cmp__(GammaH(86, [11])) is not 0 True sage: Gamma1(11) < Gamma0(11) True sage: Gamma1(11) == GammaH(11, []) True sage: Gamma0(11) == GammaH(11, [2]) True """ if is_GammaH(other): t = cmp(self.level(), other.level()) if t: return t else: return cmp(self._list_of_elements_in_H(), other._list_of_elements_in_H()) else: return CongruenceSubgroup.__cmp__(self, other)
def __cmp__(self, other): """ Compare self to other. The ordering on congruence subgroups of the form GammaH(N) for some H is first by level, then by the order of H, then lexicographically by H. In particular, this means that we have Gamma1(N) < GammaH(N) < Gamma0(N) for every nontrivial proper subgroup H. EXAMPLES:: sage: G = GammaH(86, [9]) sage: G.__cmp__(G) 0 sage: G.__cmp__(GammaH(86, [11])) is not 0 True sage: Gamma1(11) < Gamma0(11) True sage: Gamma1(11) == GammaH(11, []) True sage: Gamma0(11) == GammaH(11, [2]) True sage: G = Gamma0(86) sage: G.__cmp__(G) 0 sage: G.__cmp__(GammaH(86, [11])) is not 0 True sage: Gamma1(17) < Gamma0(17) True sage: Gamma0(1) == SL2Z True sage: Gamma0(2) == Gamma1(2) True sage: [x._list_of_elements_in_H() for x in sorted(Gamma0(24).gamma_h_subgroups())] [[1], [1, 5], [1, 7], [1, 11], [1, 13], [1, 17], [1, 19], [1, 23], [1, 5, 7, 11], [1, 5, 13, 17], [1, 5, 19, 23], [1, 7, 13, 19], [1, 7, 17, 23], [1, 11, 13, 23], [1, 11, 17, 19], [1, 5, 7, 11, 13, 17, 19, 23]] """ if is_GammaH(other): return (cmp(self.level(), other.level()) or -cmp(self.index(), other.index()) or cmp(self._list_of_elements_in_H(), other._list_of_elements_in_H())) else: return CongruenceSubgroup.__cmp__(self, other)
def __init__(self, level, H, Hlist=None): r""" The congruence subgroup `\Gamma_H(N)`. The subgroup H must be input as a list. EXAMPLES:: sage: GammaH(117, [4]) Congruence Subgroup Gamma_H(117) with H generated by [4] sage: G = GammaH(16, [7]) sage: TestSuite(G).run() sage: G is loads(dumps(G)) True """ CongruenceSubgroup.__init__(self, level) self.__H = H if Hlist is None: Hlist = _list_subgroup(level, H) self.__Hlist = Hlist
def are_equivalent(self, x, y, trans=False): r""" Check if the cusps `x` and `y` are equivalent under the action of this group. ALGORITHM: The cusps `u_1 / v_1` and `u_2 / v_2` are equivalent modulo `\Gamma(N)` if and only if `(u_1, v_1) = \pm (u_2, v_2) \bmod N`. EXAMPLE:: sage: Gamma(7).are_equivalent(Cusp(2/3), Cusp(5/4)) True """ if trans: return CongruenceSubgroup.are_equivalent(self, x,y,trans=trans) N = self.level() u1,v1 = (x.numerator() % N, x.denominator() % N) u2,v2 = (y.numerator(), y.denominator()) return ((u1,v1) == (u2 % N, v2 % N)) or ((u1,v1) == (-u2 % N, -v2 % N))
def __cmp__(self, other): r""" Compare self to other. EXAMPLES:: sage: Gamma(3) == SymmetricGroup(8) False sage: Gamma(3) == Gamma1(3) False sage: Gamma(5) < Gamma(6) True sage: Gamma(5) == Gamma(5) True sage: Gamma(3) == Gamma(3).as_permutation_group() True """ if is_Gamma(other): return cmp(self.level(), other.level()) else: return CongruenceSubgroup.__cmp__(self, other)