[sage-support] Re: Help me out from PolynomialRing Error!

2009-04-28 Thread simon . king

Dear Sajan.S,

On Apr 28, 6:31 am, "Sajan.S"  wrote:
> Dear sir,
>
> P.< y0, y1, x0, x1> = PolynomialRing(GF(3),4,order='lex');
>
> is working in interactive python shell.
>
> but not working in python script file executed at command prompt

This is because the interactive shell has a preparser. Here you can
see what the preparser returns when you type your command in the
interactive shell:

sage: preparse("P.< y0, y1, x0, x1> = PolynomialRing(GF(3),
4,order='lex')")
"P = PolynomialRing(GF(Integer(3)),Integer(4),order='lex', names=
('y0', 'y1', 'x0', 'x1',)); (y0, y1, x0, x1,) = P._first_ngens(4)"

Python only sees the output of the preparser. In your script, you can
provide this output, and it will work.

Best regards,
 Simon
--~--~-~--~~~---~--~~
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] Help me out from PolynomialRing Error!

2009-04-28 Thread Sajan.S

Dear sir,

P.< y0, y1, x0, x1> = PolynomialRing(GF(3),4,order='lex');

is working in interactive python shell.

but not working in python script file executed at command prompt

Error Message is:

Code:
  File "test.py", line 10
P.< y0, y1, y2, x0, x1, x2> = PolynomialRing(GF(2),
6,order='lex');
  ^
SyntaxError: invalid syntax

Please help me out, by suggesting an alternative quickfix for the
problem.

Thanks & Regards,
Sajan.S

--~--~-~--~~~---~--~~
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] GAP still doesn't start in sage-3.4.1...

2009-04-28 Thread Johan Oudinet

Hi,

I saw in trac that the ticket about my problem to start Sage in a
Debian Lenny 64bit is closed since GAP was downgraded.

I thought Sage-3.4.1 should now works on my server... but it still
doesn't. And the problem is still the same. When I run sage for the
first time, I got:
*
RuntimeError: Unable to start gap because the command 'gap -r -b -p -T
-o G 
/users/asspro/oudinet/projects/sage-3.4.1-linux-Debian_GNU_Linux_5.0_lenny-sse2-x86_64-Linux/data//extcode/gap/sage.g'
failed.

Error importing ipy_profile_sage - perhaps you should run %upgrade?
WARNING: Loading of ipy_profile_sage failed.
*

Any clue?

-- 
Johan

--~--~-~--~~~---~--~~
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] differential equations in SAGE

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

Dear SAGE experts,

from the output of desolve?? command I understand that desolve call
maxima and ode2 to solve ordinary differential equations.

1. How can I get the access to method variable?

commands

maxima("ode2('diff(y,x)=x^6*cos(y),y,x)")
maxima('method')

give the answer "separable", but the code


y = function('y', x)
A=desolve(diff(y,x) == x^2*y^2, y)
B=desolve(diff(y,x) == x*y+5, y)
show(A)
print(type(A))
print(maxima('method'))
show(B)
print(type(B))
print(maxima('method'))

does not work (prints "method" if called for the first time and
"separable", if called after the first group of commands)



2. Another observation: if the equation is linear or Bernoulli, the
solution of ODE is of the type , if the equation is
separable or homogeneous, the solution is
. I think, we should
get the same type of the answer in both cases. Is this a bug?

Thank you for your comments and suggestions
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: differential equations in SAGE

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



On 28 Dub, 15:42, "ma...@mendelu.cz"  wrote:
> Dear SAGE experts,
>

forgot to write: the test notebook for these issues is at
http://www.sagenb.org/home/pub/494/

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: Help me out from PolynomialRing Error!

2009-04-28 Thread William Stein

On Tue, Apr 28, 2009 at 3:14 AM,   wrote:
>
> Dear Sajan.S,
>
> On Apr 28, 6:31 am, "Sajan.S"  wrote:
>> Dear sir,
>>
>> P.< y0, y1, x0, x1> = PolynomialRing(GF(3),4,order='lex');
>>
>> is working in interactive python shell.
>>
>> but not working in python script file executed at command prompt

