[sage-support] Python Imaging Library

2008-09-16 Thread [EMAIL PROTECTED]

Hi,

I have installed Python Imaging Library (PIL) on my Linux box, I can
access it in python however I don't have access to PIL functions while
working with Sage.

My configuration: Sage 3.1.1, PIL 1.1.5, python 2.4.4

Is there any command line parameter I can pass to Sage in order to use
PIL in Sage ? Can you help me to find a solution please ?

Thanks in advance for your nice reply, have a nice day,

jerome.landre
University of Reims
France

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



[sage-support] Re: jsmath typesetting for sqrt, sin, etc.

2008-09-16 Thread hjuergens


 Do you have the jsmath TeX fonts installed?  Click on the jsmath icon
 at the bottom of the page and check to see if it says jsMath v3.5 (TeX
 fonts).  If it doesn't, that may be the problem.

 If you don't have the tex fonts, you might go 
 tohttp://www.math.union.edu/~dpvc/jsMath/download/jsMath-fonts.htmland
 download them and install them on your computer.

 Thanks,

 Jason
Thanks,
this did the trick.
Hartmut
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Python Imaging Library

2008-09-16 Thread Timothy Clemans

Sage doesn't use your system install of Python, but instead it uses
the one included in the Sage distribution.

Assuming you are building PIL from source use the command: sage
-python setup.py install

On Tue, Sep 16, 2008 at 2:56 AM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:

 Hi,

 I have installed Python Imaging Library (PIL) on my Linux box, I can
 access it in python however I don't have access to PIL functions while
 working with Sage.

 My configuration: Sage 3.1.1, PIL 1.1.5, python 2.4.4

 Is there any command line parameter I can pass to Sage in order to use
 PIL in Sage ? Can you help me to find a solution please ?

 Thanks in advance for your nice reply, have a nice day,

 jerome.landre
 University of Reims
 France

 


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



[sage-support] Re: bug with sums of matrices

2008-09-16 Thread Pierre

cool !

now look for another bizarre bug report from me in a coming thread...

On Sep 15, 7:03 pm, Craig Citro [EMAIL PROTECTED] wrote:
 Pierre,

 You'll be happy to hear that I got the following response from the
 Singular team this morning:

 =

 Hello Craig Citro,
 thanks for the bug report.
 The bug is in the gcd computation for multivariate polynomials
 over a field extension: therefore it does not show up in the case
 of univariate polynomials or if all coefficients are in Q.
 The next Singular version (3-1-0) uses a different algorithm at that place,
 which is not affected by this error.

 Hans Schoenemann

 ==

 So it looks like this will be fixed on the other end soon ...

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



[sage-support] behaviour of reduce ?

2008-09-16 Thread Pierre

hi there,

this is going to be even worse than my recent bug report in terms of
reproducing the error. I guess i'll start with describing what
happens, and then if someone tells me that it's a bug and not a
feature, then i'll try to get a minimal example.

So I've got a polynomial ring with a few dozens variables, over a
cyclotomic field, and i've got an ideal J with hundreds of generators.
J contains at least y9 + y12. Then i got something like:

sage: J.reduce(y9 - y12)
2*y9   #which is fine

sage: J.reduce(y13*y15)
y13*y15 #why not

sage: J.reduce(y13*y15 + y9 - y12)
y13*y15 + y9 - y12

Now what's up with that ? shouldn't it be y13*y15 + 2*y9 ? that's what
i expect from the term 'reduction' anyway. Is this normal or is it a
bug ? if it's a bug, could it influence the equivalence x in J iff
J.reduce(x) == 0 ?

So if this is a bug i'll give you more details.

thanks!
Pierre




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



[sage-support] Re: behaviour of reduce ?

2008-09-16 Thread Martin Albrecht

 that's what i expect from the term 'reduction' anyway

reduce is defined as:

   Reduce an element modulo the reduced Groebner basis for this
ideal. This returns 0 if and only if the element is in this
ideal. In any case, this reduction is unique up to monomial
orders.

See J.reduce?

 So if this is a bug i'll give you more details.

From what you've provided it is hard to tell. Could you provide a small 
reproducible example? I know you said its hard to do but without it, it will 
be difficult to help you.

Here are my attempts:

