OK how about this for a minimal example of unexpected (to me) behaviour. I get problems with sage 6.4.1 and 7.0.0 with the below code.
G=DirichletGroup(80); for chi in G: D=ModularSymbols(chi,2,-1).cuspidal_subspace().new_subspace().decomposition(); for f in D: e=f.q_eigenform(10,'alpha')[3]; print(e.is_integral()) I believe that this code just computes a bunch of random spaces of cuspidal new modular symbols and then for each conj class of eigenforms it finds, it checks to see if the coefficient of q^3 is an algebraic integer. In sage 7.0 on Ubuntu 14.04 I get True True True False True True True True True True True True True True True True False True True True False True False Have I misunderstood something or is this a bug? Kevin On Thursday, 28 April 2016 15:09:59 UTC+1, Misja wrote: > > When understand the specific reason why my code is not working properly, I > managed to pin it down to the following mysterious behaviour of q_eigenform. > > First run the following code in sage. > > G=DirichletGroup(80); > chi=G[22]; > > D=ModularSymbols(chi,2,-1).cuspidal_subspace().new_subspace().decomposition(); > for f in D: > elt=f.q_eigenform(10,'alpha')[3]; > N=elt.parent().absolute_field('a'); > fact=N.factor(2); > for P,e in fact: > res_field=N.residue_field(P); > print res_field(elt); > > > It will print > > 0 > 0 > 0 > 0 > > which, I think, is the 'right' answer. > > > Now *close* your sage session entirely. Open a new session and then run > the following *silly* code: > > G=DirichletGroup(80); > for chi in G: > > D=ModularSymbols(chi,2,-1).cuspidal_subspace().new_subspace().decomposition(); > for f in D: > elt=f.q_eigenform(10,'alpha')[3]; > if not elt.parent()==QQ: > K=elt.parent().absolute_field('b'); > if chi==G[22]: > fact=K.factor(2); > for P,e in fact: > res_field=K.residue_field(P); > print res_field(elt); > > > It will print: > > 0 > 0 > 1 > 0 > > As far as I understand the theory, this cannot happen. If you let sage > print the alpha^3 coefficient of you see that in both cases it picks a > different q_eigenform in f, the Galois conjugacy class of newforms. > Although this can be a bit annoying, in theory it is fine. But I am pretty > sure that when your reduce this coefficient modulo some prime P, any two > elements of the same Galois conjugacy class can differ at most by some > automorphism of the residue field (and obviously 1 and 0 do not satisfy > this criterion). > > > To make matters worse: if you run a single sage session and you run the > 'good' code first and the 'bad' code second, then suddenly the 'bad' code > is fixed and printing only 0s. If you run the 'bad' code first and the > 'good' code second, then they are both 'bad' and the 'good' code suddenly > prints 0,0,1,0 as well. > > By trying I found out that this is because somehow q_eigenform picks the > same q_eigenform as whichever code that ran first and somehow these choices > are not compatible! I don't know the inner workings of q_eigenform, but > this behaviour seems strange to me. > > Can anyone explain what is going on here? Is it a bug? > > Thanks! > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.