You could also try naming your script  something.sage, then loading it
into sage using

   sage: load something.sage

William

>
> This is because the interactive shell has a preparser. Here you can
> see what the preparser returns when you type your command in the
> interactive shell:
>
> sage: preparse("P.< y0, y1, x0, x1> = PolynomialRing(GF(3),
> 4,order='lex')")
> "P = PolynomialRing(GF(Integer(3)),Integer(4),order='lex', names=
> ('y0', 'y1', 'x0', 'x1',)); (y0, y1, x0, x1,) = P._first_ngens(4)"
>
> Python only sees the output of the preparser. In your script, you can
> provide this output, and it will work.
>
> Best regards,
>     Simon
> >
>



-- 
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] weird output in notebook (on jaunty installation via debs)

2009-04-28 Thread Jurgis Pralgauskis

Hello,

I have sage on fresh Ubuntu jaunty,
 SAGE Version 3.0.5, Release Date: 2008-07-11

but when I use notebook, I get unnecessary  output
and line endings of it seem like have encoding problems..

you see the screenshot..
http://files.akl.lt/users/jurgis/etc/sagemath-jaunty-weird_output.png

where's the rub?
--~--~-~--~~~---~--~~
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: weird output in notebook (on jaunty installation via debs)

2009-04-28 Thread William Stein

On Tue, Apr 28, 2009 at 7:12 AM, Jurgis Pralgauskis
 wrote:
>
> Hello,
>
> I have sage on fresh Ubuntu jaunty,
>  SAGE Version 3.0.5, Release Date: 2008-07-11
>
> but when I use notebook, I get unnecessary  output
> and line endings of it seem like have encoding problems..
>
> you see the screenshot..
> http://files.akl.lt/users/jurgis/etc/sagemath-jaunty-weird_output.png
>
> where's the rub?

Hi,

Unfortunately, Debian/Ubuntu package a very old and buggy version of
Sage.You should use a version of Sage that you download from
http://sagemath.org instead.  Get either a binary, or build from
source.

Thanks!
William

-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://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] substituting initial condition into ODE

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

Dear memebers of SAGE-support

I wonder if it is possible to substitute initial conditions into an
equation produced by desolve. I tried something like

y=function('y',x)
desolve(diff(y,x)+sin(x)*y^6==0,y)
sol({x:pi,y:9})

and got

1/(5*y(pi)^5) == c + 1


but I would like to see


1/(5*9^5) == c + 1

many thanks

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: substituting initial condition into ODE

2009-04-28 Thread David Joyner

I don't know if you are asking about how to use ICs in
desolve or if you are asking about how to do substitutions.
Anyway, I get this:


sage: y=function('y',x)
sage: desolve(diff(y,x)+sin(x)*y^6==0,y)
1/(5*y(x)^5) == c - cos(x)
sage: desolve(diff(y,x)+sin(x)*y^6==0,y,[pi,9])
1/(5*y(x)^5) == (-295245*cos(x) - 295244)/295245


Does that help?


On Tue, Apr 28, 2009 at 10:36 AM, ma...@mendelu.cz  wrote:
>
> Dear memebers of SAGE-support
>
> I wonder if it is possible to substitute initial conditions into an
> equation produced by desolve. I tried something like
>
> y=function('y',x)
> desolve(diff(y,x)+sin(x)*y^6==0,y)
> sol({x:pi,y:9})
>
> and got
>
> 1/(5*y(pi)^5) == c + 1
>
>
> but I would like to see
>
>
> 1/(5*9^5) == c + 1
>
> many thanks
>
> 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: sage error 6520

2009-04-28 Thread Mikie

Yes, I recompiled it and it works.  It took 7 hours on the P4.

