On Wed, 16 Nov 2011 15:10:54 +0100
Florent Hivert <florent.hiv...@lri.fr> wrote:

> > Pynac supports indexed expressions already. It just isn't wrapped in
> > Sage yet. Again, there is an experimental patch available:
> > 
> > http://sage.math.washington.edu/home/burcin/indexed_expression-20110727.patch
> > 
> > Since you can wrap any hashable Python object in a symbolic
> > expression with SR._force_pyobject(), this could replace your
> > IndexedVarExpr class.
> > 
> > I would appreciate any help with cleaning up these patches, adding
> > doctests etc. so they can be merged. :)
> 
> I'll try to cleanup this one, though I don't know anything about
> Pynac's internal... Is there a lot more work to do than adding
> doctests ?

It should be only doctests, but you never know what comes up. :)

I haven't looked at the patch in detail. I don't recall if any low
level modification is needed. I'll be on IRC if you run into anything.

Thanks a lot for looking into this.

> By the way my buggy implementation revealed something that looks
> strange to me:
> 
> sage: Z = IndexedVar("Z")
> sage: ex = (Z[1] + Z[2])/(Z[3] + Z[4])
> sage: ex
> (Z[1] + Z[2])/(Z[3] + Z[4])
> sage: ex.numerator()
> ERROR: An unexpected error occurred while tokenizing input
> The following traceback may be corrupted or invalid
> The error message is: ('EOF in multi-line statement', (647, 0))
> 
> ---------------------------------------------------------------------------
> TypeError                                 Traceback (most recent call
> last) [...]
> TypeError: unable to make sense of Maxima expression 'Z[2]+Z[1]' in
> Sage
> 
> Do we have to call Maxima to compute the numerator of a rational
> fraction ? Is seems to me that Pynac/Ginac should be able to do it by
> themselves.

Unfortunately, we still call maxima for a lot of trivial operations.
For example, pynac can easily handle the functions
Expression.{coeff,poly}().

Feel free to open tickets for these issues.


Cheers,
Burcin

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to