Trace of Hecke Operator with large integer

3 views
Skip to first unread message

Raouf

unread,
Sep 10, 2008, 4:25:01 PM9/10/08
to sage-support
Hello again,

I want to compute the trace of Hecke operator with large integer but
always i have the same error message

" Traceback (click to the left for traceback)
...
TypeError: n must be an int"

For example if i reduce the parameter in the hecke operator (13^8) , i
have

sage:
M1 = ModularSymbols(21,2)
T1 = M1.hecke_operator(13^8)
trace1=T1.trace()
print trace1

evaluate result:
2651076189

but if i increase the parameter (13^9) :

sage:
M1 = ModularSymbols(21,2)
T1 = M1.hecke_operator(13^9)
trace1=T1.trace()
print trace1

evaluate result:

Traceback (most recent call last): print trace1
File "/usr/local/sage/local/lib/python2.5/site-packages/sage/modular/
hecke/module.py", line 860, in hecke_operator
return self.hecke_algebra().hecke_operator(n)
File "/usr/local/sage/local/lib/python2.5/site-packages/sage/modular/
hecke/algebra.py", line 186, in hecke_operator
T = hecke_operator.HeckeOperator(self, n)
File "/usr/local/sage/local/lib/python2.5/site-packages/sage/modular/
hecke/hecke_operator.py", line 362, in __init__
raise TypeError, "n must be an int"
TypeError: n must be an int

there is any way to go over this?
Thank u

David Joyner

unread,
Sep 10, 2008, 4:35:02 PM9/10/08
to sage-s...@googlegroups.com
On Wed, Sep 10, 2008 at 4:25 PM, Raouf <raouf...@gmail.com> wrote:
>
> Hello again,
>
> I want to compute the trace of Hecke operator with large integer but
> always i have the same error message
>
> " Traceback (click to the left for traceback)
> ...
> TypeError: n must be an int"
>
> For example if i reduce the parameter in the hecke operator (13^8) , i
> have
>
> sage:
> M1 = ModularSymbols(21,2)
> T1 = M1.hecke_operator(13^8)
> trace1=T1.trace()
> print trace1
>
> evaluate result:
> 2651076189
>
> but if i increase the parameter (13^9) :
>
> sage:
> M1 = ModularSymbols(21,2)
> T1 = M1.hecke_operator(13^9)
> trace1=T1.trace()
> print trace1

Works for me:

sage: M1 = ModularSymbols(21,2)
sage: T1 = M1.hecke_operator(13^8)
sage: trace1=T1.trace()
sage: print trace1
2651076189
sage: T1 = M1.hecke_operator(13^9)
sage: trace1=T1.trace()
sage: print trace1
34464553246
sage:


What version of Sage and what operating system are you using?

Simon King

unread,
Sep 10, 2008, 4:40:22 PM9/10/08
to sage-support
Dear Raouf,

On Sep 10, 10:25 pm, Raouf <raouf.o...@gmail.com> wrote:
> I want to compute the trace of Hecke operator with large integer but
> always i have the same error message
>
> " Traceback (click to the left for traceback)
> ...
> TypeError: n must be an int"
<snip>
> there is any way to go over this?

I just tried your example (in Sage 3.1.1), and there was no problem:
sage: M1 = ModularSymbols(21,2)
sage: T1 = M1.hecke_operator(13^9)
sage: trace1=T1.trace()
sage: print trace1
34464553246

So, what version of Sage are you using, and on what kind of machine?
Cheers
Simon

William Stein

unread,
Sep 10, 2008, 4:49:04 PM9/10/08
to sage-s...@googlegroups.com

In particular, are you using a 32-bit Linux install or OS X?

William


--
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

mabshoff

unread,
Sep 10, 2008, 4:52:41 PM9/10/08
to sage-support

Hi,

even with what will become 3.1.2.rc2 this blows up on a 32 bit build:

varro:~/sage-3.1.2.rc1 mabshoff$ ./sage
----------------------------------------------------------------------
| SAGE Version 3.1.2.rc1, Release Date: 2008-09-08 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------

sage: M1 = ModularSymbols(21,2)
sage: T1 = M1.hecke_operator(13^8)
sage: trace1=T1.trace()
sage: print trace1
2651076189
sage: M1 = ModularSymbols(21,2)
sage: T1 = M1.hecke_operator(13^9)
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)

/Users/mabshoff/sage-3.1.2.rc1/<ipython console> in <module>()

/Users/mabshoff/sage-3.1.2.rc1/local/lib/python2.5/site-packages/sage/
modular/hecke/module.py in hecke_operator(self, n)
858 int n -- an integer at least 1.
859 """
--> 860 return self.hecke_algebra().hecke_operator(n)
861
862 def T(self, n):

/Users/mabshoff/sage-3.1.2.rc1/local/lib/python2.5/site-packages/sage/
modular/hecke/algebra.py in hecke_operator(self, n)
184 pass
185 n = int(n)
--> 186 T = hecke_operator.HeckeOperator(self, n)
187 self.__hecke_operator[n] = T
188 return T

/Users/mabshoff/sage-3.1.2.rc1/local/lib/python2.5/site-packages/sage/
modular/hecke/hecke_operator.py in __init__(self, parent, n)
360 HeckeAlgebraElement.__init__(self, parent)
361 if not isinstance(n, int):
--> 362 raise TypeError, "n must be an int"
363 self.__n = n
364

TypeError: n must be an int

Ticket time: we are tracking the problem at http://trac.sagemath.org/sage_trac/ticket/4098

Cheers,

Michael

William Stein

unread,
Sep 10, 2008, 5:08:15 PM9/10/08
to sage-s...@googlegroups.com

I posted a fix (which needs review).

William

Raouf

unread,
Sep 10, 2008, 5:09:19 PM9/10/08
to sage-support
i have windows Xp Os and i use sage 3.1.1 vmware with notebook.

Raouf

unread,
Sep 10, 2008, 5:16:28 PM9/10/08
to sage-support
I use a toshiba Laptop with Pentium dual core and 2 gega memory

mabshoff

unread,
Sep 10, 2008, 6:03:55 PM9/10/08
to sage-support


On Sep 10, 2:09 pm, Raouf <raouf.o...@gmail.com> wrote:
> i have windows Xp Os and i use sage 3.1.1 vmware with notebook.

Ok, then you are using a 32 bit build. At

http://trac.sagemath.org/sage_trac/attachment/ticket/4098/trac-4098.patch

you can find a patch that fixes the issue and should cleanly apply
against 3.1.1. It will be in 3.1.2 which should be out in a few days.

Cheers,

Michael

Raouf

unread,
Sep 10, 2008, 6:36:23 PM9/10/08
to sage-support

Raouf

unread,
Sep 10, 2008, 7:54:33 PM9/10/08
to sage-support
Thank u everybody for the Help.
Reply all
Reply to author
Forward
0 new messages