Defining family of multivariable polynomials
Brand new to Sage here and trying to define a family of polynomials indexed by natural numbers. In particular, I'd like to be able to generate then perform symbolic calculations with the family of polynomials defined for all n∈N and all k=0,…,2n by pn,k={0if k=0∑kj=1xjif k≤n∑2n−k+1j=1xjif k>n
So far the attempts that I've had are of the form:
sage: h = lambda k:sum([var('d_%d' %(i+1)) for i in range(k)])
but I don't seem to easily perform calculations with these. Another method I was trying is defining Q[x0,…,xn] then trying to define these polynomials using conditional statements. I seem to keep getting errors stating my variables don't exist.
Would love some help or a hint.
Your pk silently depends on n. So you want to fix n and study the pk?
As you write them, your pk are first-degrees polynomials of n variables at most. Is that really what you want ?
That is correct, I'd like to fix any n then study the pk.
Yes, these will be degree 1 polynomials in at most n variables.
Comments:
h = lambda k: ...
by 4 spaces will make it display as codeThanks for taking all the comments into account and editing your question!