ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 11 Dec 2011 13:10:05 +0100hecke_operator_on_basishttps://ask.sagemath.org/question/8512/hecke_operator_on_basis/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 http://www.sagenb.org/home/pub/3733 for
a concrete example.
Thanks
Sat, 26 Nov 2011 19:04:48 +0100https://ask.sagemath.org/question/8512/hecke_operator_on_basis/Answer by niles for <p>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). </p>
<p>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 <a href="http://www.sagenb.org/home/pub/3733">http://www.sagenb.org/home/pub/3733</a> for
a concrete example.</p>
<p>Thanks</p>
https://ask.sagemath.org/question/8512/hecke_operator_on_basis/?answer=12939#post-id-12939Hi 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](http://hg.sagemath.org/sage-main/file/9e29a3d84c48/sage/modular/modform/hecke_operator_on_qexp.py#l1) 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](http://wiki.sagemath.org/support/ReportingBugs)!
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 :)
Tue, 29 Nov 2011 21:38:24 +0100https://ask.sagemath.org/question/8512/hecke_operator_on_basis/?answer=12939#post-id-12939Comment by Joel B. for <p>Hi Joel,</p>
<p>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 <a href="http://hg.sagemath.org/sage-main/file/9e29a3d84c48/sage/modular/modform/hecke_operator_on_qexp.py#l1">source code</a> for <code>hecke_operator_on_basis</code>, you will see that it just computes some auxiliary objects and then calls <code>_hecke_operator_on_basis</code>, defined in that same source file. Note that <code>hecke_operator_on_basis</code> uses the first element of the list to compute the auxiliary objects -- that seems to be the root cause of the asymmetry. </p>
<p>That function, in turn, calls <code>hecke_operator_on_qexp</code> 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 <code>hecke_operator_on_qexp</code> is applied to your <code>h</code> (with <code>g</code> being the first element in the list).</p>
<p>This is where my ability to follow starts breaking down, but that line is using a number of coefficients of the series (<code>f</code> there), and it seems likely that the error is occurring because the precision of your <code>g</code> is much larger than that of <code>h</code>. So would you say this is a bug? If so, you should <a href="http://wiki.sagemath.org/support/ReportingBugs">report it</a>!</p>
<p>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 :)</p>
https://ask.sagemath.org/question/8512/hecke_operator_on_basis/?comment=20797#post-id-20797Actually, 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?Tue, 29 Nov 2011 22:44:25 +0100https://ask.sagemath.org/question/8512/hecke_operator_on_basis/?comment=20797#post-id-20797Comment by niles for <p>Hi Joel,</p>
<p>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 <a href="http://hg.sagemath.org/sage-main/file/9e29a3d84c48/sage/modular/modform/hecke_operator_on_qexp.py#l1">source code</a> for <code>hecke_operator_on_basis</code>, you will see that it just computes some auxiliary objects and then calls <code>_hecke_operator_on_basis</code>, defined in that same source file. Note that <code>hecke_operator_on_basis</code> uses the first element of the list to compute the auxiliary objects -- that seems to be the root cause of the asymmetry. </p>
<p>That function, in turn, calls <code>hecke_operator_on_qexp</code> 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 <code>hecke_operator_on_qexp</code> is applied to your <code>h</code> (with <code>g</code> being the first element in the list).</p>
<p>This is where my ability to follow starts breaking down, but that line is using a number of coefficients of the series (<code>f</code> there), and it seems likely that the error is occurring because the precision of your <code>g</code> is much larger than that of <code>h</code>. So would you say this is a bug? If so, you should <a href="http://wiki.sagemath.org/support/ReportingBugs">report it</a>!</p>
<p>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 :)</p>
https://ask.sagemath.org/question/8512/hecke_operator_on_basis/?comment=20724#post-id-20724Sorry 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.Sun, 11 Dec 2011 13:10:05 +0100https://ask.sagemath.org/question/8512/hecke_operator_on_basis/?comment=20724#post-id-20724Comment by Joel B. for <p>Hi Joel,</p>
<p>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 <a href="http://hg.sagemath.org/sage-main/file/9e29a3d84c48/sage/modular/modform/hecke_operator_on_qexp.py#l1">source code</a> for <code>hecke_operator_on_basis</code>, you will see that it just computes some auxiliary objects and then calls <code>_hecke_operator_on_basis</code>, defined in that same source file. Note that <code>hecke_operator_on_basis</code> uses the first element of the list to compute the auxiliary objects -- that seems to be the root cause of the asymmetry. </p>
<p>That function, in turn, calls <code>hecke_operator_on_qexp</code> 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 <code>hecke_operator_on_qexp</code> is applied to your <code>h</code> (with <code>g</code> being the first element in the list).</p>
<p>This is where my ability to follow starts breaking down, but that line is using a number of coefficients of the series (<code>f</code> there), and it seems likely that the error is occurring because the precision of your <code>g</code> is much larger than that of <code>h</code>. So would you say this is a bug? If so, you should <a href="http://wiki.sagemath.org/support/ReportingBugs">report it</a>!</p>
<p>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 :)</p>
https://ask.sagemath.org/question/8512/hecke_operator_on_basis/?comment=20798#post-id-20798Thank 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.Tue, 29 Nov 2011 22:38:57 +0100https://ask.sagemath.org/question/8512/hecke_operator_on_basis/?comment=20798#post-id-20798