[sage-support] Re: Multivariate polynomials in Sage

2009-08-27 Thread Nathann Cohen
Thank you for your answers !! I think I can build something from them and from William's idea of a .__getitem__ function :-) On Aug 27, 12:50 am, Simon King wrote: > Hi Martin, > > On Aug 26, 10:46 pm, Martin Albrecht > wrote: > > > Hi, > > > isn't the OP asking for the infinite polynomial ri

[sage-support] Re: Multivariate polynomials in Sage

2009-08-26 Thread Simon King
Hi Martin, On Aug 26, 10:46 pm, Martin Albrecht wrote: > Hi, > > isn't the OP asking for the infinite polynomial ring which Simon and Mike > wrote? I was wondering myself, of course. But in Nathann's examples, the arguments to the dictionary variables are any strings, e.g., y["g"]*y["h"] fr

[sage-support] Re: Multivariate polynomials in Sage

2009-08-26 Thread Martin Albrecht
Hi, isn't the OP asking for the infinite polynomial ring which Simon and Mike wrote? sage: P. = InfinitePolynomialRing(QQ) sage: x Generator for the x's in Infinite polynomial ring in x over Rational Field sage: x[0] x0 sage: x[1] x1 sage: x[2] x2 Cheers, Martin -- name: Martin Albrecht _pgp

[sage-support] Re: Multivariate polynomials in Sage

2009-08-26 Thread Simon King
Hi Nathann, On Aug 26, 6:53 pm, Nathann Cohen wrote: [...] > be able to live on the same ring... I would have liked to defined a > "dictionary variable" x, once and forever, such that I can afterward > add and multiplicate x["d"] and x["c"].. There is a multitude of rings in Sage, and much depe

[sage-support] Re: Multivariate polynomials in Sage

2009-08-26 Thread Nathann Cohen
> I don't see the problem, because *anything* can be stored as value in > a dictionary. Your answer with a dictionary in which are stored variables is pretty good, though there's a different with what I had in mind : You first need to define each cell of the dictionary as a variable, and you have

[sage-support] Re: Multivariate polynomials in Sage

2009-08-26 Thread Simon King
Hi Nathann, On Aug 26, 6:08 pm, Nathann Cohen wrote: [...] > But I have two questions now : >     * Could it be possible to define variables indexed two times ? > Something like y[0][1]*y[2][3] ? >       Could it even be possible to define "dictionary" variables ( I > mean a dictionary of variab