sage: P.y9,y12,y13,y15 = PolynomialRing(CyclotomicField(3))
sage: J.reduce(y13 + y9 - y12)
(-2)*y12 + y13
sage: J.reduce(y13*y15 + y9 - y12)
y13*y15 + (-2)*y12
sage: J.reduce(y9 - y12)
(-2)*y12

Cheers,
Martin

-- 
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x8EF0DC99
_www: http://www.informatik.uni-bremen.de/~malb
_jab: [EMAIL PROTECTED]


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



[sage-support] Re: Python Imaging Library

2008-09-16 Thread David Joyner

Besides Timothy's suggestion, you might be able to install PIL on top of
Sage using

sage -i PIL-1.1.5

It is listed among Sage's experimental packages at
http://www.sagemath.org/packages/experimental/
(which means it might work and it might not:-).


On Tue, Sep 16, 2008 at 2:56 AM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:

 Hi,

 I have installed Python Imaging Library (PIL) on my Linux box, I can
 access it in python however I don't have access to PIL functions while
 working with Sage.

 My configuration: Sage 3.1.1, PIL 1.1.5, python 2.4.4

 Is there any command line parameter I can pass to Sage in order to use
 PIL in Sage ? Can you help me to find a solution please ?

 Thanks in advance for your nice reply, have a nice day,

 jerome.landre
 University of Reims
 France

 


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



[sage-support] Re: Python Imaging Library

2008-09-16 Thread Simon King

Dear Jerome,

On Sep 16, 1:26 pm, David Joyner [EMAIL PROTECTED] wrote:
 It is listed among Sage's experimental packages 
 athttp://www.sagemath.org/packages/experimental/
 (which means it might work and it might not:-).

One encouraging remark: On my Suse Linux 64bit machine, the
experimental PIL package works fine.

Cheers
Simon

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



[sage-support] Re: behaviour of reduce ?

2008-09-16 Thread Pierre

What did you put in J ? in fact, the following already produces the
bug (sorry for not trying earlier, i thought i did try and there was
no bug... must have changed a little something):

sage: k= CyclotomicField(3, w)
sage: A= PolynomialRing(k, [y9, y12, y13, y15])
sage: y9, y12, y13, y15= A.gens()
sage: J= [ y9 + y12]*A; J.groebner_basis()
sage: J.reduce(y9 - y12)
-2*y12
sage: J.reduce(y13*y15)
y13*y15
sage: J.reduce(y13*y15 + y9 - y12)
y13*y15 + y9 - y12

Which is odd. I had read J.reduce?, it seems to indicate that the
function returns what i would also call the reduction, but that is
linear. So I think this is a bug.

On Sep 16, 12:33 pm, Martin Albrecht [EMAIL PROTECTED]
wrote:
  that's what i expect from the term 'reduction' anyway

 reduce is defined as:

Reduce an element modulo the reduced Groebner basis for this
 ideal. This returns 0 if and only if the element is in this
 ideal. In any case, this reduction is unique up to monomial
 orders.

 See J.reduce?

  So if this is a bug i'll give you more details.

 From what you've provided it is hard to tell. Could you provide a small
 reproducible example? I know you said its hard to do but without it, it will
 be difficult to help you.

 Here are my attempts:

 sage: P.y9,y12,y13,y15 = PolynomialRing(CyclotomicField(3))
 sage: J.reduce(y13 + y9 - y12)
 (-2)*y12 + y13
 sage: J.reduce(y13*y15 + y9 - y12)
 y13*y15 + (-2)*y12
 sage: J.reduce(y9 - y12)
 (-2)*y12

 Cheers,
 Martin

 --
 name: Martin Albrecht
 _pgp:http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x8EF0DC99
 _www:http://www.informatik.uni-bremen.de/~malb
 _jab: [EMAIL PROTECTED]
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: behaviour of reduce ?

2008-09-16 Thread Martin Albrecht

On Tuesday 16 September 2008, Pierre wrote:
 What did you put in J ? in fact, the following already produces the
 bug (sorry for not trying earlier, i thought i did try and there was
 no bug... must have changed a little something):

 sage: k= CyclotomicField(3, w)
 sage: A= PolynomialRing(k, [y9, y12, y13, y15])
 sage: y9, y12, y13, y15= A.gens()
 sage: J= [ y9 + y12]*A; J.groebner_basis()
 sage: J.reduce(y9 - y12)
 -2*y12
 sage: J.reduce(y13*y15)
 y13*y15
 sage: J.reduce(y13*y15 + y9 - y12)
 y13*y15 + y9 - y12

 Which is odd. I had read J.reduce?, it seems to indicate that the
 function returns what i would also call the reduction, but that is
 linear. So I think this is a bug.

