On Mon, Aug 25, 2008 at 8:55 PM, David Philp <[EMAIL PROTECTED]> wrote:
> On 26/08/2008, at 12:42 PM, William Stein wrote:
>
>> 1) Let me clarify -- I *wrapped* the pattern matching already in
>> Pynac.
> ...
>> and you
>> can read about Ginac at the Ginac website: http://www.ginac.de/
>
> Thanks for the clarification.  Sorry I missed the post about pynac---
> I'm fairly quick to delete stuff.
>
> In the spirit of clarification, I should say that I am not
> particularly batting for Lisp, Maxima or Mathematica, nor do I want to
> make sage look like Mathematica.  But this area of pattern matching is
> one where the Mathematica / Lisp way of doing things is extremely
> instructive.  That is the only reason I am rabbitting on about it.

I do greatly appreciate it.

> I was actually asking what capabilities you envisage.  From looking at
> ginac, I think there's a good chance that it does all those things.

It does a lot, but there's no reason to not make it better, and there's every
reason to understand its shortcomings.
>> That would be a waste of time for Sage.  No matter how good Maxima
>> is or its pattern matching is, Maxima is still working in it's own
>> world of objects
>> and data types, which have nothing much to do with Python's.  Maxima/
>> Axiom
>> live on a totally different planet than Python/C/C++.   This is just
>> a fact
>> we have to deal with.
>
> I actually don't understand this.  For both pynac and the existing
> maxima link, I think you must already have some method of transforming
> a python object to and from lisp-like expressions.

Pynac works with objects that are simply expression trees constructed
directly from native Python objects.  Literally, if you type, e.g.,

sage: S = var('x',ns=1).parent()   # new symbolic ring
sage: foo = S(any_crazy_element_you_can_think_of_in_Sage)^3 + 17

then Pynac constructs an expression tree with a *pointer* in memory
to that any_crazy_element_you_can_think_of_in_Sage.  This pointer
setting takes a few nanoseconds.   Moreover, because of the extreme
flexibility of any_crazy_element_you_can_think_of_in_Sage, you
can do awesome things from this point of view, which are impossible
in maxima via Sage.

Interestingly, today a colleague asked me a computational research
problem, involving computing a bunch of powers series defined
by a recurrence with coefficients in a rational function field.
They were using Magma with quotients of polynomial rings by
powers of ideals over fraction fields, and suffering greatly just
trying to extract off coefficients, etc., and of course in trying
to visualize the result.  I just wrote code in a couple minutes
to do what they want using the new Pynac symbolic stuff,
and it uses just the point I'm making above to feel right and
be faster.    I can make parts of the symbols appearing
in the computation be singular-based multivariate polynomials,
and other parts by Ginac formal symbols.  It's very very nice.
This is one of the key things Sage has been missing for
a long time to feel complete.

 -- William

--~--~---------~--~----~------------~-------~--~----~
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://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to