CoCalc Shared Filessupport / 2015-09-02-054941-modular-forms.sagews
Authors: Harald Schilly, ℏal Snyder, William A. Stein
Description: Examples for support purposes.
G = DirichletGroup(25); G

Group of Dirichlet characters of modulus 25 over Cyclotomic Field of order 20 and degree 8
len(G)

20
X = G.galois_orbits(); X

[ [Dirichlet character modulo 25 of conductor 1 mapping 2 |--> 1], [Dirichlet character modulo 25 of conductor 25 mapping 2 |--> zeta20, Dirichlet character modulo 25 of conductor 25 mapping 2 |--> zeta20^3, Dirichlet character modulo 25 of conductor 25 mapping 2 |--> zeta20^7, Dirichlet character modulo 25 of conductor 25 mapping 2 |--> zeta20^7 - zeta20^5 + zeta20^3 - zeta20, Dirichlet character modulo 25 of conductor 25 mapping 2 |--> -zeta20, Dirichlet character modulo 25 of conductor 25 mapping 2 |--> -zeta20^3, Dirichlet character modulo 25 of conductor 25 mapping 2 |--> -zeta20^7, Dirichlet character modulo 25 of conductor 25 mapping 2 |--> -zeta20^7 + zeta20^5 - zeta20^3 + zeta20], [Dirichlet character modulo 25 of conductor 25 mapping 2 |--> zeta20^2, Dirichlet character modulo 25 of conductor 25 mapping 2 |--> zeta20^6, Dirichlet character modulo 25 of conductor 25 mapping 2 |--> -zeta20^4, Dirichlet character modulo 25 of conductor 25 mapping 2 |--> -zeta20^6 + zeta20^4 - zeta20^2 + 1], [Dirichlet character modulo 25 of conductor 25 mapping 2 |--> zeta20^4, Dirichlet character modulo 25 of conductor 25 mapping 2 |--> zeta20^6 - zeta20^4 + zeta20^2 - 1, Dirichlet character modulo 25 of conductor 25 mapping 2 |--> -zeta20^2, Dirichlet character modulo 25 of conductor 25 mapping 2 |--> -zeta20^6], [Dirichlet character modulo 25 of conductor 5 mapping 2 |--> zeta20^5, Dirichlet character modulo 25 of conductor 5 mapping 2 |--> -zeta20^5], [Dirichlet character modulo 25 of conductor 5 mapping 2 |--> -1] ]
for z in X:
chi = z[0]
S = CuspForms(chi,4)
print S

Cuspidal subspace of dimension 5 of Modular Forms space of dimension 11 for Congruence Subgroup Gamma0(25) of weight 4 over Rational Field Cuspidal subspace of dimension 0 of Modular Forms space of dimension 0, character [zeta20] and weight 4 over Cyclotomic Field of order 20 and degree 8 Cuspidal subspace of dimension 6 of Modular Forms space of dimension 8, character [zeta10] and weight 4 over Cyclotomic Field of order 10 and degree 4 Cuspidal subspace of dimension 7 of Modular Forms space of dimension 9, character [zeta5] and weight 4 over Cyclotomic Field of order 5 and degree 4 Cuspidal subspace of dimension 0 of Modular Forms space of dimension 0, character [zeta4] and weight 4 over Cyclotomic Field of order 4 and degree 2 Cuspidal subspace of dimension 4 of Modular Forms space of dimension 10, character [-1] and weight 4 over Rational Field
chi = X[-1][0]
chi

Dirichlet character modulo 25 of conductor 5 mapping 2 |--> -1
S = CuspForms(chi, 4); S

Cuspidal subspace of dimension 4 of Modular Forms space of dimension 10, character [-1] and weight 4 over Rational Field
N = S.newforms('a')
for f in N:
print f.q_expansion(10)

q + a0*q^2 - 7*a0*q^3 + 7*q^4 + 7*q^6 + 6*a0*q^7 + 15*a0*q^8 - 22*q^9 + O(q^10) q + a1*q^2 + 1/2*a1*q^3 - 8*q^4 - 8*q^6 - 3/2*a1*q^7 + 23*q^9 + O(q^10)
N[0].parent()

Cuspidal subspace of dimension 4 of Modular Forms space of dimension 10, character [-1] and weight 4 over Number Field in a0 with defining polynomial x^2 + 1
N[0].parent().base_ring()

Number Field in a0 with defining polynomial x^2 + 1