Ask Your Question

DCL's profile - activity

2019-05-03 20:09:29 +0200 received badge  Editor (source)
2019-05-03 20:08:23 +0200 commented answer Defining family of multivariable polynomials

Thanks, this works perfectly!

2019-05-03 20:05:47 +0200 received badge  Scholar (source)
2019-05-03 20:03:07 +0200 received badge  Supporter (source)
2019-05-03 19:04:31 +0200 received badge  Student (source)
2019-05-03 15:27:01 +0200 commented question Defining family of multivariable polynomials

That is correct, I'd like to fix any $n$ then study the $p_k$.

Yes, these will be degree $1$ polynomials in at most $n$ variables.

2019-05-03 08:05:55 +0200 asked a question 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\in \mathbb{N}$ and all $k=0,\dotsc, 2n$ by $$p_{n,k}=\begin{cases} 0 & \textrm{if } k=0\newline \sum_{j=1}^k x_j&\textrm{if } k\leq n\newline \sum_{j=1}^{2n-k+1}x_j&\textrm{if }k>n \end{cases}$$

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 $\mathbb{Q}[x_0,\dotsc, x_n]$ 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.