On Apr 27, 9:53 am, Mikie  wrote:
> Hi,
>
> I just put Sage3.4.1 on and I am getting "line 198: 3626 Illegral
> instruction sage-ip0ython "#@" -i.".  Do you think I should get the
> source and recompile it?
> Mikie
>
> On Apr 25, 1:01 am, mabshoff 
>
>
> dortmund.de> wrote:
> > On Apr 24, 2:55 pm, mabshoff 
> > dortmund.de> wrote:
>
> > Hi,
>
> > > Sage 3.4.1 which binaries I should post in the next couple hours has
> > > been build to use only SSE2, so that one should work for you.
>
> > Who would have thought, but it took longer than planned. Anyway, 32 as
> > well as 64 bit SSE2 only Centos binaries are in
>
> >  http://www.sagemath.org/bin/linux/
>
> > > Cheers,
>
> > > Michael
>
> > Cheers,
>
> > Michael- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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: substituting initial condition into ODE

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

Hello, I just want to test, if I can do with my students in computer
lab what they usualy do on the paper

1. find general solution
2. substitute from initail conditions
3. find c
4. use this c in general solution

I agree that this may be strange to do this in the case, we have a
command for solving IVP.
I just wanted to know, if it is possible to substitute some value for y
(x), if y(x) is declared as a function.

Thanks. Robert

On 28 Dub, 16:45, David Joyner  wrote:
> I don't know if you are asking about how to use ICs in
> desolve or if you are asking about how to do substitutions.
> Anyway, I get this:
>
> sage: y=function('y',x)
> sage: desolve(diff(y,x)+sin(x)*y^6==0,y)
> 1/(5*y(x)^5) == c - cos(x)
> sage: desolve(diff(y,x)+sin(x)*y^6==0,y,[pi,9])
> 1/(5*y(x)^5) == (-295245*cos(x) - 295244)/295245
>
> Does that help?
>
> On Tue, Apr 28, 2009 at 10:36 AM, ma...@mendelu.cz  wrote:
>
> > Dear memebers of SAGE-support
>
> > I wonder if it is possible to substitute initial conditions into an
> > equation produced by desolve. I tried something like
>
> > y=function('y',x)
> > desolve(diff(y,x)+sin(x)*y^6==0,y)
> > sol({x:pi,y:9})
>
> > and got
>
> > 1/(5*y(pi)^5) == c + 1
>
> > but I would like to see
>
> > 1/(5*9^5) == c + 1
>
> > many thanks
>
> > 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: weird output in notebook (on jaunty installation via debs)

2009-04-28 Thread Jurgis Pralgauskis


> Unfortunately, Debian/Ubuntu package a very old and buggy version of
> Sage.    You should use a version of Sage that you download 
> fromhttp://sagemath.orginstead.  Get either a binary, or build from
> source.

why are debs not updated?
I don't know much about them, and as I remember main packaging is
"spkg",
would it be hard to automate transformationt to debs?
this would mean more courage for sysadmins towards sage (as updates
would be supposed to be without headache :) )

--~--~-~--~~~---~--~~
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: weird output in notebook (on jaunty installation via debs)

2009-04-28 Thread William Stein

On Tue, Apr 28, 2009 at 11:34 AM, Jurgis Pralgauskis
 wrote:
>
>
>> Unfortunately, Debian/Ubuntu package a very old and buggy version of
>> Sage.    You should use a version of Sage that you download 
>> fromhttp://sagemath.orginstead.  Get either a binary, or build from
>> source.
>
> why are debs not updated?
> I don't know much about them, and as I remember main packaging is
> "spkg",
> would it be hard to automate transformationt to debs?
> this would mean more courage for sysadmins towards sage (as updates
> would be supposed to be without headache :) )

Please see:

http://wiki.sagemath.org/faq/bigsagerant

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: substituting initial condition into ODE

2009-04-28 Thread David Joyner

Too tricky, but maybe this helps:

