[sage-support] Re: How do I show a permutation group is the alternating group?

2009-05-04 Thread Michael Welsh

sage: B=PermutationGroup(['(1,2,4,5,3)','(2,3,1,4,5)'])
sage: B == AlternatingGroup(5)
True
sage: B == AlternatingGroup(7)
False


On 5/05/2009, at 6:47 PM, jimfar wrote:

> I have generated a group using,
> sage: B=PermutationGroup(['(1,2,4,5,3)','(2,3,1,4,5)'])
> And I know I can generate a list of the elements and determine the
> order, but how do I show that this is actually
> sage: AlternatingGroup(5).
>
> Is there a command to verify that B=AlternatingGroup(5)?

--
http://yomcat.geek.nz


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] How do I show a permutation group is the alternating group?

2009-05-04 Thread jimfar

I have generated a group using,
sage: B=PermutationGroup(['(1,2,4,5,3)','(2,3,1,4,5)'])
And I know I can generate a list of the elements and determine the
order, but how do I show that this is actually
sage: AlternatingGroup(5).

Is there a command to verify that B=AlternatingGroup(5)?

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Is there anyway in SAGE to calculate the integral of bessel function?

2009-05-04 Thread liji.ma...@gmail.com

Thanks for your help.
sage:special.iti0k0(1.0)[0]
In SAGE,the integral can be used as special.iti0k0(1.0)[0], when I use
it as special.iti0k0(1)[0],the programme breaks an error!
But special.iti0k0(1)[0] works well in python.


On 5月4日, 下午9时03分, David Joyner  wrote:
> Maybe you want the following?
>
> sage: from scipy import special
> sage: RealNumber=float
> sage: special.iti0k0(1.0)[0]
> 1.0865210970235892
>
> See the thread
>
> http://groups.google.com/group/sage-support/browse_thread/thread/e344...
>
> for more details.
>
> On Mon, May 4, 2009 at 3:36 AM, liji.ma...@gmail.com
>
>
>
>  wrote:
>
> > Hello everyone!
> > I have a question about the integral of bessel function,I can
> > calculate the integral of bessel function by using Scipy lib.For
> > example,scipy.special.iti0k0(x)[0] means the integral of besseli(0, x)
> > from 0 to x.Is there any function like scipy.special.iti0k0(x)[0] in
> > the SAGE?- 隐藏被引用文字 -
>
> - 显示引用的文字 -
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: quotient poly ring and field

2009-05-04 Thread William Stein

On Mon, May 4, 2009 at 1:07 PM, gtg  wrote:
>
> Hi I'm new to sage. Can you tell me how to construct finite fields
> using quotient of poly ring? For instance suppose I want to construct
> GF(5^2) using a GF(5) poly ring mod out by x^2 + x + 1 how do I do
> that? I can construct the quotient like this:
>
> p = 5
> F = GF(p)
> R. = F['x']
> f = x * x + x + 1
> S = R.quotient(f, 'a')
>
> How do I force S to a field so that I can use it with elliptic curves?
> I know that I can simply do GF(5^2) but I want to be able to specify
> the modulus explicitly.

Use the modulus option to GF:

sage: p = 5
sage: F = GF(p)
sage: R. = F['x']
sage: S. = GF(p^2,modulus=x^2+x+1)
sage: S
Finite Field in a of size 5^2
sage: a^2 + a + 1
0

sage: GF?   # get more help!

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: installing binary of sage-3.4.1 OSX10.4 on G4

2009-05-04 Thread mabshoff



On May 4, 4:25 pm, gsw  wrote:
> Hi all,

Hi Georg,

> after several attempts I was able to produce a Sage-3.4.1dmg the
> contents of which are "drag-and-droppable", and the issue should not
> arise again (knock on wood) for future versions of Sage.

Well, since it always worked for me AFAIK I am curious what the
problem was.

>  Sorry for
> that! I expect Sage 3.4.2 to be out before the end of the week, so you
> might want to wait for this one. I don't know if the re-made
> Sage-3.4.1dmg will make it to the official Sage download page,
> poke me if you need it.

3.4.2 is basically done and the last 3.4.2 tarball + the patch at
#5981 will be it unless we run into some other issue. I am about to
check all my build logs, so we ought to know shortly.

Just ping me if/when you have 10.4 binaries and I will at least
download and drag & drop them this time. Thanks for providing those
since we seem to be lacking 10.4 access, especially on G4 otherwise.

> Cheers,
> gsw

Cheers,

Michael
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: problem with sage-vmware 3.4.1 on windows xp

2009-05-04 Thread mabshoff



On May 4, 12:49 pm, Alessandro Torre 
wrote:
> Hi.Here is the requested output
> (http://groups.google.com/group/sage-support/browse_thread/thread/df50...
> )
>
> Good Work.
> Alessandro

Hi Alessandro,

in the subsequent email you disassembled the whole file. What I wanted
was the output from

   disassemble $pc+32,$pc-32

That will make it a lot less cumbersome to determine what the problem
is. You should also send that output inline and not attach small text
files to emails IMHO :)

Cheers,

Michael
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: SageWorld

2009-05-04 Thread Serge A. Salamanka

I describe the idea and technical issues in more details here:

http://sageworldmath.blogspot.com/

# Serge

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: installing binary of sage-3.4.1 OSX10.4 on G4

2009-05-04 Thread gsw

Hi all,

after several attempts I was able to produce a Sage-3.4.1dmg the
contents of which are "drag-and-droppable", and the issue should not
arise again (knock on wood) for future versions of Sage. Sorry for
that! I expect Sage 3.4.2 to be out before the end of the week, so you
might want to wait for this one. I don't know if the re-made
Sage-3.4.1dmg will make it to the official Sage download page,
poke me if you need it.

Cheers,
gsw
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: SageWorld

2009-05-04 Thread Serge A. Salamanka

See inline below.


Robert Bradshaw пишет:
> On Apr 30, 2009, at 10:13 PM, William Stein wrote:
> 
>> On Thu, Apr 30, 2009 at 10:05 PM, Robert Bradshaw
>>  wrote:
>>> On Apr 29, 2009, at 3:00 PM, Serge Salamanka wrote:
>>>
 Is it a good idea to share objects between python processes with the
 help of any database ?
 Can't still find any decent tool for sharing objects. Saving and
 loading
 them in Sage seems to be a simple approach for user but not for an
 application to run.
