Ask Your Question


asked 2011-11-26 12:04:48 -0600

Joel B. gravatar image

updated 2011-11-26 12:07:29 -0600

I am absolutely no expert in sage, and I know next to nothing about Python, so I apologize if my question is stupid or ill-formulated (and even if it so, I am likely to learn something from any answer).

I am puzzled by the following: I have a list B of q-expansions of modular forms over GF(2), which is a basis of a space of modular forms stable by the Hecke operators, and a list B' which contains the same elements as B but in a different order. I am trying to compute the matrix of the Hecke operator T_3 in the basis B and B', using hecke_operator_on_basis(B,3,2) and the same with B'. I get a correct answer for B and an error message for B'. How is that possible? I suspect that it is a question of degree of precision, but what exactly is happening here? Please see for a concrete example.


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2011-11-29 14:38:24 -0600

niles gravatar image

Hi Joel,

I'm not an expert on modular forms, but maybe I can help point you in the right direction. If you take a look at the source code for hecke_operator_on_basis, you will see that it just computes some auxiliary objects and then calls _hecke_operator_on_basis, defined in that same source file. Note that hecke_operator_on_basis uses the first element of the list to compute the auxiliary objects -- that seems to be the root cause of the asymmetry.

That function, in turn, calls hecke_operator_on_qexp on each of the elements of the list. The error message says things are breaking on line 105/106, and with a little testing I determined that the break occurs when hecke_operator_on_qexp is applied to your h (with g being the first element in the list).

This is where my ability to follow starts breaking down, but that line is using a number of coefficients of the series (f there), and it seems likely that the error is occurring because the precision of your g is much larger than that of h. So would you say this is a bug? If so, you should report it!

In the meantime, I guess you can work around it by sorting your inputs according to their precision . . . or maybe you already have some better idea :)

edit flag offensive delete link more


Thank you very much niles for your useful answer. Your answer is very plausible. I have found a way around. About reporting a bug, I fell much too new on sage and too dumb to do it in a useful way.

Joel B. gravatar imageJoel B. ( 2011-11-29 15:38:57 -0600 )edit

Actually, some feature is a bug if it does not what it is specified to do. But I don't know where to find the precise specification of hecke_operator_on_basis. Actually, I have even more basic problems. For example, the behavior of == for power series with different level of precision seems completely erratic to me. Is it specified somewhere when two power series should be considered by Sage as equal and when not? In general, I find that the Sage Reference Manual, while very useful, doesn't explain enough. Is there another place with more precise information?

Joel B. gravatar imageJoel B. ( 2011-11-29 15:44:25 -0600 )edit

Sorry for the delay; unfortunately the source code is the only better place for explanations. About power series, comparison is a known bug which is unfortunately related to very complex (unresolved) issues; see trac ticket 9457.

niles gravatar imageniles ( 2011-12-11 06:10:05 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2011-11-26 12:04:48 -0600

Seen: 115 times

Last updated: Nov 29 '11