sage: c,x = var("c,x")
sage: y = function('y',x)
sage: soln = desolve(diff(y,x)+sin(x)*y^6==0,y); soln
1/(5*y(x)^5) == c - cos(x)
sage: soln.subs(x = pi)
1/(5*y(pi)^5) == c + 1
sage: ssoln = soln.__repr__(); ssoln
'1/(5*y(x)^5) == c - cos(x)'
sage: ssoln = ssoln.replace("y(x)","9"); ssoln
'1/(5*9^5) == c - cos(x)'
sage: ssoln = ssoln.replace("x","pi"); ssoln
'1/(5*9^5) == c - cos(pi)'
sage: nsoln = eval(ssoln)
sage: nsoln
c + 1 == 0

Hopefully there are better ways.

Using SymPy:

sage: x = Symbol('x')
sage: C1 = Symbol('C1')
sage: y = Function('y')
sage: soln = dsolve(Derivative(y(x),x)+sin(x)*y(x)^6,y(x)); soln
(C1 - 5*cos(x))**(-1/5)
sage: ypi = soln.subs(x,pi); ypi
(5 + C1)**(-1/5)

But now

sage: solve(ypi - 9, C1)

yields an error which I don't understand.


On Tue, Apr 28, 2009 at 1:59 PM, ma...@mendelu.cz  wrote:
>
> Hello, I just want to test, if I can do with my students in computer
> lab what they usualy do on the paper
>
> 1. find general solution
> 2. substitute from initail conditions
> 3. find c
> 4. use this c in general solution
>
> I agree that this may be strange to do this in the case, we have a
> command for solving IVP.
> I just wanted to know, if it is possible to substitute some value for y
> (x), if y(x) is declared as a function.
>
> Thanks. Robert
>
> On 28 Dub, 16:45, David Joyner  wrote:
>> I don't know if you are asking about how to use ICs in
>> desolve or if you are asking about how to do substitutions.
>> Anyway, I get this:
>>
>> sage: y=function('y',x)
>> sage: desolve(diff(y,x)+sin(x)*y^6==0,y)
>> 1/(5*y(x)^5) == c - cos(x)
>> sage: desolve(diff(y,x)+sin(x)*y^6==0,y,[pi,9])
>> 1/(5*y(x)^5) == (-295245*cos(x) - 295244)/295245
>>
>> Does that help?
>>
>> On Tue, Apr 28, 2009 at 10:36 AM, ma...@mendelu.cz  wrote:
>>
>> > Dear memebers of SAGE-support
>>
>> > I wonder if it is possible to substitute initial conditions into an
>> > equation produced by desolve. I tried something like
>>
>> > y=function('y',x)
>> > desolve(diff(y,x)+sin(x)*y^6==0,y)
>> > sol({x:pi,y:9})
>>
>> > and got
>>
>> > 1/(5*y(pi)^5) == c + 1
>>
>> > but I would like to see
>>
>> > 1/(5*9^5) == c + 1
>>
>> > many thanks
>>
>> > 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] RSACryptosystem in Cryptography book (by Kohel) is ghost :? + small typo

2009-04-28 Thread Jurgis Pralgauskis

Hello,

just trying to follow examples of http://www.sagemath.org/library/crypto.pdf
Exercise 8.5 solution: page nr 124  (or 127 for file) has suspicious
code

sage: E := RSACryptosystem(128)
sage: m = E.encoding(’The dog ate my lunch.’); m

first of all typo of assignment (seems like in Pascal)

then no such Class/method seems to exists -- not a big problem, but
just curiuous what happend to it..


In advance Thanks for explanations :)
--~--~-~--~~~---~--~~
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] scipy.stats.poisson.pmf doesn't work

2009-04-28 Thread Alden

On two different computers running Ubuntu 9.04, I downloaded and built
from source sage 3.4.1.  I also downloaded scipy using the synaptic
package manager.  I am under the impression that python and scipy in
sage lead completely separate lives from python and scipy outside
sage.  In normal python (i.e. running python from the command line),
the following works fine:

Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy.stats
>>> scipy.stats.poisson.pmf(5,1)
0.00306566200976202