>>> Though this isn't quite what you're looking for, it would be nice to
>>> be able to "publish" an object just like one publishes a worksheet on
>>> a public server. It would then give a url where the .sobj can be
>>> downloaded (by anyone, so to send you an object I would write in a
>>> notebook cell)
>>>
>>> publish(a)
>>> http://sagenb.org/pub/unique_name.sobj
>>>
>>> which would return a url that's good as long as the server is live,
>>> and you could send it to someone (e.g. via email or chat) and they
>>> could load it with load("http://sagenb.org/pub/unique_name.sobj";).
>>>  From the command line it could perhaps just save it as a file and
>>> return the filename.
>>>
>> You can already do this.  In a worksheet, just do
>>
>> save(a,'a.sobj')
>>
>> then publish the worksheet that contains a, then there will be a link
>> to the sobj.
>> E.g., I just published http://sagenb.org/home/pub/505/ which contains
>> such a link:
>>
>>http://sagenb.org/home/pub/505/cells/2/a.sobj
>>
>> Now anybody can do:
>>
>> teragon:~ wstein$ sage
>> --
>> | Sage Version 3.4.1, Release Date: 2009-04-21   |
>> | Type notebook() for the GUI, and license() for information.|
>> --
>> sage: a = load('http://sagenb.org/home/pub/505/cells/2/a.sobj')
>> Attempting to load remote file: http://sagenb.org/home/pub/505/ 
>> cells/2/a.sobj
>> Loading: [.]
>> sage: a
>> 'e!'
> 
> Ah, yes, you can. I still think it might be handy to be able to just  
> publish objects detached from worksheets though. Taken one step  

Yes, this could be useful indeed.


> further, being able to  "push" them too to a public place (though  
> this opens a whole can of authentication/security issues).

Well, this is very easy in gLite.
One would have to  just save an object and copy it to the public space
in Grid storage information system.

I might make this possible for SAGE some time.

There is also an idea to use RSS feeds for spreading information about
published objects and notebooks. (see my post "Sage RSS reader in
firefox and .xml .rss in SAGE")

# Serge

> 
> - Robert
> 
> 
> > 
> 

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: outdated version of Sage in Ubuntu 9.04

2009-05-04 Thread ma...@mendelu.cz

Hi

On 4 Kvě, 11:56, mabshoff 
wrote:
> > Hello, not related to Sage, but if I remember correctly, newer Maxima
> > is in Debian Sid (compiled with GCL). This Sid version is slower than
> > 5.13 (with GCL also).
>
> Do you have any idea why that is and how much slowdown there is? What
> specifically is slower? Might this be due to the rather small RAM
> footprint of the server?
>

This slowdown was on the server 
http://old.mendelu.cz/~marik/maw/index.php?lang=en&form=main
, my logs look like http://wood.mendelu.cz/math/maw.php and
http://wood.mendelu.cz/math/maw/common/tail.php?dir=minmax3d

The time to complete the task (some computations in batch mode,
differentiation, integration, in some cases pattern matching,
evaluating limits, solving equations, simplifying expressions)
increased about two or three times. A similar behavor has been
observed also on a big PC and so the problem cannot be in small
memory. I did not more tests related to this (and never asked about
this on maxima forum).

Robert
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: quotient poly ring and field

2009-05-04 Thread John H Palmieri

On May 4, 1:07 pm, gtg  wrote:
> Hi I'm new to sage. Can you tell me how to construct finite fields
> using quotient of poly ring? For instance suppose I want to construct
> GF(5^2) using a GF(5) poly ring mod out by x^2 + x + 1 how do I do
> that? I can construct the quotient like this:
>
> p = 5
> F = GF(p)
> R. = F['x']
> f = x * x + x + 1
> S = R.quotient(f, 'a')
>
> How do I force S to a field so that I can use it with elliptic curves?

Can't you just do it?

sage: S.is_field()
True
sage: EllipticCurve(S, [2, 4])
Elliptic Curve defined by y^2 = x^3 + 2*x + 4 over Univariate Quotient
Polynomial Ring in a over Finite Field of size 5 with modulus x^2 + x
+ 1

What exactly are you trying to do, and where are you having problems?

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] quotient poly ring and field

2009-05-04 Thread gtg

Hi I'm new to sage. Can you tell me how to construct finite fields
using quotient of poly ring? For instance suppose I want to construct
GF(5^2) using a GF(5) poly ring mod out by x^2 + x + 1 how do I do
that? I can construct the quotient like this:

p = 5
F = GF(p)
R. = F['x']
f = x * x + x + 1
S = R.quotient(f, 'a')

How do I force S to a field so that I can use it with elliptic curves?
I know that I can simply do GF(5^2) but I want to be able to specify
the modulus explicitly.

Thanks.


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] problem with sage-vmware 3.4.1 on windows xp

2009-05-04 Thread Alessandro Torre
I forgot the files...

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---

