Re: [sage-devel] indexed symbolic variables

2011-11-18 Thread Burcin Erocal
Hi Florent, On Thu, 17 Nov 2011 14:44:35 +0100 Florent Hivert wrote: > On Wed, Nov 16, 2011 at 03:48:10PM +0100, Burcin Erocal wrote: > > On Wed, 16 Nov 2011 15:10:54 +0100 > > Florent Hivert wrote: > > > > > > Pynac supports indexed expressions already. It just isn't > > > > wrapped in Sage y

Re: [sage-devel] indexed symbolic variables

2011-11-17 Thread Florent Hivert
Hi Burcin, On Wed, Nov 16, 2011 at 03:48:10PM +0100, Burcin Erocal wrote: > On Wed, 16 Nov 2011 15:10:54 +0100 > Florent Hivert wrote: > > > > Pynac supports indexed expressions already. It just isn't wrapped in > > > Sage yet. Again, there is an experimental patch available: > > > > > >

Re: [sage-devel] indexed symbolic variables

2011-11-16 Thread Burcin Erocal
On Wed, 16 Nov 2011 15:10:54 +0100 Florent Hivert 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 yo

Re: [sage-devel] indexed symbolic variables

2011-11-16 Thread Florent Hivert
> 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 S

Re: [sage-devel] indexed symbolic variables

2011-11-16 Thread Florent Hivert
Hi, I discovered that units have the same flaw. This all look good: sage: units.length.meter^2 meter^2 sage: u = units.length.meter^2 sage: u.op[0] meter sage: type(units.length.meter) However, getting back meter from u give not a unit but a plain Expression: sage: type(u.op[0]) sage: u

Re: [sage-devel] indexed symbolic variables

2011-11-16 Thread Burcin Erocal
Hi Florent, On Tue, 15 Nov 2011 17:29:38 +0100 Florent Hivert wrote: > So I'm trying to inherits from Expression. Here is my code: > > from sage.symbolic.expression import Expression > class IndexedVarExpr(Expression): > def index(self): > return self._index > > class IndexedVar(S

[sage-devel] indexed symbolic variables

2011-11-15 Thread Florent Hivert
Hi there, I'm trying to make sage aware of indexed variables. For the information, this is a long standing Sage-Combinat wish. more precisely, basically I need a sage object Y such that, for any object (say hashable) o: 1 - the call Y[o] returns a variable which is legal in symbolic express