Module: sage.modular.modform.constructor
Creating Spaces of Modular Forms
sage: m = ModularForms(Gamma1(4),11) sage: m Modular Forms space of dimension 6 for Congruence Subgroup Gamma1(4) of weight 11 over Rational Field sage: m.basis() [ q - 134*q^5 + O(q^6), q^2 + 80*q^5 + O(q^6), q^3 + 16*q^5 + O(q^6), q^4 - 4*q^5 + O(q^6), 1 + 4092/50521*q^2 + 472384/50521*q^3 + 4194300/50521*q^4 + O(q^6), q + 1024*q^2 + 59048*q^3 + 1048576*q^4 + 9765626*q^5 + O(q^6) ]
Module-level Functions
[group=1], [weight=2], [base_ring=None], [use_cache=True], [prec=6]) |
Create a space of cuspidal modular forms.
See the documentation for the ModularForms command for a description of the input parameters.
sage: CuspForms(11,2) Cuspidal subspace of dimension 1 of Modular Forms space of dimension 2 for Congruence Subgroup Gamma0(11) of weight 2 over Rational Field
[group=1], [weight=2], [base_ring=None], [use_cache=True], [prec=6]) |
Create a space of eisenstein modular forms.
See the documentation for the ModularForms command for a description of the input parameters.
sage: EisensteinForms(11,2) Eisenstein subspace of dimension 1 of Modular Forms space of dimension 2 for Congruence Subgroup Gamma0(11) of weight 2 over Rational Field
[group=1], [weight=2], [base_ring=None], [use_cache=True], [prec=6]) |
Create an ambient space of modular forms.
Input:
Create using the command ModularForms(group, weight, base_ring) where group could be either a congruence subgroup or a Dirichlet character.
First we create some spaces with trivial character:
sage: ModularForms(Gamma0(11),2).dimension() 2 sage: ModularForms(Gamma0(1),12).dimension() 2
If we give an integer N for the congruence subgroup, it defaults
to
:
sage: ModularForms(1,12).dimension() 2 sage: ModularForms(11,4) Modular Forms space of dimension 4 for Congruence Subgroup Gamma0(11) of weight 4 over Rational Field
We create some spaces for
.
sage: ModularForms(Gamma1(13),2) Modular Forms space of dimension 13 for Congruence Subgroup Gamma1(13) of weight 2 over Rational Field sage: ModularForms(Gamma1(13),2).dimension() 13 sage: [ModularForms(Gamma1(7),k).dimension() for k in [2,3,4,5]] [5, 7, 9, 11] sage: ModularForms(Gamma1(5),11).dimension() 12
We create a space with character:
sage: e = (DirichletGroup(13).0)^2 sage: e.order() 6 sage: M = ModularForms(e, 2); M Modular Forms space of dimension 3, character [zeta6] and weight 2 over Cyclotomic Field of order 6 and degree 2 sage: f = M.T(2).charpoly('x'); f x^3 + (-2*zeta6 - 2)*x^2 + (-2*zeta6)*x + 14*zeta6 - 7 sage: f.factor() (x - 2*zeta6 - 1) * (x - zeta6 - 2) * (x + zeta6 + 1)
More examples of spaces with character:
sage: e = DirichletGroup(5, RationalField()).gen(); e [-1] sage: m = ModularForms(e, 2); m Modular Forms space of dimension 2, character [-1] and weight 2 over Rational Field sage: m == loads(dumps(m)) True sage: m.T(2).charpoly('x') x^2 - 1 sage: m = ModularForms(e, 6); m.dimension() 4 sage: m.T(2).charpoly('x') x^4 - 917*x^2 - 42284
) |
Clear the cache of modular forms.
sage: M = ModularForms(37,2) sage: sage.modular.modform.constructor._cache == {} False
sage: sage.modular.modform.constructor.ModularForms_clear_cache() sage: sage.modular.modform.constructor._cache {}
identifier, [group=None], [weight=2], [base_ring=Rational Field], [names=None]) |
Input:
sage: Newform('67a', names='a') q + 2*q^2 - 2*q^3 + 2*q^4 + 2*q^5 + O(q^6) sage: Newform('67b', names='a') q + a1*q^2 + (-a1 - 3)*q^3 + (-3*a1 - 3)*q^4 - 3*q^5 + O(q^6)
group, [weight=2], [base_ring=Rational Field], [names=None]) |
Input:
sage: Newforms(11, 2) [q - 2*q^2 - q^3 + 2*q^4 + q^5 + O(q^6)] sage: Newforms(65, names='a') [q - q^2 - 2*q^3 - q^4 - q^5 + O(q^6), q + a1*q^2 + (a1 + 1)*q^3 + (-2*a1 - 1)*q^4 + q^5 + O(q^6), q + a2*q^2 + (-a2 + 1)*q^3 + q^4 - q^5 + O(q^6)]
group, level, weight, base_ring) |
Given a group, level, weight, and base_ring as input by the user, return a canonicalized version of them, where level is a Sage integer, group really is a group, weight is a Sage integer, and base_ring a Sage ring. Note that we can't just get the level from the group, because we have the convention that the character for Gamma1(N) is None (which makes good sense).
Input:
sage: from sage.modular.modform.constructor import canonical_parameters sage: v = canonical_parameters(5, 5, int(7), ZZ); v (5, Congruence Subgroup Gamma0(5), 7, Integer Ring) sage: type(v[0]), type(v[1]), type(v[2]), type(v[3]) (<type 'sage.rings.integer.Integer'>, <class 'sage.modular.congroup.Gamma0'>, <type 'sage.rings.integer.Integer'>, <type 'sage.rings.integer_ring.IntegerRing_class'>) sage: canonical_parameters( 5, 7, 7, ZZ ) Traceback (most recent call last): ... ValueError: group and level do not match.
s) |