Luckily (because we can fix it)/ unfortunately (because I'm probably to blame) 
it seems like a bug in our pexpect interface to Singular.

First, this is vanilla 3.1.2.rc2:

sage: k.w = CyclotomicField(3)
sage: A= PolynomialRing(k, [y9, y12, y13, y15])
sage: A.inject_variables()
sage: J= [ y9 + y12]*A
sage: J.groebner_basis()
sage: J.reduce(y13*y15 + y9 - y12)
y13*y15 + y9 - y12

This is 3.1.2.rc2 with 

http://trac.sagemath.org/sage_trac/ticket/686
http://trac.sagemath.org/sage_trac/ticket/4022
http://trac.sagemath.org/sage_trac/ticket/4021

applied:

sage: k.w = CyclotomicField(3)
sage: A= PolynomialRing(k, [y9, y12, y13, y15])
sage: A.inject_variables()
sage: J= [ y9 + y12]*A
sage: J.groebner_basis()
sage: J.reduce(y13*y15 + y9 - y12)
y13*y15 - 2*y12

so quite obviously we fail to tell Singular via pexpect to perform tail 
reduction while in the libSingular wrapper we do tail reduction.

I'll look into it. Btw. reduction to zero should still work, since that 
doesn't require tail reduction.

Cheers,
Martin

-- 
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x8EF0DC99
_www: http://www.informatik.uni-bremen.de/~malb
_jab: [EMAIL PROTECTED]


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



[sage-support] Re: behaviour of reduce ?

2008-09-16 Thread Pierre

cool, thanks a lot !

On Sep 16, 6:42 pm, Martin Albrecht [EMAIL PROTECTED]
wrote:
 On Tuesday 16 September 2008, Pierre wrote:



  What did you put in J ? in fact, the following already produces the
  bug (sorry for not trying earlier, i thought i did try and there was
  no bug... must have changed a little something):

  sage: k= CyclotomicField(3, w)
  sage: A= PolynomialRing(k, [y9, y12, y13, y15])
  sage: y9, y12, y13, y15= A.gens()
  sage: J= [ y9 + y12]*A; J.groebner_basis()
  sage: J.reduce(y9 - y12)
  -2*y12
  sage: J.reduce(y13*y15)
  y13*y15
  sage: J.reduce(y13*y15 + y9 - y12)
  y13*y15 + y9 - y12

  Which is odd. I had read J.reduce?, it seems to indicate that the
  function returns what i would also call the reduction, but that is
  linear. So I think this is a bug.

 Luckily (because we can fix it)/ unfortunately (because I'm probably to blame)
 it seems like a bug in our pexpect interface to Singular.

 First, this is vanilla 3.1.2.rc2:

 sage: k.w = CyclotomicField(3)
 sage: A= PolynomialRing(k, [y9, y12, y13, y15])
 sage: A.inject_variables()
 sage: J= [ y9 + y12]*A
 sage: J.groebner_basis()
 sage: J.reduce(y13*y15 + y9 - y12)
 y13*y15 + y9 - y12

 This is 3.1.2.rc2 with

 http://trac.sagemath.org/sage_trac/ticket/686http://trac.sagemath.org/sage_trac/ticket/4022http://trac.sagemath.org/sage_trac/ticket/4021

 applied:

 sage: k.w = CyclotomicField(3)
 sage: A= PolynomialRing(k, [y9, y12, y13, y15])
 sage: A.inject_variables()
 sage: J= [ y9 + y12]*A
 sage: J.groebner_basis()
 sage: J.reduce(y13*y15 + y9 - y12)
 y13*y15 - 2*y12

 so quite obviously we fail to tell Singular via pexpect to perform tail
 reduction while in the libSingular wrapper we do tail reduction.

 I'll look into it. Btw. reduction to zero should still work, since that
 doesn't require tail reduction.

 Cheers,
 Martin

 --
 name: Martin Albrecht
 _pgp:http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x8EF0DC99
 _www:http://www.informatik.uni-bremen.de/~malb
 _jab: [EMAIL PROTECTED]
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Python Imaging Library

2008-09-16 Thread Robert Bradshaw

You can also install nearly any Python library by doing sage -python  
setup.py

- Robert

On Sep 16, 2008, at 4:26 AM, David Joyner wrote:


 Besides Timothy's suggestion, you might be able to install PIL on  
 top of
 Sage using

 sage -i PIL-1.1.5

 It is listed among Sage's experimental packages at
 http://www.sagemath.org/packages/experimental/
 (which means it might work and it might not:-).


 On Tue, Sep 16, 2008 at 2:56 AM, [EMAIL PROTECTED]
 [EMAIL PROTECTED] wrote:

 Hi,

 I have installed Python Imaging Library (PIL) on my Linux box, I can
 access it in python however I don't have access to PIL functions  
 while
 working with Sage.

 My configuration: Sage 3.1.1, PIL 1.1.5, python 2.4.4

 Is there any command line parameter I can pass to Sage in order to  
 use
 PIL in Sage ? Can you help me to find a solution please ?

 Thanks in advance for your nice reply, have a nice day,

 jerome.landre
 University of Reims
 France




 


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



[sage-support] Direct installation of Maxima, etc.

2008-09-16 Thread Mike Witt

Sage creates shell scripts like this in /usr/local/bin:

[EMAIL PROTECTED] ~]$ cat /usr/local/bin/maxima#!/bin/sh
sage -maxima $*

What happens if I install some of these programs (such as Maxima, gap,  
R)
directly (for example if I were to do a yum install maxima) ?
I'm assuming (perhaps I'm wrong) that this will put an actual maxima
executable in /usr/local/bin/maxima.

