On Wednesday, April 16, 2014 4:16:30 PM UTC-7, BJ wrote: > > I have the following code, which produces a list of polynomials in the > infinite number of variables e_0, e_1, ... > > M.<e> = InfinitePolynomialRing(QQ, implementation="sparse") > > However, I've been having a lot of trouble figuring out how to do >> substitutions in these polynomial rings in order to get what I want. > > > I think the following should be the recommended way of doing this, but currently it doesn't work:
sage: f = e[1]^2+e[2]^3 sage: f.subs({e[1]: 2}) #this doesn't work 4+e_2^3 the following does work: sage: f(e_1=2) 4+e_2^3 but it's flawed: sage: f(e_4=2) KeyError: 'e_4' The problem seems to be that the standard subs routines expect the parent to have a finite, predetermined sequence of generators. That's of course not the case for your rings. I think InfinitePolynomialRing has to override more of the methods involved. -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.