Dump of assembler code for function __gmpz_set_str:
0xb76f8650 <__gmpz_set_str+0>:  push   %ebp
0xb76f8651 <__gmpz_set_str+1>:  mov%esp,%ebp
0xb76f8653 <__gmpz_set_str+3>:  push   %edi
0xb76f8654 <__gmpz_set_str+4>:  push   %esi
0xb76f8655 <__gmpz_set_str+5>:  push   %ebx
0xb76f8656 <__gmpz_set_str+6>:  sub$0x5c,%esp
0xb76f8659 <__gmpz_set_str+9>:  call   0xb76e2107 <__i686.get_pc_thunk.bx>
0xb76f865e <__gmpz_set_str+14>: add$0x2ec86,%ebx
0xb76f8664 <__gmpz_set_str+20>: mov0x8(%ebp),%eax
0xb76f8667 <__gmpz_set_str+23>: mov%eax,-0x3c(%ebp)
0xb76f866a <__gmpz_set_str+26>: mov0xc(%ebp),%esi
0xb76f866d <__gmpz_set_str+29>: mov%gs:0x14,%edx
0xb76f8674 <__gmpz_set_str+36>: mov%edx,-0x10(%ebp)
0xb76f8677 <__gmpz_set_str+39>: xor%edx,%edx
0xb76f8679 <__gmpz_set_str+41>: cmpl   $0x24,0x10(%ebp)
0xb76f867d <__gmpz_set_str+45>: jg 0xb76f8737 <__gmpz_set_str+231>
0xb76f8683 <__gmpz_set_str+51>: mov-0x3c(%ebx),%ecx
0xb76f8689 <__gmpz_set_str+57>: mov%ecx,-0x2c(%ebp)
0xb76f868c <__gmpz_set_str+60>: call   0xb76e1f54 <__ctype_b_...@plt>
0xb76f8691 <__gmpz_set_str+65>: mov%eax,-0x28(%ebp)
0xb76f8694 <__gmpz_set_str+68>: mov(%eax),%ecx
0xb76f8696 <__gmpz_set_str+70>: movzbl (%esi),%eax
0xb76f8699 <__gmpz_set_str+73>: movzbl %al,%edx
0xb76f869c <__gmpz_set_str+76>: mov%edx,-0x44(%ebp)
0xb76f869f <__gmpz_set_str+79>: add$0x1,%esi
0xb76f86a2 <__gmpz_set_str+82>: testb  $0x20,0x1(%ecx,%edx,2)
0xb76f86a7 <__gmpz_set_str+87>: jne0xb76f8696 <__gmpz_set_str+70>
0xb76f86a9 <__gmpz_set_str+89>: cmp$0x2d,%al
0xb76f86ab <__gmpz_set_str+91>: je 0xb76f8767 <__gmpz_set_str+279>
0xb76f86b1 <__gmpz_set_str+97>: movl   $0x0,-0x30(%ebp)
0xb76f86b8 <__gmpz_set_str+104>:mov$0xa,%eax
0xb76f86bd <__gmpz_set_str+109>:mov0x10(%ebp),%edx
0xb76f86c0 <__gmpz_set_str+112>:test   %edx,%edx
0xb76f86c2 <__gmpz_set_str+114>:cmovne 0x10(%ebp),%eax
0xb76f86c6 <__gmpz_set_str+118>:mov-0x44(%ebp),%edx
0xb76f86c9 <__gmpz_set_str+121>:mov-0x2c(%ebp),%edi
0xb76f86cc <__gmpz_set_str+124>:movzbl (%edx,%edi,1),%edx
0xb76f86d0 <__gmpz_set_str+128>:cmp%edx,%eax
0xb76f86d2 <__gmpz_set_str+130>:jle0xb76f8760 <__gmpz_set_str+272>
0xb76f86d8 <__gmpz_set_str+136>:mov0x10(%ebp),%edi
0xb76f86db <__gmpz_set_str+139>:test   %edi,%edi
0xb76f86dd <__gmpz_set_str+141>:jne0xb76f86ff <__gmpz_set_str+175>
0xb76f86df <__gmpz_set_str+143>:cmpl   $0x30,-0x44(%ebp)
0xb76f86e3 <__gmpz_set_str+147>:je 0xb76f889c <__gmpz_set_str+588>
0xb76f86e9 <__gmpz_set_str+153>:movl   $0xa,0x10(%ebp)
0xb76f86f0 <__gmpz_set_str+160>:cmpl   $0x30,-0x44(%ebp)
0xb76f86f4 <__gmpz_set_str+164>:jne0xb76f8705 <__gmpz_set_str+181>
0xb76f86f6 <__gmpz_set_str+166>:movzbl (%esi),%edx
0xb76f86f9 <__gmpz_set_str+169>:mov%edx,-0x44(%ebp)
0xb76f86fc <__gmpz_set_str+172>:add$0x1,%esi
0xb76f86ff <__gmpz_set_str+175>:cmpl   $0x30,-0x44(%ebp)
0xb76f8703 <__gmpz_set_str+179>:je 0xb76f86f6 <__gmpz_set_str+166>
0xb76f8705 <__gmpz_set_str+181>:mov-0x44(%ebp),%edi
0xb76f8708 <__gmpz_set_str+184>:testb  $0x20,0x1(%ecx,%edi,2)
0xb76f870d <__gmpz_set_str+189>:jne0xb76f86f6 <__gmpz_set_str+166>
0xb76f870f <__gmpz_set_str+191>:test   %edi,%edi
0xb76f8711 <__gmpz_set_str+193>:jne0xb76f877c <__gmpz_set_str+300>
0xb76f8713 <__gmpz_set_str+195>:mov-0x3c(%ebp),%eax
0xb76f8716 <__gmpz_set_str+198>:movl   $0x0,0x4(%eax)
0xb76f871d <__gmpz_set_str+205>:xor%eax,%eax
0xb76f871f <__gmpz_set_str+207>:mov-0x10(%ebp),%edi
0xb76f8722 <__gmpz_set_str+210>:xor%gs:0x14,%edi
0xb76f8729 <__gmpz_set_str+217>:jne0xb76f88ee <__gmpz_set_str+670>
0xb76f872f <__gmpz_set_str+223>:lea-0xc(%ebp),%esp
0xb76f8732 <__gmpz_set_str+226>:pop%ebx
0xb76f8733 <__gmpz_set_str+227>:pop%esi
0xb76f8734 <__gmpz_set_str+228>:pop%edi
0xb76f8735 <__gmpz_set_str+229>:pop%ebp
0xb76f8736 <__gmpz_set_str+230>:ret
0xb76f8737 <__gmpz_set_str+231>:cmpl   $0x3e,0x10(%ebp)
0xb76f873b <__gmpz_set_str+235>:jg 0xb76f8760 <__gmpz_set_str+272>
0xb76f873d <__gmpz_set_str+237>:mov-0x3c(%ebx),%edi
0xb76f8743 <__gmpz_set_str+243>:add$0xe0,%edi
0xb76f8749 <__gmpz_set_str+249>:mov%edi,-0x2c(%ebp)
0xb76f874c <__gmpz_set_str+252>:jmp0xb76f868c <__gmpz

[sage-support] problem with sage-vmware 3.4.1 on windows xp

2009-05-04 Thread Alessandro Torre
Hi.Here is the requested output
(
http://groups.google.com/group/sage-support/browse_thread/thread/df502c9e16565886
)

Good Work.
Alessandro

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Yet another zeta question

2009-05-04 Thread William Stein

On Mon, May 4, 2009 at 12:41 PM, Robert Bradshaw
 wrote:
>
> On May 4, 2009, at 12:22 PM, William Stein wrote:
>
>> On Mon, May 4, 2009 at 12:02 PM, kcrisman  wrote:
>>>
>>> In order to plot zeta for real input, I have to do the following:
>>> def Zeta(x):
>>>    return RR(zeta(x))
>>> plot(Zeta,2,20)
>>>
>>> This is because
>>> sage: zeta(2)
>>> 1.64493406684823
>>> sage: type(zeta(2))
>>> 
>>>
>>> which seems odd to me that pure real complex number won't coerce to
>>> the real field, or to float (which is what plot wants).
>>
>> This is a Python design decision.  Note that in pure Python it is the
>> same.  Sage remains consistent with this Python design decision.
>>
>> sage: float(complex(1,0))
>> TypeError: can't convert complex to float; use abs(z)
>
> I still think this is a bad design decision that is inconsistent with
> the rest of Sage and we should do differently...
>
> - Robert

I definitely don't claim it's a good one.  I just recall that as being
the justification for why things are as they are now. It would be
interesting to make a list of what we consider bad design decisions in
python:

  * len returning a Python int
  * float(complex(1,0)) not working

Regarding the second, there is likely a really good reason why the
choice to force people to use abs was made.  I wonder what it is?

William

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Dirichlet series

2009-05-04 Thread Robert Bradshaw

On May 4, 2009, at 11:19 AM, kcrisman wrote:

>
>> Actually, Dokchitser's algorithm only handles functions with finitely
>> many poles, so it won't be able to handle this if L(s) = 1/zeta(s).
>
> Yes, the series which comes from Moebius mu ends up being 1/zeta,
> essentially "because" mu is the Dirichlet inverse of the unit function
> u (where u(n)=1 for all n).  The Euler product makes this trivial by
> hand as well, but I didn't know if the computer also could do that
> manipulation, similarly to when one "verifies" that diff(x^3,x)==3*x^2
> with Sage to show it at least does the right thing for obvious
> examples.
>
> Hmm, so what now?  I would have tried using lcalc but it doesn't seem
> to have a way to accept input of this type.  I really just want to
> show a few values/graph this function.

Given that it's a theorem that (your) L(s) = 1/zeta(s), then just  
plot 1/zeta(s).

- Robert


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Yet another zeta question

2009-05-04 Thread Robert Bradshaw

On May 4, 2009, at 12:22 PM, William Stein wrote:

