Instructions for calculating bases of modular forms over Gamma_0(N) using main.sage *** NOTE: This only works for levels N where the graded algebra of modular forms is generated at weight two. This occurs if both of the following conditions occur: 1) 4|N or there exists a prime p|N with p congruent to 3 modulo 4 2) 9|N or there exists a prime p|N with p congruent to 2 modulo 3 The sage functions are in the file main.sage, which can be loaded into sage using load('main.sage') command from the sage prompt. *** The basic command to run the algorithm is: calc_ModForm_basis(N,k) *inputs -- N (level), k (weight) *output -- basis for M_k(Gamma_0(N)) The command calc_ModForm_basis(N,k) computes a basis for the space M_k(Gamma_0(N)). The basis is returned as a list, where each modular form in the bases is expressed as a q-expansion and also as a linear combination of products of weight two basis elements calculated from sage's internal algorithm (ModularForms(N,2).basis()). *** Example sage: load('main.sage') sage: B=calc_ModForm_basis(36,20) [OUTPUT SUPPRESSED (right now the algorithm prints out when it finds new basis elements)] sage: len(B) [OUTPUT:] 120 sage: ModularForms(36,20).dimension() [OUTPUT:] 120 [So B has the right number of elements] [Now let's look at one of the basis elements] sage: B[51] [OUTPUT:] expansion=q^51 + 15*q^57 + 128*q^63 + 814*q^69 + 4254*q^75 + 19171*q^81 + 76634*q^87 + 277038*q^93 + 919133*q^99 + 2831246*q^105 + 8173068*q^111 + 22278456*q^117 + 57700447*q^123 + 142732599*q^129 + 338707250*q^135 + 773950754*q^141 + 1708424496*q^147 + 3653386958*q^153 + 7587293222*q^159 + O(q^165) linear combinations=[ (-1/6, [1] (1/6, [0] [0] [1] [0] [0] [0] [0] [0] [0] [1] [0] [8] [9] [0] [0] [0] [0] [0] [0] [0] [0] [0]) , [0]) ] sage: B[51].expansion() [OUTPUT:] q^51 + 15*q^57 + 128*q^63 + 814*q^69 + 4254*q^75 + 19171*q^81 + 76634*q^87 + 277038*q^93 + 919133*q^99 + 2831246*q^105 + 8173068*q^111 + 22278456*q^117 + 57700447*q^123 + 142732599*q^129 + 338707250*q^135 + 773950754*q^141 + 1708424496*q^147 + 3653386958*q^153 + 7587293222*q^159 + O(q^165) sage: B[51].LC.lin_combos [OUTPUT:] [( [1] [0] [0] [0] [0] [1] [8] [0] [0] [0] [0] -1/6, [0] ), ( [0] [1] [0] [0] [0] [0] [9] [0] [0] [0] [0] 1/6, [0] )] [This means that B[51]=(-1/6)*F_0*F_5*F_6^8 + (1/6)*F_1*F_6^9 where {F_i} is the basis generated by the ModularForms(36,2).basis() command]