But when I run sage, I get the following:
--
| Sage Version 3.4.1, Release Date: 2009-04-21   |
| Type notebook() for the GUI, and license() for information.|
--
sage: import scipy.stats
sage: scipy.stats.poisson.pmf(5,1)
---
TypeError Traceback (most recent call
last)

/home/awalker/sage-3.4.1/ in ()

/home/awalker/sage-3.4.1/local/lib/python2.5/site-packages/scipy/stats/
distributions.pyc in pmf(self, k, *args, **kwds)
   3517 output = zeros(shape(cond),'d')
   3518 place(output,(1-cond0)*(cond1==cond1),self.badvalue)
-> 3519 goodargs = argsreduce(cond, *((k,)+args))
   3520 place(output,cond,self._pmf(*goodargs))
   3521 return output

/home/awalker/sage-3.4.1/local/lib/python2.5/site-packages/scipy/stats/
distributions.pyc in argsreduce(cond, *args)
237 # make sure newarr is not a scalar
238 newarr = atleast_1d(args[k])
--> 239 newargs[k] = extract(cond,newarr*expand_arr)
240 return newargs
241

TypeError: unsupported operand type(s) for *: 'numpy.ndarray' and
'numpy.bool_'
--~--~-~--~~~---~--~~
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: scipy.stats.poisson.pmf doesn't work

2009-04-28 Thread Mike Hansen

Hello,

On Tue, Apr 28, 2009 at 12:29 PM, Alden  wrote:
>
> On two different computers running Ubuntu 9.04, I downloaded and built
> from source sage 3.4.1.  I also downloaded scipy using the synaptic
> package manager.  I am under the impression that python and scipy in
> sage lead completely separate lives from python and scipy outside
> sage.  In normal python (i.e. running python from the command line),
> the following works fine:

This is correct.

> sage: import scipy.stats
> sage: scipy.stats.poisson.pmf(5,1)

When you type this, what get sent to Sage is the output of

sage: preparse('scipy.stats.poisson.pmf(5,1)')
'scipy.stats.poisson.pmf(Integer(5),Integer(1))'

Numpy/Scipy don't know how to deal with Sage's Integer class.  You can
get around this in a number of ways:

1) Use the "r" notation for "raw" Python ints:

sage: preparse('scipy.stats.poisson.pmf(5r,1r)')
'scipy.stats.poisson.pmf(5,1)'
sage: scipy.stats.poisson.pmf(5r,1r)
array(0.00306566200976202)

2) Explicitly make ints:

sage: scipy.stats.poisson.pmf(int(5),int(1))
array(0.00306566200976202)

3) Turn off the preparser:

sage: preparser(False)
sage: scipy.stats.poisson.pmf(5,1)
array(0.00306566200976202)
sage: preparser(True)

4) Set Integer to be int (and RealNumber to be Float):

sage: Integer = int
sage: RealNumber = float
sage: scipy.stats.poisson.pmf(5,1)
array(0.00306566200976202)

--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: scipy.stats.poisson.pmf doesn't work

2009-04-28 Thread William Stein

On Tue, Apr 28, 2009 at 12:29 PM, Alden  wrote:
>
> On two different computers running Ubuntu 9.04, I downloaded and built
> from source sage 3.4.1.  I also downloaded scipy using the synaptic
> package manager.  I am under the impression that python and scipy in
> sage lead completely separate lives from python and scipy outside
> sage.

True.

>  In normal python (i.e. running python from the command line),
> the following works fine:

This will evidently get fixed when we upgrade the version of scipy
included in Sage, which we
hope to do soon.