> On Mon, May 4, 2009 at 12:02 PM, kcrisman  wrote:
>>
>> In order to plot zeta for real input, I have to do the following:
>> def Zeta(x):
>>return RR(zeta(x))
>> plot(Zeta,2,20)
>>
>> This is because
>> sage: zeta(2)
>> 1.64493406684823
>> sage: type(zeta(2))
>> 
>>
>> which seems odd to me that pure real complex number won't coerce to
>> the real field, or to float (which is what plot wants).
>
> This is a Python design decision.  Note that in pure Python it is the
> same.  Sage remains consistent with this Python design decision.
>
> sage: float(complex(1,0))
> TypeError: can't convert complex to float; use abs(z)

I still think this is a bad design decision that is inconsistent with  
the rest of Sage and we should do differently...

- Robert



--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: using len invokes "bad" division

2009-05-04 Thread Jaap Spies

Mike Hansen wrote:
> On Mon, May 4, 2009 at 12:19 PM, Jaap Spies  wrote:
>> Another Python builtin is pow(), but how is it possible that
>> type(pow(2,9,11)) returns
>> 
>>
>> Or am I mistaken?
> 
> The pow() builtin just calls __pow__ on the first argument in that
> case, which we control so we can return one of our types.  len() will
> call __len__, but forces whatever is returned to be an int.  This is
> what will be changing in Python 3.0.
> 

Than pow? gives a misleading text:

>> Type:
>> Definition:  pow( [noargspec] )
>> Docstring: 
>> pow(x, y[, z]) -> number
>> 
>> With two arguments, equivalent to x**y.  With three arguments,
>> equivalent to (x**y) % z, but may be more efficient (e.g. for longs).


type(pow(2,9)) returns


type(pow(2,9) % 11) returns


same for type(2^9 % 11) and type(2**9 % 11)


Jaap


> --Mike
> 
> > 
> 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: using len invokes "bad" division

2009-05-04 Thread William Stein

On Mon, May 4, 2009 at 12:23 PM, Mike Hansen  wrote:
>
> On Mon, May 4, 2009 at 12:19 PM, Jaap Spies  wrote:
>> Another Python builtin is pow(), but how is it possible that
>> type(pow(2,9,11)) returns
>> 
>>
>> Or am I mistaken?
>
> The pow() builtin just calls __pow__ on the first argument in that
> case, which we control so we can return one of our types.  len() will
> call __len__, but forces whatever is returned to be an int.  This is
> what will be changing in Python 3.0.

However that change will in now way help with the original question.
Even in python 3.0 the len(...) of a list is still a Python int.

wst...@sage:~$ python3.0
Python 3.0 (r30:67503, Jan 23 2009, 04:39:45)
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> type(len([1,2,3,4]))


William

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: using len invokes "bad" division

2009-05-04 Thread Mike Hansen

On Mon, May 4, 2009 at 12:19 PM, Jaap Spies  wrote:
> Another Python builtin is pow(), but how is it possible that
> type(pow(2,9,11)) returns
> 
>
> Or am I mistaken?

The pow() builtin just calls __pow__ on the first argument in that
case, which we control so we can return one of our types.  len() will
call __len__, but forces whatever is returned to be an int.  This is
what will be changing in Python 3.0.

--Mike

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Yet another zeta question

2009-05-04 Thread William Stein

On Mon, May 4, 2009 at 12:02 PM, kcrisman  wrote:
>
> In order to plot zeta for real input, I have to do the following:
> def Zeta(x):
>    return RR(zeta(x))
> plot(Zeta,2,20)
>
> This is because
> sage: zeta(2)
> 1.64493406684823
> sage: type(zeta(2))
> 
>
> which seems odd to me that pure real complex number won't coerce to
> the real field, or to float (which is what plot wants).

This is a Python design decision.  Note that in pure Python it is the
same.  Sage remains consistent with this Python design decision.

sage: float(complex(1,0))
TypeError: can't convert complex to float; use abs(z)


> Also annoying but less odd is that the error handling in plot doesn't
> deal well with
>
> plot(Zeta,1,20)
>
> presumably because PariError is not one of the error types excepted at
> e.g. asymptotes.

