> > Here is a variant on the original question: suppose I wanted to write
> > a line that creates a polynomial ring whose variables are a_{ij} for i
> > +j<=d. How should I do it? I might want to set this up, for example,
>
> sage: Inds = CartesianProduct(range(5), range(5))
> sage: vars = ["a"+str(i)+str(j) for i,j in Inds]
> sage: PolynomialRing(QQ,25,vars)
> Multivariate Polynomial Ring in a00, a01, a02, a03, a04, a10, a11,
> a12, a13, a14, a20, a21, a22, a23, a24, a30, a31, a32, a33, a34, a40,
> a41, a42, a43, a44 over Rational FieldThanks again for the suggestions. I have one more foolish question about this sort of construction: if I type those lines into Sage and then type something like a00 + a11, I get an error NameError: name 'a00' is not defined. I read about this sort of thing in the Sage Tutorial, but I couldn't understand it well enough to figure out how to name the variables what I wanted. Is there any easy way to do this? Regards, James Parson --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