So, what I'm curious about, is whether those shell scripts that sage
puts in /usr/local/bin are actually used by sage, or whether they
are just a convenience in case someone wants to invoke one of those
tools by name from the shell.

I hope that question made sense. The immediate practical import is
that I do actually want to do: yum info maxima maxima-gui and I'm
unclear if this will clash with my sage installation.

Thanks,

-Mike

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



[sage-support] Re: Direct installation of Maxima, etc.

2008-09-16 Thread William Stein

On Tue, Sep 16, 2008 at 11:49 AM, Mike Witt [EMAIL PROTECTED] wrote:

 Sage creates shell scripts like this in /usr/local/bin:

 [EMAIL PROTECTED] ~]$ cat /usr/local/bin/maxima#!/bin/sh
 sage -maxima $*

 What happens if I install some of these programs (such as Maxima, gap,
 R)
 directly (for example if I were to do a yum install maxima) ?
 I'm assuming (perhaps I'm wrong) that this will put an actual maxima
 executable in /usr/local/bin/maxima.

 So, what I'm curious about, is whether those shell scripts that sage
 puts in /usr/local/bin are actually used by sage, or whether they
 are just a convenience in case someone wants to invoke one of those
 tools by name from the shell.

They are *not* used by Sage.  They are only a convenience in case someone
wants to invoke one of those tools by name from the shell.

 I hope that question made sense. The immediate practical import is
 that I do actually want to do: yum info maxima maxima-gui and I'm
 unclear if this will clash with my sage installation.

It will not clash.  You may want to delete the sage-created
/usr/local/bin/maxim though.

William

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



[sage-support] Re: Questions about parallel sage, i.e. dsage

2008-09-16 Thread William Stein

On Tue, Sep 16, 2008 at 12:16 PM, Yann Le Du [EMAIL PROTECTED] wrote:

 Hello,

 I tried to email the person apprently responsible for dsage, Yi Qiang,
 about this, to no avail, so I turn to the list.

 I use sage, v. 3.1.1, and am trying to build an application (Monte Carlo
 stuff) and use dsage to parallelize the code : very easy stuff, just do a
 series of jobs, done normally in sequence on a single computer, in
 parallel on many.