That Zeta ever raises PariError might as well be considered a bug.
(It's more a "nobody got to making things better" issue.)  You might
use some exception handling in your definition of Zeta.

 -- William

> I guess the point of this is asking whether there is something obvious
> I am missing here, and if not, whether this is a bug or just something
> I have to deal with.  Not that the real plot of zeta is so exciting to
> look at!
>
> Thanks!
> - kcrisman
> >
>



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

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: using len invokes "bad" division

2009-05-04 Thread Jaap Spies

Robert Bradshaw wrote:
> On May 4, 2009, at 10:45 AM, kcrisman wrote:

> len() is a Python builtin, which is a good indication that it will  
> return Python types (especially when acting on a Python type). In  
> fact, there's no way on the c-api level to return a Sage integer, as  
> len() always returns a c long. This is similar to range returning a  
> list of python ints.
> 

Another Python builtin is pow(), but how is it possible that
type(pow(2,9,11)) returns


Or am I mistaken?

Jaap

(This comes from a question from a private e-mail)


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Yet another zeta question

2009-05-04 Thread kcrisman

In order to plot zeta for real input, I have to do the following:
def Zeta(x):
return RR(zeta(x))
plot(Zeta,2,20)

This is because
sage: zeta(2)
1.64493406684823
sage: type(zeta(2))


which seems odd to me that pure real complex number won't coerce to
the real field, or to float (which is what plot wants).

Also annoying but less odd is that the error handling in plot doesn't
deal well with

plot(Zeta,1,20)

presumably because PariError is not one of the error types excepted at
e.g. asymptotes.

I guess the point of this is asking whether there is something obvious
I am missing here, and if not, whether this is a bug or just something
I have to deal with.  Not that the real plot of zeta is so exciting to
look at!

Thanks!
- kcrisman
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Dirichlet series

2009-05-04 Thread kcrisman

> Actually, Dokchitser's algorithm only handles functions with finitely  
> many poles, so it won't be able to handle this if L(s) = 1/zeta(s).


Yes, the series which comes from Moebius mu ends up being 1/zeta,
essentially "because" mu is the Dirichlet inverse of the unit function
u (where u(n)=1 for all n).  The Euler product makes this trivial by
hand as well, but I didn't know if the computer also could do that
manipulation, similarly to when one "verifies" that diff(x^3,x)==3*x^2
with Sage to show it at least does the right thing for obvious
examples.

Hmm, so what now?  I would have tried using lcalc but it doesn't seem
to have a way to accept input of this type.  I really just want to
show a few values/graph this function.

Thanks,
- kcrisman
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: using len invokes "bad" division

2009-05-04 Thread William Stein

On Mon, May 4, 2009 at 11:13 AM, kcrisman  wrote:
>
>> >>> I assume this is known, but I am wondering whether it should be
>> >>> treated as a bug,
>>
>> >> This is not a bug.  It's a stupid design decision in Python, which we
>
> Right, I knew that Python ints behaved this way, I was just surprised
> that somehow in Sage / didn't change this - I guess it's because most
> integer input gets preparsed to Integer, right?
>
>> >> Trust me, I understand that Python's int floor division sucks.   I'm
>> >> teaching undergrads about stats using Sage now, and the most obvious
>> >> line of code to compute the mean of a list gets the answer totally
>> >> wrong because of this problem.  This already caused a lot of
>> >> confusion.
>
> Luckily I haven't had that problem - just my own getting weird answers
> just now!
>
>> > Good point, I hadn't though about that. We could introduce a size()
>> > or cardinality() method that returns an Integer, or possibly infinity.
>
> That sounds useful; there are already other things that have
> cardinality() implemented, right?
>
>> We could also redefine len.
>
> I'm not touching that one! :)

Well it's really just random chance that I didn't redefine len in
sage.all back in 2005. If I had, then len would likely still be
redefined now and we wouldn't be having this conversation.  I'm not
sure this isn't a good idea.  I just don't know.   It's a question of
pros versus cons, and so far I see more pros than cons.

 -- William

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: using len invokes "bad" division

2009-05-04 Thread kcrisman

> >>> I assume this is known, but I am wondering whether it should be
> >>> treated as a bug,
>
> >> This is not a bug.  It's a stupid design decision in Python, which we

Right, I knew that Python ints behaved this way, I was just surprised
that somehow in Sage / didn't change this - I guess it's because most
integer input gets preparsed to Integer, right?

> >> Trust me, I understand that Python's int floor division sucks.   I'm
> >> teaching undergrads about stats using Sage now, and the most obvious
> >> line of code to compute the mean of a list gets the answer totally
> >> wrong because of this problem.  This already caused a lot of
> >> confusion.

Luckily I haven't had that problem - just my own getting weird answers
just now!

> > Good point, I hadn't though about that. We could introduce a size()
> > or cardinality() method that returns an Integer, or possibly infinity.

That sounds useful; there are already other things that have
cardinality() implemented, right?

> We could also redefine len.    

I'm not touching that one! :)

Thanks for all the insight,
- kcrisman
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Dirichlet series

2009-05-04 Thread Robert Bradshaw

On May 4, 2009, at 10:52 AM, Robert Bradshaw wrote:

> On May 4, 2009, at 8:57 AM, kcrisman wrote:
>
>> Dear Support,
>>
>> There are several calculators in reference/lfunctions.html for L-
>> functions.  However, I am not quite sure what to do if I want a
>> "Dirichlet series" coming not from a character nor an elliptic curve,
>> e.g. sum mu(n)/n^s for the Moebius mu function.  I tried
>>
>> sage: L = Dokchitser(conductor=1, gammaV=[0], weight=1, eps=1)
>> sage: L.init_coeffs('moebius(k)')
>> as a very naive try but doesn't seem to evaluate. In particular I'm
>> not sure whether a conductor has relevance for this - does it come
>> from an EC after all?
>
> No, I don't think this comes from an elliptic curve. This is the
> right way to do it, but it seems as if you've got some of the
> parameters wrong--this should be close to zero:
>
> sage: L.check_functional_equation()
> -0.166126027002134
>
> (Sorry, I don't know off the top of my head what the functional
> equation actually is...)

Actually, Dokchitser's algorithm only handles functions with finitely  
many poles, so it won't be able to handle this if L(s) = 1/zeta(s).

- Robert


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: using len invokes "bad" division

2009-05-04 Thread mabshoff



On May 4, 11:01 am, Robert Bradshaw 
wrote:
> On May 4, 2009, at 10:53 AM, William Stein wrote:



> Good point, I hadn't though about that. We could introduce a size()  
> or cardinality() method that returns an Integer, or possibly infinity.

Combinat already uses cardinality() since they need lists to be longer
than a C long or even infinity.

> - Robert

Cheers,

Michael
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: using len invokes "bad" division

2009-05-04 Thread William Stein

On Mon, May 4, 2009 at 11:01 AM, Robert Bradshaw
 wrote:
>
> On May 4, 2009, at 10:53 AM, William Stein wrote:
>
>> On Mon, May 4, 2009 at 10:45 AM, kcrisman  wrote:
>>>
>>> Dear support,
>>>
>>> I assume this is known, but I am wondering whether it should be
>>> treated as a bug,
>>
>> This is not a bug.  It's a stupid design decision in Python, which we
>> have to live with until we switch to Python 3.0 or switch to doing
>> "from __future__ import division":
>>
>> sage: from __future__ import division
>> sage: len([2,2])/len([2,3,4])
>> 0.3
>
> And I'm not a fan of this behavior either, but in many ways it's less
> surprising than 0.

I also don't like it either, but it is *massively* better than getting 0.

>
>>
>>
>>> or whether someone using len() on lists should be
>>> assumed to know it might then be operated on with Python /, not
>>> Sage /, as opposed to the preparser catching this sort of thing.
>>>
>>> sage: len([2,2])/len([2,3,4])
>>> 0
>>>
>>> Thanks for any suggestions on what to do with this - right now I have
>>> to do
>>>
>>> sage: Integer(len([2,2]))/Integer(len([2,3,4]))
>>> 2/3
>>
>> Trust me, I understand that Python's int floor division sucks.   I'm
>> teaching undergrads about stats using Sage now, and the most obvious
>> line of code to compute the mean of a list gets the answer totally
>> wrong because of this problem.  This already caused a lot of
>> confusion.
>>
>> This is definitely not something that should be addressed by the
>> preparser.  It could be addressed by rewriting len, but I'm very
>> hesitant to do that, because it will introduce subtle bugs when moving
>> code from preparsed to the library (.py files).
>> The way one might rewrite len would be:
>>
>> sage: import __builtin__
>> sage: len = lambda x: Integer(__builtin__.len(x))
>> sage: len([2,2])/len([2,3,4])
>> 2/3
>
> Good point, I hadn't though about that. We could introduce a size()
> or cardinality() method that returns an Integer, or possibly infinity.

We could also redefine len.Can you think of any problems this will
cause *besides* when moving code from .sage preparsed files to Python
in the Sage library?I can't think of any.

 -- William

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: using len invokes "bad" division

2009-05-04 Thread Robert Bradshaw

On May 4, 2009, at 10:53 AM, William Stein wrote:

> On Mon, May 4, 2009 at 10:45 AM, kcrisman  wrote:
>>
>> Dear support,
>>
>> I assume this is known, but I am wondering whether it should be
>> treated as a bug,
>
> This is not a bug.  It's a stupid design decision in Python, which we
> have to live with until we switch to Python 3.0 or switch to doing
> "from __future__ import division":
>
> sage: from __future__ import division
> sage: len([2,2])/len([2,3,4])
> 0.3

And I'm not a fan of this behavior either, but in many ways it's less  
surprising than 0.

>
>
>> or whether someone using len() on lists should be
>> assumed to know it might then be operated on with Python /, not
>> Sage /, as opposed to the preparser catching this sort of thing.
>>
>> sage: len([2,2])/len([2,3,4])
>> 0
>>
>> Thanks for any suggestions on what to do with this - right now I have
>> to do
>>
>> sage: Integer(len([2,2]))/Integer(len([2,3,4]))
>> 2/3
>
> Trust me, I understand that Python's int floor division sucks.   I'm
> teaching undergrads about stats using Sage now, and the most obvious
> line of code to compute the mean of a list gets the answer totally
> wrong because of this problem.  This already caused a lot of
> confusion.
>
> This is definitely not something that should be addressed by the
> preparser.  It could be addressed by rewriting len, but I'm very
> hesitant to do that, because it will introduce subtle bugs when moving
> code from preparsed to the library (.py files).
> The way one might rewrite len would be:
>
> sage: import __builtin__
> sage: len = lambda x: Integer(__builtin__.len(x))
> sage: len([2,2])/len([2,3,4])
> 2/3

Good point, I hadn't though about that. We could introduce a size()  
or cardinality() method that returns an Integer, or possibly infinity.

- Robert



--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: using len invokes "bad" division

2009-05-04 Thread Robert Bradshaw

On May 4, 2009, at 10:45 AM, kcrisman wrote:

> Dear support,
>
> I assume this is known, but I am wondering whether it should be
> treated as a bug, or whether someone using len() on lists should be
> assumed to know it might then be operated on with Python /, not
> Sage /, as opposed to the preparser catching this sort of thing.

len() is a Python builtin, which is a good indication that it will  
return Python types (especially when acting on a Python type). In  
fact, there's no way on the c-api level to return a Sage integer, as  
len() always returns a c long. This is similar to range returning a  
list of python ints.

> sage: len([2,2])/len([2,3,4])
> 0
>
> Thanks for any suggestions on what to do with this - right now I have
> to do
>
> sage: Integer(len([2,2]))/Integer(len([2,3,4]))
> 2/3

Yep, that's how to do it. (Note that only one of the numerator/ 
denominator needs to be cast, as coercion will cast the other.)

