> > > 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]
I think it would actually be something like sage: vars = ["a"+str(i)+str(j) for i,j in Inds if i+j<5] Of course you'd have to change 25 below. Actually, I think the number of variables is optional, though if you include it you need to calculate the correct number of them :) > 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 Field - kcrisman --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---