>
> Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41)
> [GCC 4.3.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
 import scipy.stats
 scipy.stats.poisson.pmf(5,1)
> 0.00306566200976202
>
> But when I run sage, I get the following:
> --
> | Sage Version 3.4.1, Release Date: 2009-04-21                       |
> | Type notebook() for the GUI, and license() for information.        |
> --
> sage: import scipy.stats
> sage: scipy.stats.poisson.pmf(5,1)
> ---
> TypeError                                 Traceback (most recent call
> last)
>
> /home/awalker/sage-3.4.1/ in ()
>
> /home/awalker/sage-3.4.1/local/lib/python2.5/site-packages/scipy/stats/
> distributions.pyc in pmf(self, k, *args, **kwds)
>   3517         output = zeros(shape(cond),'d')
>   3518         place(output,(1-cond0)*(cond1==cond1),self.badvalue)
> -> 3519         goodargs = argsreduce(cond, *((k,)+args))
>   3520         place(output,cond,self._pmf(*goodargs))
>   3521         return output
>
> /home/awalker/sage-3.4.1/local/lib/python2.5/site-packages/scipy/stats/
> distributions.pyc in argsreduce(cond, *args)
>    237         # make sure newarr is not a scalar
>    238         newarr = atleast_1d(args[k])
> --> 239         newargs[k] = extract(cond,newarr*expand_arr)
>    240     return newargs
>    241
>
> TypeError: unsupported operand type(s) for *: 'numpy.ndarray' and
> 'numpy.bool_'
> >
>



-- 
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: scipy.stats.poisson.pmf doesn't work

2009-04-28 Thread William Stein

On Tue, Apr 28, 2009 at 12:35 PM, William Stein  wrote:
> On Tue, Apr 28, 2009 at 12:29 PM, Alden  wrote:
>>
>> On two different computers running Ubuntu 9.04, I downloaded and built
>> from source sage 3.4.1.  I also downloaded scipy using the synaptic
>> package manager.  I am under the impression that python and scipy in
>> sage lead completely separate lives from python and scipy outside
>> sage.
>
> True.
>
>>  In normal python (i.e. running python from the command line),
>> the following works fine:
>
> This will evidently get fixed when we upgrade the version of scipy
> included in Sage, which we
> hope to do soon.
>

Mike's solution is right and my remark isn't.  I had tested resetting
Integer by doing the following
in a notebook cell:

{{{
RealNumber=float; Integer=int
import scipy.stats
scipy.stats.poisson.pmf(5,1)
}}}

However, stupidly Integer=int gets evaluated after the constant 5 gets
factored out.  This would have worked

{{{
RealNumber=float; Integer=int
}}}

{{{
import scipy.stats
scipy.stats.poisson.pmf(5,1)
}}}

We *really* need to patch scipy.stats so that this fixed...

 -- 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: scipy.stats.poisson.pmf doesn't work

2009-04-28 Thread Alden

Thanks!

On Apr 28, 12:29 pm, Alden  wrote:
> On two different computers running Ubuntu 9.04, I downloaded and built
> from source sage 3.4.1.  I also downloaded scipy using the synaptic
> package manager.  I am under the impression that python and scipy in
> sage lead completely separate lives from python and scipy outside
> sage.  In normal python (i.e. running python from the command line),
> the following works fine:
>
> Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41)
> [GCC 4.3.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.>>> 
> import scipy.stats
> >>> scipy.stats.poisson.pmf(5,1)
>
> 0.00306566200976202
>
> But when I run sage, I get the following:
> --
> | Sage Version 3.4.1, Release Date: 2009-04-21                       |
> | Type notebook() for the GUI, and license() for information.        |
> --
> sage: import scipy.stats
> sage: scipy.stats.poisson.pmf(5,1)
> ---
> TypeError                                 Traceback (most recent call
> last)
>
> /home/awalker/sage-3.4.1/ in ()
>
> /home/awalker/sage-3.4.1/local/lib/python2.5/site-packages/scipy/stats/
> distributions.pyc in pmf(self, k, *args, **kwds)
>    3517         output = zeros(shape(cond),'d')
>    3518         place(output,(1-cond0)*(cond1==cond1),self.badvalue)
> -> 3519         goodargs = argsreduce(cond, *((k,)+args))
>    3520         place(output,cond,self._pmf(*goodargs))
>    3521         return output
>
> /home/awalker/sage-3.4.1/local/lib/python2.5/site-packages/scipy/stats/
> distributions.pyc in argsreduce(cond, *args)
>     237         # make sure newarr is not a scalar
>     238         newarr = atleast_1d(args[k])
> --> 239         newargs[k] = extract(cond,newarr*expand_arr)
>     240     return newargs
>     241
>
> TypeError: unsupported operand type(s) for *: 'numpy.ndarray' and
> 'numpy.bool_'
--~--~-~--~~~---~--~~
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: scipy.stats.poisson.pmf doesn't work

2009-04-28 Thread Jason Grout

William Stein wrote:

> 
>>  In normal python (i.e. running python from the command line),
>> the following works fine:
> 
> This will evidently get fixed when we upgrade the version of scipy
> included in Sage, which we
> hope to do soon.


Are you saying this is already fixed in scipy (i.e., a new scipy will 
recognize sage numbers)?

Thanks,

Jason


-- 
Jason Grout


--~--~-~--~~~---~--~~
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: scipy.stats.poisson.pmf doesn't work

2009-04-28 Thread William Stein

No.

On 4/28/09, Jason Grout  wrote:
>
> William Stein wrote:
>
>>
>>>  In normal python (i.e. running python from the command line),
>>> the following works fine:
>>
>> This will evidently get fixed when we upgrade the version of scipy
>> included in Sage, which we
>> hope to do soon.
>
>
> Are you saying this is already fixed in scipy (i.e., a new scipy will
> recognize sage numbers)?
>
> Thanks,
>
> Jason
>
>
> --
> Jason Grout
>
>
> >
>


-- 
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: snapshot saving

2009-04-28 Thread William Stein

On Tue, Apr 28, 2009 at 1:45 PM, Franco Saliola  wrote:
> On Mon, Apr 27, 2009 at 9:07 PM, William Stein  wrote:
>>
>> On Mon, Apr 27, 2009 at 11:45 AM, Jason Grout
>>  wrote:
>>>
>>> William Stein wrote:
 On Mon, Apr 27, 2009 at 11:29 AM, kcrisman  wrote:
> Just as a postscript, I was really glad to have the autosave a few
> minute ago, where I nearly deleted an entire lecture's worth of notes
> and computations which I hadn't saved, by accidentally brushing
> against a browser shortcut to a "favorites" page on the wrong window.
> (This could happen with "reload" or other shortcuts, too, I suspect.)
> When I used the browser "back" button, I had literally nothing, but
> the autosave had captured my previous revision!

 You could have just pressed reload and you would have had your
 worksheet back entirely.   It was still sitting there on the server in
 RAM.   Never use the back button with the sage notebook, unless you
 immediately press refresh.

>>>
>>> Tom or some other javascript ninja:
>>>
>>> Isn't there some sort of javascript that disables the back button?
>>> That's a common problem in web applications, and I'd be very surprised
>>> if it isn't a solved problem already.
>>>
>>> Jason
>>>
>>
>> Not, there is no javascript to do that.  Also, disabling the back
>> button is irrelevant to the above problem, which would only have been
>> prevented by disabling being able to leave the page by clicking on a
>> favorites.   There is javascript to attempt to prevent users from
>> leaving pages -- lots of spam sites use it.  Of course it doesn't work
>> well though, and is often extremely annoying.
>
> I am using GMail. I hit reply. I typed this. Now I am going to hit the
> browser's back button...
>
> I'm still here. So Google can do it.

They did not disable the back button.  They are calling a javascript
function on leaving the page, which could be via the back button,
clicking a link, etc. The Sage notebook could also popup a dialog when
you try to leave a worksheet page.

> It presented me with a warning:
>
>    Your draft has been modified.
>
>    Abandon changes?
>
> See the attached screenshot.
>
> Franco
>
> --
>
> >
>



-- 
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] pretty print in notebook