sage: Integer(2)/int(3)
2/3
sage: int(2)/Integer(3)
2/3
sage: int(2)/int(3)
0

- Robert


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: problem with sage-vmware 3.4.1 on windows xp

2009-05-04 Thread William Stein

On Mon, May 4, 2009 at 10:51 AM, Alessandro Torre
 wrote:
>
> putty cannot connect to the address you say.
> I think it is normal if sage fails to start.

putty should connect fine if you get a login prompt for the sage
virtual machine.  Connecting via ssh has nothing to do with sage.

> I tried to use standard gdb logging to file, but I can't find gdb.txt
> I tried to set another file, but it seems it doesn't work (I used "set
> logging file mylog.txt")
> Any hints?
> I could ftp the log file to a server of mine and then download it from
> within winxp.
>
>
> On 3 Mag, 20:20, William Stein  wrote:
>>
>>
>> VMware doesn't by default make this easy at all.  One thing you can do
>> is use a standard windows ssh program (e.g., putty is a good free
>> one), and ssh to the vmware machine.
>> Use the login "login" and password "sage".  The address that you ssh
>> to is the same one
>> that you use to connect to the sage notebook.    Copy and paste, etc.,
>> should work very well with putty.
>>
>> --
>> William Stein
>> Associate Professor of Mathematics
>> University of Washingtonhttp://wstein.org
> >
>



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

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: using len invokes "bad" division

2009-05-04 Thread William Stein

On Mon, May 4, 2009 at 10:45 AM, kcrisman  wrote:
>
> Dear support,
>
> I assume this is known, but I am wondering whether it should be
> treated as a bug,

This is not a bug.  It's a stupid design decision in Python, which we
have to live with until we switch to Python 3.0 or switch to doing
"from __future__ import division":

sage: from __future__ import division
sage: len([2,2])/len([2,3,4])
0.3


> or whether someone using len() on lists should be
> assumed to know it might then be operated on with Python /, not
> Sage /, as opposed to the preparser catching this sort of thing.
>
> sage: len([2,2])/len([2,3,4])
> 0
>
> Thanks for any suggestions on what to do with this - right now I have
> to do
>
> sage: Integer(len([2,2]))/Integer(len([2,3,4]))
> 2/3

Trust me, I understand that Python's int floor division sucks.   I'm
teaching undergrads about stats using Sage now, and the most obvious
line of code to compute the mean of a list gets the answer totally
wrong because of this problem.  This already caused a lot of
confusion.

This is definitely not something that should be addressed by the
preparser.  It could be addressed by rewriting len, but I'm very
hesitant to do that, because it will introduce subtle bugs when moving
code from preparsed to the library (.py files).
The way one might rewrite len would be:

sage: import __builtin__
sage: len = lambda x: Integer(__builtin__.len(x))
sage: len([2,2])/len([2,3,4])
2/3

 -- William

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Dirichlet series

2009-05-04 Thread Robert Bradshaw

On May 4, 2009, at 8:57 AM, kcrisman wrote:

> Dear Support,
>
> There are several calculators in reference/lfunctions.html for L-
> functions.  However, I am not quite sure what to do if I want a
> "Dirichlet series" coming not from a character nor an elliptic curve,
> e.g. sum mu(n)/n^s for the Moebius mu function.  I tried
>
> sage: L = Dokchitser(conductor=1, gammaV=[0], weight=1, eps=1)
> sage: L.init_coeffs('moebius(k)')
> as a very naive try but doesn't seem to evaluate. In particular I'm
> not sure whether a conductor has relevance for this - does it come
> from an EC after all?

No, I don't think this comes from an elliptic curve. This is the  
right way to do it, but it seems as if you've got some of the  
parameters wrong--this should be close to zero:

sage: L.check_functional_equation()
-0.166126027002134

(Sorry, I don't know off the top of my head what the functional  
equation actually is...)

> I honestly don't know how to input this sort of thing into Sage.   I
> mostly want to just evaluate it at various points, though showing that
> L*zeta(s)=1 symbolically as well would be very nice!

This could probably be done by some clever manipulations of the euler  
product.

- Robert


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: problem with sage-vmware 3.4.1 on windows xp

2009-05-04 Thread Alessandro Torre

putty cannot connect to the address you say.
I think it is normal if sage fails to start.

I tried to use standard gdb logging to file, but I can't find gdb.txt
I tried to set another file, but it seems it doesn't work (I used "set
logging file mylog.txt")
Any hints?
I could ftp the log file to a server of mine and then download it from
within winxp.


On 3 Mag, 20:20, William Stein  wrote:
>
>
> VMware doesn't by default make this easy at all.  One thing you can do
> is use a standard windows ssh program (e.g., putty is a good free
> one), and ssh to the vmware machine.
> Use the login "login" and password "sage".  The address that you ssh
> to is the same one
> that you use to connect to the sage notebook.    Copy and paste, etc.,
> should work very well with putty.
>
> --
> William Stein
> Associate Professor of Mathematics
> University of Washingtonhttp://wstein.org
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] using len invokes "bad" division

2009-05-04 Thread kcrisman

Dear support,

I assume this is known, but I am wondering whether it should be
treated as a bug, or whether someone using len() on lists should be
assumed to know it might then be operated on with Python /, not
Sage /, as opposed to the preparser catching this sort of thing.

sage: len([2,2])/len([2,3,4])
0