Is it a bunch of computers all over on a network?  Just curious what sort
of many computers you have at your disposal.


 So I fiddled around with dsage, managed to understand the basics, and I
 find it very good, yet I have a few questions/remarks :

 1/ Why isn't there a clear, publicized, illustrated description of how to
 use dsage ? I managed to make it work, but only after googling hard.

 2/ How can I send a job to a worker that will output intermediate values ?
 I mean, say the job sent to a particular worker computes some value, and
 that it takes 100 iterations, how can I output temporary values every 10
 iterations and have the server report those intermediate values ?

 3/ I noticed that workers can connect any time, really, and receive jobs
 even if they connect to the server only after the server started some
 sequence of jobs, which is cool. But I also noticed that if a worker gets
 killed, then its job gets lost. Isn't it possible for the server to check
 if a worker is alive, every once in a while, and if not requeue its job ?

 4/ What is the function I can use to check which worker did what, and if
 it's alive, and what job got interrupted.

 5/ What test can I apply to a dsage job to see if it's finished ? Say a
 job outputs a list, and I want to plot it, can I say something like If
 there is some output, plot it, otherwise wait. ?

 6/ If you have any notes, drafts, illustrating some of dsage
 functionalities, I'd be more than happy to check them out.

 Cheers,

 --
 Yann Le Du


 




-- 
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] using ==

2008-09-16 Thread Bob Wonderly

Still a Sage newbie. I discovered the == comparison operator and tried 
this:

sage: 2*n+3==(6*n+9)/3
True
sage: 4==5
False

So I thought Sage would be useful to check on some messy algebra I was 
doing (one example out of many):

sage: (2*j*2^(18*q) + 13*2^(18*q)/27 - 13/27)
==
(2^(18*q)*(2*j+0)+13*(2^(18*q)-1)/27)

2*j*2^(18*q) + 13*2^(18*q)/27 - 13/27
==
2*j*2^(18*q) + 13*(2^(18*q) - 1)/27
 

(well the email program folded the lines so for clarity I refolded them 
in a more-readable manner)

But that comparison did not tell me what I was expecting. In fact it 
didn't tell me anythig.

The following is a rather lame substitute (proof by examplebig laugh):


sage: for q in range(2):
 for j in range(2):
 (2*j*2^(18*q) + 13*2^(18*q)/27 - 
13/27)==(2^(18*q)*(2*j+0)+13*(2^(18*q)-1)/27) + 1
:
False
False
False
False
sage: for q in range(2):
 for j in range(2):
 (2*j*2^(18*q) + 13*2^(18*q)/27 - 
13/27)==(2^(18*q)*(2*j+0)+13*(2^(18*q)-1)/27)
:
True
True
True
True

(No refolding of lines there...) At least that approach serves as a 
credibility check.

The question is: how do I use Sage to check on my algebra?

Bob Wonderly


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



[sage-support] Re: Python Imaging Library

2008-09-16 Thread [EMAIL PROTECTED]

Hi all,

Thanks a lot for your nice and quick answer. You have solved my
problem.

Have a nice day wherever you are,

Best regards,

Jérôme Landré
University of Reims
France


On 16 sep, 20:06, Robert Bradshaw [EMAIL PROTECTED]
wrote:
 You can also install nearly any Python library by doing sage -python  
 setup.py

 - Robert

 On Sep 16, 2008, at 4:26 AM, David Joyner wrote:



  Besides Timothy's suggestion, you might be able to install PIL on  
  top of
  Sage using

  sage -i PIL-1.1.5

  It is listed among Sage's experimental packages at
 http://www.sagemath.org/packages/experimental/
  (which means it might work and it might not:-).

  On Tue, Sep 16, 2008 at 2:56 AM, [EMAIL PROTECTED]
  [EMAIL PROTECTED] wrote:

  Hi,

  I have installed Python Imaging Library (PIL) on my Linux box, I can
  access it in python however I don't have access to PIL functions  
  while
  working with Sage.

  My configuration: Sage 3.1.1, PIL 1.1.5, python 2.4.4

  Is there any command line parameter I can pass to Sage in order to  
  use
  PIL in Sage ? Can you help me to find a solution please ?

  Thanks in advance for your nice reply, have a nice day,

  jerome.landre
  University of Reims
  France
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] displaying diff as a partial/total derivative

2008-09-16 Thread Jason Grout

I'm writing an @interact to solve simple 2nd order differential 
equations and plot solutions.  In it, I'd like to typeset the formula:

show(a*diff(y,t,2)+b*diff(y,t)+c==0)

However, what shows up is the word diff when I'd really like to see 
math notation for a partial or total derivative (depending on the 
independent variables declared for y).  Is there a nice way to get it to 
show up?