2009-04-28 Thread Mikie

I have sage working on a PC in my network.  And it comes great.  When
set "pretty print" and do an integral it gives an error shows Latex.
How do I get the pretty print.  I am using CentOS and Firefox.

--~--~-~--~~~---~--~~
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: snapshot saving

2009-04-28 Thread Franco Saliola

Franco

--



On Tue, Apr 28, 2009 at 11:22 PM, William Stein  wrote:
>
> On Tue, Apr 28, 2009 at 1:45 PM, Franco Saliola  wrote:
>> On Mon, Apr 27, 2009 at 9:07 PM, William Stein  wrote:
>>>
>>> On Mon, Apr 27, 2009 at 11:45 AM, Jason Grout
>>>  wrote:

 William Stein wrote:
> On Mon, Apr 27, 2009 at 11:29 AM, kcrisman  wrote:
>> Just as a postscript, I was really glad to have the autosave a few
>> minute ago, where I nearly deleted an entire lecture's worth of notes
>> and computations which I hadn't saved, by accidentally brushing
>> against a browser shortcut to a "favorites" page on the wrong window.
>> (This could happen with "reload" or other shortcuts, too, I suspect.)
>> When I used the browser "back" button, I had literally nothing, but
>> the autosave had captured my previous revision!
>
> You could have just pressed reload and you would have had your
> worksheet back entirely.   It was still sitting there on the server in
> RAM.   Never use the back button with the sage notebook, unless you
> immediately press refresh.
>

 Tom or some other javascript ninja:

 Isn't there some sort of javascript that disables the back button?
 That's a common problem in web applications, and I'd be very surprised
 if it isn't a solved problem already.

 Jason