Thanks for any suggestions on what to do with this - right now I have
to do

sage: Integer(len([2,2]))/Integer(len([2,3,4]))
2/3

- kcrisman
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Failure running sage-vmware-sse2-3.4.1

2009-05-04 Thread mabshoff



On May 4, 10:11 am, Iwan Lappo-Danilewski 
wrote:
> Is there a chance that there will be executables that run on my work
> machine with the next release?

No, 3.4.2 won't have the fix, but 4.0 will in roughly two weeks.

> Or should I start compiling right now
> and maybe move to some SVN kind of thing?

I don't know what you mean? You can upgrade from sage release to sage
release, but there is no such thing as all the sources in some repo.
Various bits and pieces of Sage are under version control.



> Program received signal SIGILL, Illegal instruction.
> [Switching to Thread 0xb7dd28d0 (LWP 9733)]
> 0xb78e4542 in __gmpz_set_str ()
>    from /home/ivan/aps/sage-3.4.1-linux-Ubuntu_8.10-sse2-i686-Linux/
> local/lib/libgmp.so.3
> Current language:  auto; currently asm
> (gdb)

Ok, you left out what I truly cared about, i.e. the output from

   disassemble $pc+32,$pc-32

I was already pretty sure that MPIR/GMP was the issue here. In Sage
4.0 we will build MPIR for generic P4 CPUs so that the problem you ran
into won't happen again.

Cheers,

Michael
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Failure running sage-vmware-sse2-3.4.1

2009-05-04 Thread Iwan Lappo-Danilewski

Is there a chance that there will be executables that run on my work
machine with the next release? Or should I start compiling right now
and maybe move to some SVN kind of thing?



For completeness sake:

i...@ivan-laptop:~/aps/sage-3.4.1-linux-Ubuntu_8.10-sse2-i686-Linux$ ./
sage -gdb
--
| Sage Version 3.4.1, Release Date: 2009-04-21   |
| Type notebook() for the GUI, and license() for information.|
--
/home/ivan/aps/sage-3.4.1-linux-Ubuntu_8.10-sse2-i686-Linux/local/bin/
sage-ipython
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show
copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
[Thread debugging using libthread_db enabled]
Python 2.5.2 (r252:60911, Apr 24 2009, 04:52:24)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
[New Thread 0xb7dd28d0 (LWP 9733)]

Program received signal SIGILL, Illegal instruction.
[Switching to Thread 0xb7dd28d0 (LWP 9733)]
0xb78e4542 in __gmpz_set_str ()
   from /home/ivan/aps/sage-3.4.1-linux-Ubuntu_8.10-sse2-i686-Linux/
local/lib/libgmp.so.3
Current language:  auto; currently asm
(gdb)

i...@ivan-laptop:~/aps/sage-3.4.1-linux-Ubuntu_8.10-sse2-i686-Linux$
cat /proc/cpuinfo
processor   : 0
vendor_id   : AuthenticAMD
cpu family  : 15
model   : 12
model name  : AMD Athlon(tm) 64 Processor 3400+
stepping: 0
cpu MHz : 2400.000
cache size  : 512 KB
fdiv_bug: no
hlt_bug : no
f00f_bug: no
coma_bug: no
fpu : yes
fpu_exception   : yes
cpuid level : 1
wp  : yes
flags   : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext lm 3dnowext
3dnow up
bogomips: 4823.56
clflush size: 64
power management: ts fid vid ttp
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Dirichlet series

2009-05-04 Thread kcrisman

Dear Support,

There are several calculators in reference/lfunctions.html for L-
functions.  However, I am not quite sure what to do if I want a
"Dirichlet series" coming not from a character nor an elliptic curve,
e.g. sum mu(n)/n^s for the Moebius mu function.  I tried

sage: L = Dokchitser(conductor=1, gammaV=[0], weight=1, eps=1)
sage: L.init_coeffs('moebius(k)')
as a very naive try but doesn't seem to evaluate. In particular I'm
not sure whether a conductor has relevance for this - does it come
from an EC after all?

I honestly don't know how to input this sort of thing into Sage.   I
mostly want to just evaluate it at various points, though showing that
L*zeta(s)=1 symbolically as well would be very nice!

Thanks for any help!
- kcrisman
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Is there anyway in SAGE to calculate the integral of bessel function?

2009-05-04 Thread David Joyner

Maybe you want the following?

sage: from scipy import special
sage: RealNumber=float
sage: special.iti0k0(1.0)[0]
1.0865210970235892

See the thread

http://groups.google.com/group/sage-support/browse_thread/thread/e344c0ccd32016f7

for more details.


On Mon, May 4, 2009 at 3:36 AM, liji.ma...@gmail.com
 wrote:
>
> Hello everyone!
> I have a question about the integral of bessel function,I can
> calculate the integral of bessel function by using Scipy lib.For
> example,scipy.special.iti0k0(x)[0] means the integral of besseli(0, x)
> from 0 to x.Is there any function like scipy.special.iti0k0(x)[0] in
> the SAGE?
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: outdated version of Sage in Ubuntu 9.04

2009-05-04 Thread mabshoff



On May 4, 2:51 am, "ma...@mendelu.cz"  wrote:
> On 4 Kvě, 11:29, mabshoff 
> wrote:

Hi,

>
>
> > I would suggest you complain in the Maxima group to have them take a
> > stake into packaging current Maxima releases for Debian/Ubuntu. AFAIK
> > the Maxima maintainer for Debian isn't exactly underworked, so I am
> > sure he could use some help.
>
> Hello, not related to Sage, but if I remember correctly, newer Maxima
> is in Debian Sid (compiled with GCL). This Sid version is slower than
> 5.13 (with GCL also).

Do you have any idea why that is and how much slowdown there is? What
specifically is slower? Might this be due to the rather small RAM
footprint of the server?

The reason Sage did not upgrade to Maxima 5.17.x was due to various
new problems that cropped up in that Maxima release. I am not sure how
5.18.x fares, but AFAIK the current ecl release has test suite
failures due to disagreements about float behavior (according to the
emails I read on the Maxima list), but my memory could be wrong here.
In either case, if Maxima 5.18.1 does not pass its test suite with the
current ecl release Sage will not upgrade.

> New version can be compiled and installed using checkinstall also from
> sources easily (tested on debian with cmuml and clisp - again much
> slower than maxima 5.13 - tested on a very small server with 125 MB
> RAM)
>
> You can install this Sid package also into Lenny.
>
> see alsohttp://packages.debian.org/cs/sid/i386/maxima
>
> Robert

Cheers,

Michael
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: outdated version of Sage in Ubuntu 9.04

2009-05-04 Thread ma...@mendelu.cz



On 4 Kvě, 11:29, mabshoff 
wrote:

>
> I would suggest you complain in the Maxima group to have them take a
> stake into packaging current Maxima releases for Debian/Ubuntu. AFAIK
> the Maxima maintainer for Debian isn't exactly underworked, so I am
> sure he could use some help.
>