Note that just printing a string doesn't work so well, since a, b, or c 
might be negative and then you get something like 
3(d^2y/dt^2)+-2(dy/dt)+-3=0.

For reference, the current (non/barely) working code is:

var(x,t)
@interact
def _(y0=(0,4,1/5), y0p=(0,4,1/5),a=(-4,4,1/5),b=(-4,4,1/5),c=(-4,4,1/5)):
 y=function('y',t)
 show(a*diff(y,t,2)+b*diff(y,t)+c==0)
 show( y(0)=%s, y'(0)=%s%(y0,y0p))
 t0=0
 discriminant = sqrt(b^2-4*a*c)
 if discriminant  0:
 r1 = (-b+discriminant)/(2*a)
 r2 = (-b-discriminant)/(2*a)
 c1=(y0p-y0*r1)/(r1-r2)*e^(-r1*t0)
 c2=(y0*r1-y0p)/(r1-r2)*e^(-r2*t0)
 soln = c1*e^(r1*t)+c2*e^(r2*t)
 show(soln)
 plot(soln,(t,0,5)).show()


Thanks,

Jason


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



[sage-support] Re: displaying diff as a partial/total derivative

2008-09-16 Thread William Stein

On Tue, Sep 16, 2008 at 3:56 PM, Jason Grout
[EMAIL PROTECTED] wrote:

 I'm writing an @interact to solve simple 2nd order differential
 equations and plot solutions.  In it, I'd like to typeset the formula:

 show(a*diff(y,t,2)+b*diff(y,t)+c==0)

 However, what shows up is the word diff when I'd really like to see
 math notation for a partial or total derivative (depending on the
 independent variables declared for y).  Is there a nice way to get it to
 show up?

 Note that just printing a string doesn't work so well, since a, b, or c
 might be negative and then you get something like
 3(d^2y/dt^2)+-2(dy/dt)+-3=0.

 For reference, the current (non/barely) working code is:

 var(x,t)
 @interact
 def _(y0=(0,4,1/5), y0p=(0,4,1/5),a=(-4,4,1/5),b=(-4,4,1/5),c=(-4,4,1/5)):
 y=function('y',t)
 show(a*diff(y,t,2)+b*diff(y,t)+c==0)

Though ugly to input, I would be tempted to do something like this,
since the output looks superb:

a = sin(x); y = cos(x^2) + e^(3*pi*x)

html($$%s \cdot \\frac{d^2}{dt^2}\\left[ %s \\right]$$%(latex(a), latex(y)))


 show( y(0)=%s, y'(0)=%s%(y0,y0p))
 t0=0
 discriminant = sqrt(b^2-4*a*c)
 if discriminant  0:
 r1 = (-b+discriminant)/(2*a)
 r2 = (-b-discriminant)/(2*a)
 c1=(y0p-y0*r1)/(r1-r2)*e^(-r1*t0)
 c2=(y0*r1-y0p)/(r1-r2)*e^(-r2*t0)
 soln = c1*e^(r1*t)+c2*e^(r2*t)
 show(soln)
 plot(soln,(t,0,5)).show()


 Thanks,

 Jason


 




-- 
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: displaying diff as a partial/total derivative

2008-09-16 Thread Jason Merrill

This is http://trac.sagemath.org/sage_trac/ticket/3717.  Feeling
motivated to fix it?

JM

On Sep 16, 6:56 pm, Jason Grout [EMAIL PROTECTED] wrote:
 I'm writing an @interact to solve simple 2nd order differential
 equations and plot solutions.  In it, I'd like to typeset the formula:

 show(a*diff(y,t,2)+b*diff(y,t)+c==0)

 However, what shows up is the word diff when I'd really like to see
 math notation for a partial or total derivative (depending on the
 independent variables declared for y).  Is there a nice way to get it to
 show up?

 Note that just printing a string doesn't work so well, since a, b, or c
 might be negative and then you get something like
 3(d^2y/dt^2)+-2(dy/dt)+-3=0.

 For reference, the current (non/barely) working code is:

 var(x,t)
 @interact
 def _(y0=(0,4,1/5), y0p=(0,4,1/5),a=(-4,4,1/5),b=(-4,4,1/5),c=(-4,4,1/5)):
      y=function('y',t)
      show(a*diff(y,t,2)+b*diff(y,t)+c==0)
      show( y(0)=%s, y'(0)=%s%(y0,y0p))
      t0=0
      discriminant = sqrt(b^2-4*a*c)
      if discriminant  0:
          r1 = (-b+discriminant)/(2*a)
          r2 = (-b-discriminant)/(2*a)
          c1=(y0p-y0*r1)/(r1-r2)*e^(-r1*t0)
          c2=(y0*r1-y0p)/(r1-r2)*e^(-r2*t0)
          soln = c1*e^(r1*t)+c2*e^(r2*t)
          show(soln)
          plot(soln,(t,0,5)).show()

 Thanks,

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



[sage-support] Is there a way to access the unsimplified form of a symbolic expression?

2008-09-16 Thread Jason Merrill

The documentation for simplify explains:

Expressions always print simplified; a simplified expression is
distinguished because the way it prints agrees with its underlyilng
representation.

sage: x - x
0
sage: type(x - x)
class 'sage.calculus.calculus.SymbolicArithmetic'
sage: type(simplify(x - x))
class 'sage.calculus.calculus.SymbolicConstant'

So until hit with an explicit simplify command, symbolic expressions
seem retain at least some information about how they were input.  Is
there a way to get the input form of an expression back out?  Can I
ever get sage to print something like

sage: (x - x).some_devious_trick()
x - x

I'm not as interested in trickery involving strings.

If there is a way to do this, or if there could be a way to do this
that wouldn't foul everything up, then extending it to operations like
integrals, derivatives, sums, and products might be an interesting
approach to answering the how do I do a formal * in Sage? question.

Regards,

JM

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



[sage-support] Re: Is there a way to access the unsimplified form of a symbolic expression?

2008-09-16 Thread Mike Hansen

Hi Jason,

 So until hit with an explicit simplify command, symbolic expressions
 seem retain at least some information about how they were input.  Is
 there a way to get the input form of an expression back out?  Can I
 ever get sage to print something like

 sage: (x - x).some_devious_trick()
 x - x

Not quite so devious:

sage: a = x - x
sage: a._operator
built-in function sub
sage: a._operands
[x, x]

--Mike

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



[sage-support] Re: displaying diff as a partial/total derivative

2008-09-16 Thread Jason Grout

Jason Merrill wrote:
 This is http://trac.sagemath.org/sage_trac/ticket/3717.  Feeling
 motivated to fix it?



Ah, yes.  Thanks for pointing out the trac ticket; I remember the 
request now.  I've spent a bit of time today looking at this, but became 
convinced that it was a little harder than I thought since it seems like 
the job is passed off to maxima (i.e., I couldn't see an easy place to 
just add a _latex_ function and have it work).  Can anyone confirm/deny 
this?

The thought went through my head that this (solving the trac ticket 
above) would be a lot easier once the ginac code was merged.  Is that 
true?  Do we see the ginac code being merged for 3.1.3, given Burcin's 
response on the other thread?

Thanks,

Jason







 
 JM
 
 On Sep 16, 6:56 pm, Jason Grout [EMAIL PROTECTED] wrote:
 I'm writing an @interact to solve simple 2nd order differential
 equations and plot solutions.  In it, I'd like to typeset the formula:

 show(a*diff(y,t,2)+b*diff(y,t)+c==0)

 However, what shows up is the word diff when I'd really like to see
 math notation for a partial or total derivative (depending on the
 independent variables declared for y).  Is there a nice way to get it to
 show up?



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



[sage-support] Re: Is there a way to access the unsimplified form of a symbolic expression?

2008-09-16 Thread Jason Merrill

On Sep 16, 11:45 pm, Jason Merrill [EMAIL PROTECTED] wrote:
 Can I ever get sage to print something like

 sage: (x - x).some_devious_trick()
 x - x

 If there is a way to do this, or if there could be a way to do this
 that wouldn't foul everything up, then extending it to operations like
 integrals, derivatives, sums, and products might be an interesting
 approach to answering the how do I do a formal * in Sage? question.

Just wanted to develop this idea a little further.  Right now, pretty
much everything has a ._repr_() that tells it how to be displayed.  If
there's not already a .some_devious_trick(), why not call it .formal()

sage: (x - x).formal()
x - x

Currently, integral and diff are eager in that they call maxima as
soon as they get called and return a Sage representation of maxima's
answer.  But what if they were lazy--that is, they just made an object
with their input stored, and a .formal() method, and then a few other
methods like ._repr_() that would actually trigger the maxima
evaluation.

sage: m = (x^2).integral() # no call to maxima yet
sage: m.formal()
integral(x^2,x)
sage: latex(m.formal())
\int x^2\,dx
# now maxima gets called when the _repr_ method
# of m is called.  The result can be cached.
sage: m
x^3

If everything had a .formal() method, then these could cascade when
formal is called at higher levels

sage: latex(integral(x - x,x).formal())
\int x - x \,dx
sage: latex(integral(simplify(x - x),x).formal())
\int 0 \,dx

This one is rather nice, if you ask me:

sage: m = integral(cos(x),x)
sage: latex(m.formal() == m)
\int cos(x)\,dx = sin(x)

There was a discussion before about how Mathematica has a Hold[]
construct so you can do things like Hold[Integral[Cos[x],x]].  The
consensus was that python couldn't have this because it evaluates
function arguments before the function even gets to see them.  But
with judicious use of laziness and remembering what was input, Sage
could sneak its way around that problem as suggested above.  No need
for new preparsing, and no need for a distinction between Integral and
integral, nor integral(cos(x), evaluate=False) or any other unsavory
construction.

I'm sure there's probably some snakes in the grass here, but on the
surface it all looks rather nice to me.

Regards,

JM

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



[sage-support] Re: Is there a way to access the unsimplified form of a symbolic expression?

2008-09-16 Thread Jason Grout

Jason Merrill wrote:
 On Sep 16, 11:45 pm, Jason Merrill [EMAIL PROTECTED] wrote:
 Can I ever get sage to print something like

 sage: (x - x).some_devious_trick()
 x - x

 If there is a way to do this, or if there could be a way to do this
 that wouldn't foul everything up, then extending it to operations like
 integrals, derivatives, sums, and products might be an interesting
 approach to answering the how do I do a formal * in Sage? question.
 
 Just wanted to develop this idea a little further.  Right now, pretty
 much everything has a ._repr_() that tells it how to be displayed.  If
 there's not already a .some_devious_trick(), why not call it .formal()
 
 sage: (x - x).formal()
 x - x
 
 Currently, integral and diff are eager in that they call maxima as
 soon as they get called and return a Sage representation of maxima's
 answer.  But what if they were lazy--that is, they just made an object
 with their input stored, and a .formal() method, and then a few other
 methods like ._repr_() that would actually trigger the maxima
 evaluation.
 
 sage: m = (x^2).integral() # no call to maxima yet
 sage: m.formal()
 integral(x^2,x)
 sage: latex(m.formal())
 \int x^2\,dx
 # now maxima gets called when the _repr_ method
 # of m is called.  The result can be cached.
 sage: m
 x^3
 
 If everything had a .formal() method, then these could cascade when
 formal is called at higher levels
 
 sage: latex(integral(x - x,x).formal())
 \int x - x \,dx
 sage: latex(integral(simplify(x - x),x).formal())
 \int 0 \,dx
 
 This one is rather nice, if you ask me:
 
 sage: m = integral(cos(x),x)
 sage: latex(m.formal() == m)
 \int cos(x)\,dx = sin(x)
 
 There was a discussion before about how Mathematica has a Hold[]
 construct so you can do things like Hold[Integral[Cos[x],x]].  The
 consensus was that python couldn't have this because it evaluates
 function arguments before the function even gets to see them.  But
 with judicious use of laziness and remembering what was input, Sage
 could sneak its way around that problem as suggested above.  No need
 for new preparsing, and no need for a distinction between Integral and
 integral, nor integral(cos(x), evaluate=False) or any other unsavory
 construction.
 
 I'm sure there's probably some snakes in the grass here, but on the
 surface it all looks rather nice to me.



I believe this concept (lazy evaluation with Sage knowing what formal 
functions are involved) is what underlies the Function_* classes in 
calculus.py.  Each of those seems to not evaluate itself, so you get a 
SymbolicComposition object, which does your recursion for you.

At least, that is what things appear like on the surface as I've played 
around with it for a few minutes.

Jason


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