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
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
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
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
http://sagetrac.org/sage_trac/ticket/1221
Ondrej
[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
Exactly as you say.
Ondrej