Re: Sage math app

4 views
Skip to first unread message

William Stein

unread,
Nov 19, 2007, 1:49:52 PM11/19/07
to ch...@seberino.org, sage-...@googlegroups.com
On Nov 19, 2007 10:44 AM, <> wrote:
> I wanted to commend you for leading Sage. I think it is a great idea
> to combine all the open source math apps out there into a unified whole.

Thanks!

> I'm curious about your integration component. I believe I read you
> were using Maxima but were interested in improving the interface??

Under the hood Maxima is indeed used to provide the low-level
integration capabilities
in Sage right now.

> How are you planning to change the interface?

We haven't exactly decided yet. For starters we at least want to make sure
Sage can compute many integrals that Maxima can't (but say Maple and/or
Mathematica can compute). I've cc'd this email to sage-devel, so maybe people
there (e.g., Ondrej Certik) will say more about what they're interested
in doing.

> Perhaps making a syntax compatible with Mathematica's??

No, that's definitely not planned.

William

William Stein

unread,
Nov 19, 2007, 2:06:00 PM11/19/07
to ch...@seberino.org, sage-...@googlegroups.com
On Nov 19, 2007 11:02 AM, <ch...@seberino.org> wrote:

> On Mon, Nov 19, 2007 at 10:49:52AM -0800, William Stein wrote:
> > > Perhaps making a syntax compatible with Mathematica's??
> >
> > No, that's definitely not planned.
> >
> > William
>
> I've been thinking about this myself for a while. Sage could definitely
> make up their own syntax.

We already did make up our own syntax, which fits most naturally with
how Python works.
In many cases it turns out to be exactly the same as Mupad and very
similar to Maple.

> As a long time Mathematica user I wonder if
> the Mathematica syntax is well known enough that it would be valuable
> to just mimic that syntax. I believe Bateman of Maxima had even completed
> a prototype of this. I'd be curious to hear what others in Sage think.

Having some sort of compatibility layer, e.g., a function that takes an almost
arbitrary mathematica expression and converts it to a sage expression *is*
on our todo list, so at least one could do, e.g.,
from_mathematica('Sin[x^2]')
and get Sage's sin(x^2). We can already do this with almost arbitrary Maxima
expressions. If we could also do it for Mathematica, then we could actually
use Mathematica as a backend for sage's symbolic simplication, integration,
etc., as an option. This has been on the todo list for a while, but nobody has
tackled implementing it. Are you interested in trying?

-- William

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

Ondrej Certik

unread,
Nov 19, 2007, 2:25:46 PM11/19/07
to sage-...@googlegroups.com, ch...@seberino.org
> > How are you planning to change the interface?
>
> We haven't exactly decided yet. For starters we at least want to make sure
> Sage can compute many integrals that Maxima can't (but say Maple and/or
> Mathematica can compute). I've cc'd this email to sage-devel, so maybe people
> there (e.g., Ondrej Certik) will say more about what they're interested
> in doing.

See all the relevant discussion here:

http://groups.google.com/group/sage-newbie/browse_thread/thread/20283412c7064512

and here:

http://groups.google.com/group/sage-devel/browse_thread/thread/2308561f175a0674/906f9b991c68de06

and feel free to join and tell us your opinion about it.

>
> > Perhaps making a syntax compatible with Mathematica's??
>
> No, that's definitely not planned.
>

> > I've been thinking about this myself for a while. Sage could definitely
> > make up their own syntax.
>
> We already did make up our own syntax, which fits most naturally with
> how Python works.
> In many cases it turns out to be exactly the same as Mupad and very
> similar to Maple.

As to syntax, I think in Python we could use:

>>> integrate(x**3, (x, -1, 1))
0
>>> integrate(sin(x), (x, 0, pi/2))
1
>>> integrate(cos(x), (x, -pi/2, pi/2))
2

as in SymPy, instead of


sage: integral(x/(x^2+1), x, 0, 1)
log(2)/2


as in SAGE currently, to be close to Mathematica. Because then you can
use the syntax:

integrate(cos(x*y), (x, -pi/2, pi/2), (y, 0, pi))

for multiple integrals. But anyway, it's just a cosmetic issue.

