2014-08-01 11:52:32 -0500 received badge ● Student (source) 2014-07-31 14:30:30 -0500 asked a question convert output Hello, if a function gives an output like this 2.00000000000000 - 2.77555756156289e-17*I how could one convert it to be simply 2 Bests 2013-03-28 12:33:49 -0500 received badge ● Editor (source) 2013-03-28 12:33:01 -0500 asked a question construct modular forms with nebentypus Hello , I am sage newbie and looking to create an examples of modular forms with nebentypus . Let $M_{k}^{-}\left(D,\chi_{-D}\right)$ the subspace of modular forms of weight $k$ on $\Gamma_{0}\left( D \right)$ with nebentypus $\chi_{-D} :=\Big(\frac{-D}{\cdot}\Big)$ whose Fourier expansion is of the forms $f=\displaystyle\sum_{{n\geq 0 \chi_{-D}(n)\not = 1 }}{a_f (n) q^n}$ i.e. such that $a_f (n)=0$ if $\chi_{-D}(n) =+ 1$ I just not sure how to start with this I tried to create space of modular form with character and then look for generators which satisfy these relations for example D=5 e = DirichletGroup(D), RationalField()).gen() M=ModularForms(e,5,prec=20);print M f=M.gen(0);print 'generator=';f any comment , idea ? best regards