Hi,

I finally found time to write those _sage_ methods in SymPy we
discussed earlier.
The code is here:

http://dakol.hopto.org/sympy-sage/

(we are in the state of moving from Subversion to Mercurial in SymPy).
I created a new sympy spkg, by updating it's hg repository:

http://dakol.hopto.org/sympy-spkg/

(the change is trivial, because the src is not included). The spkg can
be downloaded from:

http://dakol.fsik.cvut.cz/~ondra/sympy-0.5.5.spkg

Install with:

./sage -i sympy-0.5.5.spkg

Now test it. Run this in sage:

---------------------------------------------

#!/usr/bin/env sage
#import sys
#sys.path.insert(0,"/home/ondra/ext/sympy-sage/")
from sympy import __version__
print __version__

print "SAGE:"

e = 1/cos(x)**3
print e
f = e.taylor(x, 0, 8)
print f

print "SymPy:"
from sympy import Symbol, cos, sympify, pprint
from sympy.abc import x

e = sympify(1)/cos(x)**3
print e
f = e.series(x, 10)
print f
print "\nSymPy pretty printer:"
pprint(e)
pprint(f)

print "\nSymPy -> SAGE:"
print e._sage_()
print f._sage_()

-------------------------------------------

it will produce the following output (I put the code above into example.sage):

[EMAIL PROTECTED]:~/ext/sage-2.8.7-debian32-i686-Linux$ ./sage example.sage
0.5.5-svn
SAGE:
                                       1
                                    -------
                                       3
                                    cos (x)
                            8        6       4      2
                      8651 x    241 x    11 x    3 x
                      ------- + ------ + ----- + ---- + 1
                       13440     240       8      2
SymPy:
cos(x)**(-3)
1 + (3/2)*x**2 + (11/8)*x**4 + (241/240)*x**6 + (8651/13440)*x**8 + O(x**10)

SymPy pretty printer:
   -3
cos  (x)
       2       4        6         8
    3*x    11*x    241*x    8651*x
1 + ---- + ----- + ------ + ------- + O(x**10)
     2       8      240      13440

SymPy -> SAGE:
                                       1
                                    -------
                                       3
                                    cos (x)
                            8        6       4      2
                      8651 x    241 x    11 x    3 x
                      ------- + ------ + ----- + ---- + 1
                       13440     240       8      2



Currently only the Add, Mul, Pow, Rational, Integer, sin, cos classes
have the _sage_ method, but that is enough for some basic playing.
Let's now implement the corresponding _sympy_ method in SAGE and maybe
a few more iterations to see if we like it. And if so, I'll implement
the _sage_() for more SymPy classes.

I'd like to achieve a state, where the same code in SAGE could be run
on both backends (Maxima and SymPy). That way we could easily see
where Maxima is better than SymPy and vice versa.

Could you William please create a trac login for me? I'd like to open
and discuss a new ticket for it. Also so that I can attach any bundles
in there.

Are you planning to make another SAGE release before SD 6? If so, it
would be good if we could make it before it, then we'll release SymPy,
create spkg, you'll release SAGE, include the spkg, so that it's
working out of the box for everyone at SD6 and we can discuss some new
more exciting things to do in Bristol.

I am sorry it has taken me so long, I was really busy.

Ondrej

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to