Hello, not related to Sage, but if I remember correctly, newer Maxima
is in Debian Sid (compiled with GCL). This Sid version is slower than
5.13 (with GCL also).
New version can be compiled and installed using checkinstall also from
sources easily (tested on debian with cmuml and clisp - again much
slower than maxima 5.13 - tested on a very small server with 125 MB
RAM)

You can install this Sid package also into Lenny.

see also http://packages.debian.org/cs/sid/i386/maxima

Robert

> > Yours,
> > C. Saratchand
>
> Cheers,
>
> Michael
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: outdated version of Sage in Ubuntu 9.04

2009-05-04 Thread mabshoff



On May 4, 2:16 am, chand sarat  wrote:
> Dear All,

Hi,

> It is a fact that for a number of scientific packages, Ubuntu does offer
> fairly outdated packages:
> 1. Current Sage package: 3.4.1 and the version offered by Ubuntu 9.04 is
> Sage 3.0.5.

Help is on the way: Debian experimental should soon have Sage 4.0.x -
see http://wiki.sagemath.org/debian/sage-4.0.x-in-experimental - that
won't help Ubuntu 9.04, but I seriously doubt that either Debian or
Ubuntu will ever ship the current stable Sage release.

We provide binaries, but not debs for various Debian and Ubuntu
releases. But I don't see them being integrated in any clean way into
the system, i.e. if we provide Ubuntu deb packages they would install
into /opt and not use anything from the system.

> 2. Current Maxima package: 5.18. and the version offered by Ubuntu 9.04 is
> Maxima 5.13.

This isn't the problem of the Sage project and out of scope.

> 3. Current Texlive package: 2008 and the version offered by Ubuntu 9.04 is
> Texlive 2007.

That is not our concern and has nothing to do with Sage.

> It seems to be that Canonical's key focus is to provide a set of up to date
> packages including office packages (openoffice.org), web browser (firefox)
> etc. while the up-tpdateness of scientific packages are more volunteer
> dependent.

Well, complain to the Ubuntu people :)

> In the case of Maxima, Istvan Blahota 
> (http://zeus.nyf.hu/~blahota/maxima/jaunty/) has compiled deb packages for
> Ubuntu 9.04 conforming to the the latest version of Maxima namely 5.18 for
> both i386 and amd64 architectures; moreover each of them has been compiled
> with both CLisp and SBCL.
> It would be great if someone from the Sage team can do the same for Ubuntu
> i.e. provide deb packages of the latest version of Sage for both i386 and
> amd64 architectures.

I would suggest you complain in the Maxima group to have them take a
stake into packaging current Maxima releases for Debian/Ubuntu. AFAIK
the Maxima maintainer for Debian isn't exactly underworked, so I am
sure he could use some help.

> Yours,
> C. Saratchand

Cheers,

Michael
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] outdated version of Sage in Ubuntu 9.04

2009-05-04 Thread chand sarat
Dear All,
It is a fact that for a number of scientific packages, Ubuntu does offer
fairly outdated packages:
1. Current Sage package: 3.4.1 and the version offered by Ubuntu 9.04 is
Sage 3.0.5.
2. Current Maxima package: 5.18. and the version offered by Ubuntu 9.04 is
Maxima 5.13.
3. Current Texlive package: 2008 and the version offered by Ubuntu 9.04 is
Texlive 2007.
It seems to be that Canonical's key focus is to provide a set of up to date
packages including office packages (openoffice.org), web browser (firefox)
etc. while the up-tpdateness of scientific packages are more volunteer
dependent.
In the case of Maxima, Istvan Blahota (
http://zeus.nyf.hu/~blahota/maxima/jaunty/) has compiled deb packages for
Ubuntu 9.04 conforming to the the latest version of Maxima namely 5.18 for
both i386 and amd64 architectures; moreover each of them has been compiled
with both CLisp and SBCL.
It would be great if someone from the Sage team can do the same for Ubuntu
i.e. provide deb packages of the latest version of Sage for both i386 and
amd64 architectures.
Yours,
C. Saratchand

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Sage in Ubuntu 9.04

2009-05-04 Thread Serge A. Salamanka

Hi,
This is great to hear about.
I have created a blog this night.
http://sageworldmath.blogspot.com/

Will be posting my experience with SAGE. I also run KUBUNTU 8.04 and
might add some documentation to the page you provided.

I suppose it is still better to compile latest version of SAGE rather
than install outdated one. But the docs will be useful in terms of
configuration and installation of SAGE on UBUNTU.

Regards,

Serge A. Salamanka


saratchand пишет:
> Dear Sage Community,
> You are aware that Sage has been included in Ubuntu 9.04. I have
> created a
> Ubuntu community documentation page for Sage at:
> https://help.ubuntu.com/community/SAGE
> It was a rush job at best, by someone whose interest in Sage sprung
> from the
> possibility of using Sage to run Maxima.
> I request someone from the Sage team to clean up the Ubuntu community
> documentation page for Sage and also make it known widely that Sage is
> available from Ubuntu 9.04; in case this has not been done as yet.
> Yours,
> C. Saratchand
> 
> > 
> 

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: GAP still doesn't start in sage-3.4.1...

2009-05-04 Thread Johan Oudinet

On Sat, May 2, 2009 at 10:29 AM, William Stein  wrote:
>
>
> Is there enough space so you could try doing everything in /tmp or
> /local or some other *non*-NSF local partition?
>

I've just tried in /tmp and got exactly the same error. the log is
available here:
http://www.lri.fr/~oudinet/pub/debiansage3.log

-- 
Johan
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: click on Sage icon to get terminal session

2009-05-04 Thread mabshoff



On May 4, 12:40 am, Minh Nguyen  wrote:
> Hi folks,
>
> I received the following question from my blog post at
>
> http://mvngu.wordpress.com/2009/03/22/clickable-mac-os-x-app-for-sage...
>
> I thought it's more appropriate as a sage-support question.
>
> > I have built the dmg package as described. Everything is ok. When I double 
> > click on
> > sage icon opens the notebook. It is possible to click on sage icon and run 
> > sage on Terminal?
> > Thank you for your attention.

It isn't possible at the moment since we made the decision to start
the notebook per default. The script that creates the app bundle can
be changed to execute Sage in a terminal though.

Cheers,

Michael

> --
> Regards
> Minh Van Nguyen
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] click on Sage icon to get terminal session

2009-05-04 Thread Minh Nguyen

Hi folks,

I received the following question from my blog post at

http://mvngu.wordpress.com/2009/03/22/clickable-mac-os-x-app-for-sage-34/

I thought it's more appropriate as a sage-support question.

> I have built the dmg package as described. Everything is ok. When I double 
> click on
> sage icon opens the notebook. It is possible to click on sage icon and run 
> sage on Terminal?
> Thank you for your attention.

-- 
Regards
Minh Van Nguyen

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Is there anyway in SAGE to calculate the integral of bessel function?

2009-05-04 Thread liji.ma...@gmail.com

Hello everyone!
I have a question about the integral of bessel function,I can
calculate the integral of bessel function by using Scipy lib.For
example,scipy.special.iti0k0(x)[0] means the integral of besseli(0, x)
from 0 to x.Is there any function like scipy.special.iti0k0(x)[0] in
the SAGE?

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---