> Having some sort of compatibility layer, e.g., a function that takes an almost
> arbitrary mathematica expression and converts it to a sage expression *is*
> on our todo list, so at least one could do, e.g.,
> from_mathematica('Sin[x^2]')
> and get Sage's sin(x^2). We can already do this with almost arbitrary Maxima
> expressions. If we could also do it for Mathematica, then we could actually
> use Mathematica as a backend for sage's symbolic simplication, integration,
> etc., as an option. This has been on the todo list for a while, but nobody has
> tackled implementing it. Are you interested in trying?

In SymPy we were discussing how to write a Mathematica parser:

http://code.google.com/p/sympy/issues/detail?id=161

you can find relevant links to some code and papers in there. I think
it would be very worthy to have it - to feed in (almost) any
Mathematica program and SAGE will know how to execute it using SAGE as
a backend.

Ondrej

sebe...@spawar.navy.mil

unread,
Nov 20, 2007, 2:10:33 PM11/20/07
to sage-devel

> As to syntax, I think in Python we could use:

> >>> integrate(cos(x), (x, -pi/2, pi/2))

> Because then you can
> use the syntax:
>
> integrate(cos(x*y), (x, -pi/2, pi/2), (y, 0, pi))
>
> for multiple integrals. But anyway, it's just a cosmetic issue.

When I commended Sage's syntax I was assuming you were using this
Mathematica like syntax already. I agree with Ondrej and think his
suggestion above is the way to go.

Chris

William Stein

unread,
Nov 20, 2007, 2:17:40 PM11/20/07
to sage-...@googlegroups.com
On Nov 20, 2007 11:10 AM, sebe...@spawar.navy.mil

So do I. I think we should change that functions as suggested. Anybody
want to submit a patch? Ondrej, could you create a trac ticket making precise
what you want, etc.?

> Well Mathematica is proprietary software so I'm not sure why this would be
> interesting. More important it seems to me is to make a rock solid wrapper for
> Maxima's engine.

Fortunately, that's already done :-)

-- William

Ondrej Certik

unread,
Nov 20, 2007, 5:22:33 PM11/20/07
to sage-...@googlegroups.com
On Nov 20, 2007 8:17 PM, William Stein <wst...@gmail.com> wrote:
>
> On Nov 20, 2007 11:10 AM, sebe...@spawar.navy.mil
> <sebe...@spawar.navy.mil> wrote:
> > > As to syntax, I think in Python we could use:
> > > >>> integrate(cos(x), (x, -pi/2, pi/2))
> > > Because then you can
> > > use the syntax:
> > >
> > > integrate(cos(x*y), (x, -pi/2, pi/2), (y, 0, pi))
> > >
> > > for multiple integrals. But anyway, it's just a cosmetic issue.
> >
> > When I commended Sage's syntax I was assuming you were using this
> > Mathematica like syntax already. I agree with Ondrej and think his
> > suggestion above is the way to go.
>
> So do I. I think we should change that functions as suggested. Anybody
> want to submit a patch? Ondrej, could you create a trac ticket making precise
> what you want, etc.?

http://sagetrac.org/sage_trac/ticket/1221

Ondrej

Stephen Forrest

unread,
Nov 20, 2007, 5:44:14 PM11/20/07
to sage-...@googlegroups.com
On Nov 20, 2007 2:10 PM, sebe...@spawar.navy.mil
<sebe...@spawar.navy.mil> wrote:

[snip]


> > Because then you can
> > use the syntax:
> >
> > integrate(cos(x*y), (x, -pi/2, pi/2), (y, 0, pi))
> >
> > for multiple integrals. But anyway, it's just a cosmetic issue.
>
> When I commended Sage's syntax I was assuming you were using this
> Mathematica like syntax already. I agree with Ondrej and think his
> suggestion above is the way to go.

This probably goes without saying, but presumably after the change one
will still be able to use the syntax 'integrate(sin(x),x) ' for
indefinite integration? That is, the second argument may be a triple
or a symbol?

Steve

Ondrej Certik

unread,
Nov 20, 2007, 8:11:36 PM11/20/07
to sage-...@googlegroups.com

Exactly as you say.

Ondrej

Reply all
Reply to author
Forward
0 new messages