def sturm_bound(level, weight=2): r""" Returns the Sturm bound for modular forms with given level and weight. For more details, see the documentation for the sturm_bound method of sage.modular.arithgroup.CongruenceSubgroup objects. INPUT: - ``level`` - an integer (interpreted as a level for Gamma0) or a congruence subgroup - ``weight`` - an integer `\geq 2` (default: 2) EXAMPLES:: sage: sturm_bound(11,2) 2 sage: sturm_bound(389,2) 65 sage: sturm_bound(1,12) 1 sage: sturm_bound(100,2) 30 sage: sturm_bound(1,36) 3 sage: sturm_bound(11) 2 """ if is_ArithmeticSubgroup(level): if level.is_congruence(): return level.sturm_bound(weight) else: raise ValueError("No Sturm bound defined for noncongruence subgroups") if isinstance(level, (int, long, Integer)): return Gamma0(level).sturm_bound(weight)
def sturm_bound(level, weight=2): r""" Returns the Sturm bound for modular forms with given level and weight. For more details, see the documentation for the sturm_bound method of sage.modular.arithgroup.CongruenceSubgroup objects. INPUT: - ``level`` - an integer (interpreted as a level for Gamma0) or a congruence subgroup - ``weight`` - an integer `\geq 2` (default: 2) EXAMPLES:: sage: sturm_bound(11,2) 2 sage: sturm_bound(389,2) 65 sage: sturm_bound(1,12) 1 sage: sturm_bound(100,2) 30 sage: sturm_bound(1,36) 3 sage: sturm_bound(11) 2 """ if is_ArithmeticSubgroup(level): if level.is_congruence(): return level.sturm_bound(weight) else: raise ValueError, "No Sturm bound defined for noncongruence subgroups" if isinstance(level, (int, long, Integer)): return Gamma0(level).sturm_bound(weight)
def dimension_modular_forms(X, k=2): r""" The dimension of the space of cusp forms for the given congruence subgroup (either `\Gamma_0(N)`, `\Gamma_1(N)`, or `\Gamma_H(N)`) or Dirichlet character. INPUT: - ``X`` - congruence subgroup or Dirichlet character - ``k`` - weight (integer) EXAMPLES:: sage: dimension_modular_forms(Gamma0(11),2) 2 sage: dimension_modular_forms(Gamma0(11),0) 1 sage: dimension_modular_forms(Gamma1(13),2) 13 sage: dimension_modular_forms(GammaH(11, [10]), 2) 10 sage: dimension_modular_forms(GammaH(11, [10])) 10 sage: dimension_modular_forms(GammaH(11, [10]), 4) 20 sage: e = DirichletGroup(20).1 sage: dimension_modular_forms(e,3) 9 sage: dimension_cusp_forms(e,3) 3 sage: dimension_eis(e,3) 6 sage: dimension_modular_forms(11,2) 2 """ if isinstance(X, integer_types + (Integer, )): return Gamma0(X).dimension_modular_forms(k) elif is_ArithmeticSubgroup(X): return X.dimension_modular_forms(k) elif isinstance(X, dirichlet.DirichletCharacter): return Gamma1(X.modulus()).dimension_modular_forms(k, eps=X) else: raise TypeError( "Argument 1 must be an integer, a Dirichlet character or an arithmetic subgroup." )
def dimension_modular_forms(X, k=2): r""" The dimension of the space of cusp forms for the given congruence subgroup (either `\Gamma_0(N)`, `\Gamma_1(N)`, or `\Gamma_H(N)`) or Dirichlet character. INPUT: - ``X`` - congruence subgroup or Dirichlet character - ``k`` - weight (integer) EXAMPLES:: sage: dimension_modular_forms(Gamma0(11),2) 2 sage: dimension_modular_forms(Gamma0(11),0) 1 sage: dimension_modular_forms(Gamma1(13),2) 13 sage: dimension_modular_forms(GammaH(11, [10]), 2) 10 sage: dimension_modular_forms(GammaH(11, [10])) 10 sage: dimension_modular_forms(GammaH(11, [10]), 4) 20 sage: e = DirichletGroup(20).1 sage: dimension_modular_forms(e,3) 9 sage: dimension_cusp_forms(e,3) 3 sage: dimension_eis(e,3) 6 sage: dimension_modular_forms(11,2) 2 """ if isinstance(X, (int, long, Integer)): return Gamma0(X).dimension_modular_forms(k) elif is_ArithmeticSubgroup(X): return X.dimension_modular_forms(k) elif isinstance(X,dirichlet.DirichletCharacter): return Gamma1(X.modulus()).dimension_modular_forms(k, eps=X) else: raise TypeError("Argument 1 must be an integer, a Dirichlet character or an arithmetic subgroup.")
def dimension_eis(X, k=2): """ The dimension of the space of Eisenstein series for the given congruence subgroup. INPUT: - ``X`` - congruence subgroup or Dirichlet character or integer - ``k`` - weight (integer) EXAMPLES:: sage: dimension_eis(5,4) 2 :: sage: dimension_eis(Gamma0(11),2) 1 sage: dimension_eis(Gamma1(13),2) 11 sage: dimension_eis(Gamma1(2006),2) 3711 :: sage: e = DirichletGroup(13).0 sage: e.order() 12 sage: dimension_eis(e,2) 0 sage: dimension_eis(e^2,2) 2 :: sage: e = DirichletGroup(13).0 sage: e.order() 12 sage: dimension_eis(e,2) 0 sage: dimension_eis(e^2,2) 2 sage: dimension_eis(e,13) 2 :: sage: G = DirichletGroup(20) sage: dimension_eis(G.0,3) 4 sage: dimension_eis(G.1,3) 6 sage: dimension_eis(G.1^2,2) 6 :: sage: G = DirichletGroup(200) sage: e = prod(G.gens(), G(1)) sage: e.conductor() 200 sage: dimension_eis(e,2) 4 :: sage: dimension_modular_forms(Gamma1(4), 11) 6 """ if is_ArithmeticSubgroup(X): return X.dimension_eis(k) elif isinstance(X, dirichlet.DirichletCharacter): return Gamma1(X.modulus()).dimension_eis(k, X) elif isinstance(X, (int, long, Integer)): return Gamma0(X).dimension_eis(k) else: raise TypeError("Argument in dimension_eis must be an integer, a Dirichlet character, or a finite index subgroup of SL2Z (got %s)" % X)
def dimension_cusp_forms(X, k=2): r""" The dimension of the space of cusp forms for the given congruence subgroup or Dirichlet character. INPUT: - ``X`` - congruence subgroup or Dirichlet character or integer - ``k`` - weight (integer) EXAMPLES:: sage: dimension_cusp_forms(5,4) 1 :: sage: dimension_cusp_forms(Gamma0(11),2) 1 sage: dimension_cusp_forms(Gamma1(13),2) 2 :: sage: dimension_cusp_forms(DirichletGroup(13).0^2,2) 1 sage: dimension_cusp_forms(DirichletGroup(13).0,3) 1 :: sage: dimension_cusp_forms(Gamma0(11),2) 1 sage: dimension_cusp_forms(Gamma0(11),0) 0 sage: dimension_cusp_forms(Gamma0(1),12) 1 sage: dimension_cusp_forms(Gamma0(1),2) 0 sage: dimension_cusp_forms(Gamma0(1),4) 0 :: sage: dimension_cusp_forms(Gamma0(389),2) 32 sage: dimension_cusp_forms(Gamma0(389),4) 97 sage: dimension_cusp_forms(Gamma0(2005),2) 199 sage: dimension_cusp_forms(Gamma0(11),1) 0 :: sage: dimension_cusp_forms(Gamma1(11),2) 1 sage: dimension_cusp_forms(Gamma1(1),12) 1 sage: dimension_cusp_forms(Gamma1(1),2) 0 sage: dimension_cusp_forms(Gamma1(1),4) 0 :: sage: dimension_cusp_forms(Gamma1(389),2) 6112 sage: dimension_cusp_forms(Gamma1(389),4) 18721 sage: dimension_cusp_forms(Gamma1(2005),2) 159201 :: sage: dimension_cusp_forms(Gamma1(11),1) 0 :: sage: e = DirichletGroup(13).0 sage: e.order() 12 sage: dimension_cusp_forms(e,2) 0 sage: dimension_cusp_forms(e^2,2) 1 Check that :trac:`12640` is fixed:: sage: dimension_cusp_forms(DirichletGroup(1)(1), 12) 1 sage: dimension_cusp_forms(DirichletGroup(2)(1), 24) 5 """ if isinstance(X, dirichlet.DirichletCharacter): N = X.modulus() if N <= 2: return Gamma0(N).dimension_cusp_forms(k) else: return Gamma1(N).dimension_cusp_forms(k, X) elif is_ArithmeticSubgroup(X): return X.dimension_cusp_forms(k) elif isinstance(X, (Integer,int,long)): return Gamma0(X).dimension_cusp_forms(k) else: raise TypeError("Argument 1 must be a Dirichlet character, an integer or a finite index subgroup of SL2Z")
def dimension_eis(X, k=2): """ The dimension of the space of Eisenstein series for the given congruence subgroup. INPUT: - ``X`` - congruence subgroup or Dirichlet character or integer - ``k`` - weight (integer) EXAMPLES:: sage: dimension_eis(5,4) 2 :: sage: dimension_eis(Gamma0(11),2) 1 sage: dimension_eis(Gamma1(13),2) 11 sage: dimension_eis(Gamma1(2006),2) 3711 :: sage: e = DirichletGroup(13).0 sage: e.order() 12 sage: dimension_eis(e,2) 0 sage: dimension_eis(e^2,2) 2 :: sage: e = DirichletGroup(13).0 sage: e.order() 12 sage: dimension_eis(e,2) 0 sage: dimension_eis(e^2,2) 2 sage: dimension_eis(e,13) 2 :: sage: G = DirichletGroup(20) sage: dimension_eis(G.0,3) 4 sage: dimension_eis(G.1,3) 6 sage: dimension_eis(G.1^2,2) 6 :: sage: G = DirichletGroup(200) sage: e = prod(G.gens(), G(1)) sage: e.conductor() 200 sage: dimension_eis(e,2) 4 :: sage: dimension_modular_forms(Gamma1(4), 11) 6 """ if is_ArithmeticSubgroup(X): return X.dimension_eis(k) elif isinstance(X, dirichlet.DirichletCharacter): return Gamma1(X.modulus()).dimension_eis(k, X) elif isinstance(X, (int, long, Integer)): return Gamma0(X).dimension_eis(k) else: raise TypeError, "Argument in dimension_eis must be an integer, a Dirichlet character, or a finite index subgroup of SL2Z (got %s)" % X
def dimension_cusp_forms(X, k=2): r""" The dimension of the space of cusp forms for the given congruence subgroup or Dirichlet character. INPUT: - ``X`` - congruence subgroup or Dirichlet character or integer - ``k`` - weight (integer) EXAMPLES:: sage: dimension_cusp_forms(5,4) 1 :: sage: dimension_cusp_forms(Gamma0(11),2) 1 sage: dimension_cusp_forms(Gamma1(13),2) 2 :: sage: dimension_cusp_forms(DirichletGroup(13).0^2,2) 1 sage: dimension_cusp_forms(DirichletGroup(13).0,3) 1 :: sage: dimension_cusp_forms(Gamma0(11),2) 1 sage: dimension_cusp_forms(Gamma0(11),0) 0 sage: dimension_cusp_forms(Gamma0(1),12) 1 sage: dimension_cusp_forms(Gamma0(1),2) 0 sage: dimension_cusp_forms(Gamma0(1),4) 0 :: sage: dimension_cusp_forms(Gamma0(389),2) 32 sage: dimension_cusp_forms(Gamma0(389),4) 97 sage: dimension_cusp_forms(Gamma0(2005),2) 199 sage: dimension_cusp_forms(Gamma0(11),1) 0 :: sage: dimension_cusp_forms(Gamma1(11),2) 1 sage: dimension_cusp_forms(Gamma1(1),12) 1 sage: dimension_cusp_forms(Gamma1(1),2) 0 sage: dimension_cusp_forms(Gamma1(1),4) 0 :: sage: dimension_cusp_forms(Gamma1(389),2) 6112 sage: dimension_cusp_forms(Gamma1(389),4) 18721 sage: dimension_cusp_forms(Gamma1(2005),2) 159201 :: sage: dimension_cusp_forms(Gamma1(11),1) 0 :: sage: e = DirichletGroup(13).0 sage: e.order() 12 sage: dimension_cusp_forms(e,2) 0 sage: dimension_cusp_forms(e^2,2) 1 Check that Trac #12640 is fixed:: sage: dimension_cusp_forms(DirichletGroup(1)(1), 12) 1 sage: dimension_cusp_forms(DirichletGroup(2)(1), 24) 5 """ if isinstance(X, dirichlet.DirichletCharacter): N = X.modulus() if N <= 2: return Gamma0(N).dimension_cusp_forms(k) else: return Gamma1(N).dimension_cusp_forms(k, X) elif is_ArithmeticSubgroup(X): return X.dimension_cusp_forms(k) elif isinstance(X, (Integer, int, long)): return Gamma0(X).dimension_cusp_forms(k) else: raise TypeError, "Argument 1 must be a Dirichlet character, an integer or a finite index subgroup of SL2Z"