On Wed, Jun 3, 2009 at 5:54 PM, James Parson <par...@hood.edu> wrote:
>
> Thanks to David Joyner for his response to my original question. His
> method worked nicely. Incidentally, here is the original Maple code
> from the lecture of Doron Zeilberger that I was trying to translate
> into Sage:


BTW I think the more of Zeilberger's stuff that is translated into
Sage the better!
Please consider publishing your translation as a sagemath.org notebook
worksheet.


>
> with(combinat): P:=(d,x,y)->add(add(a[i,j]*x**i*y**j,i=0..d-
> j),j=0..d);
> V:=d->fseq(seq(a[i,j],i=0..d-j),j=0..d)g;
> E:=d->fseq(P(d,fibonacci(n),fibonacci(n+1)),n=1..nops(V(d))+5) g:
> Q:=(d,x,y)->subs(solve(E(d),V(d)),P(d,x,y));
>
> These lines feature the sort of indexed variables a[i,j] discussed
> above.
>
> (The full lecture from which I took these lines can be found at
> http://www.math.rutgers.edu/~zeilberg/mamarim/mamarimhtml/em.html.)
>
> 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 Field


> so that I could tell Sage about an algebraic group action on the space
> of polynomials of degree <=d. For a simpler variant: is there a
> convenient way to construct QQ[x_{ij}] with 1\leq i,j\leq n? I am a
> overwhelmed with the various ways to construct a polynomial ring, and
> so I cannot tell if one of them would be appropriate for this purpose.
> I can see how to make a polynomial ring in n^2 variables, but I do not
> know how to name them x_{ij}.
>
>
> Thanks again for your help,
>
> James Parson
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to