>>>
>>> Not, there is no javascript to do that.  Also, disabling the back
>>> button is irrelevant to the above problem, which would only have been
>>> prevented by disabling being able to leave the page by clicking on a
>>> favorites.   There is javascript to attempt to prevent users from
>>> leaving pages -- lots of spam sites use it.  Of course it doesn't work
>>> well though, and is often extremely annoying.
>>
>> I am using GMail. I hit reply. I typed this. Now I am going to hit the
>> browser's back button...
>>
>> I'm still here. So Google can do it.
>
> They did not disable the back button.  They are calling a javascript
> function on leaving the page, which could be via the back button,
> clicking a link, etc. The Sage notebook could also popup a dialog when
> you try to leave a worksheet page.

Right, sorry. I misunderstood and didn't realize that the goal was to
disable the back button.

I think it might be a good idea to pop-up a dialog when one tries to
leave a worksheet if it hasn't been saved.

Franco

--

--~--~-~--~~~---~--~~
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] callable symbolic function name to string

2009-04-28 Thread Alex Raichev

Hi all:

How do you retrieve the name of a callable symbolic function as a
string?  For instance, suppose you have

sage: f= function('hello',x)

and you want to retrieve 'hello' from f.

sage: str(f)
'\n   hello(x)'

followed by stripping away the extra characters works, but is there a
more direct approach?

Alex
--~--~-~--~~~---~--~~
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: callable symbolic function name to string

2009-04-28 Thread Craig Citro

There's probably a better way, but this works:

sage: f = function('hello',x)
sage: f._f._name
'hello'

(That's just what f._repr_() uses.)

-cc

On Tue, Apr 28, 2009 at 8:30 PM, Alex Raichev  wrote:
>
> Hi all:
>
> How do you retrieve the name of a callable symbolic function as a
> string?  For instance, suppose you have
>
> sage: f= function('hello',x)
>
> and you want to retrieve 'hello' from f.
>
> sage: str(f)
> '\n                                   hello(x)'
>
> followed by stripping away the extra characters works, but is there a
> more direct approach?
>
> Alex
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---