ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 13 Mar 2020 22:34:09 +0100Polynomial ring with a number (to be determined) of variableshttps://ask.sagemath.org/question/50228/polynomial-ring-with-a-number-to-be-determined-of-variables/I know that we can construct the ring of polynomials with three variables with the following command:
`R.<x0,x1,x2>=PolynomialRing(ZZ)`
How can I construct the ring of polynomials with $n$ varaibles, where $n$ is to be specified later?
Thanks in advance!
Fri, 13 Mar 2020 06:17:28 +0100https://ask.sagemath.org/question/50228/polynomial-ring-with-a-number-to-be-determined-of-variables/Answer by rburing for <p>I know that we can construct the ring of polynomials with three variables with the following command:</p>
<p><code>R.<x0,x1,x2>=PolynomialRing(ZZ)</code></p>
<p>How can I construct the ring of polynomials with $n$ varaibles, where $n$ is to be specified later?</p>
<p>Thanks in advance!</p>
https://ask.sagemath.org/question/50228/polynomial-ring-with-a-number-to-be-determined-of-variables/?answer=50230#post-id-50230You don't even have to decide on $n$ at all; just take an [infinite polynomial ring](http://doc.sagemath.org/html/en/reference/polynomial_rings/sage/rings/polynomial/infinite_polynomial_ring.html).
> By Infinite Polynomial Rings, we mean polynomial rings in a countably infinite number of variables. The implementation consists of a wrapper around the current finite polynomial rings in Sage.
Call [polynomial_ring()](http://doc.sagemath.org/html/en/reference/polynomial_rings/sage/rings/polynomial/infinite_polynomial_ring.html#sage.rings.polynomial.infinite_polynomial_ring.InfinitePolynomialRing_dense.polynomial_ring) to get the underlying finite polynomial ring.Fri, 13 Mar 2020 22:34:09 +0100https://ask.sagemath.org/question/50228/polynomial-ring-with-a-number-to-be-determined-of-variables/?answer=50230#post-id-50230