ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 09 May 2017 06:11:17 -0500Is there a way to create the ring of multi-variable polynomials over a field?http://ask.sagemath.org/question/37542/is-there-a-way-to-create-the-ring-of-multi-variable-polynomials-over-a-field/Suppose I create a field in SAGE. Maybe it is my own field implemented in some particular way, but I know it is a field and it can do all the operations. Is there any way at all to create a ring of polynomials in several variables over my field? Of course it might be less efficient than SINGULAR implementation, but still some fall back "toy" implementation would be nice, so that I can run the "toy" Groebner basis algorithm on it.
UPDATE: it turns out, the question should have been formulated as "how to make SAGE believe that my field is a field?". Once this is solved, the usual PolynomialRing function works as expected.Mon, 08 May 2017 14:24:23 -0500http://ask.sagemath.org/question/37542/is-there-a-way-to-create-the-ring-of-multi-variable-polynomials-over-a-field/Comment by tmonteil for <p>Suppose I create a field in SAGE. Maybe it is my own field implemented in some particular way, but I know it is a field and it can do all the operations. Is there any way at all to create a ring of polynomials in several variables over my field? Of course it might be less efficient than SINGULAR implementation, but still some fall back "toy" implementation would be nice, so that I can run the "toy" Groebner basis algorithm on it.</p>
<p>UPDATE: it turns out, the question should have been formulated as "how to make SAGE believe that my field is a field?". Once this is solved, the usual PolynomialRing function works as expected.</p>
http://ask.sagemath.org/question/37542/is-there-a-way-to-create-the-ring-of-multi-variable-polynomials-over-a-field/?comment=37548#post-id-37548By the way, if you have a nice implementation of some interesting field, please consider contributing it to Sage !Tue, 09 May 2017 04:38:40 -0500http://ask.sagemath.org/question/37542/is-there-a-way-to-create-the-ring-of-multi-variable-polynomials-over-a-field/?comment=37548#post-id-37548Comment by dan_fulea for <p>Suppose I create a field in SAGE. Maybe it is my own field implemented in some particular way, but I know it is a field and it can do all the operations. Is there any way at all to create a ring of polynomials in several variables over my field? Of course it might be less efficient than SINGULAR implementation, but still some fall back "toy" implementation would be nice, so that I can run the "toy" Groebner basis algorithm on it.</p>
<p>UPDATE: it turns out, the question should have been formulated as "how to make SAGE believe that my field is a field?". Once this is solved, the usual PolynomialRing function works as expected.</p>
http://ask.sagemath.org/question/37542/is-there-a-way-to-create-the-ring-of-multi-variable-polynomials-over-a-field/?comment=37543#post-id-37543`PolynomialRing` does not help (and is the answer)?Mon, 08 May 2017 15:41:53 -0500http://ask.sagemath.org/question/37542/is-there-a-way-to-create-the-ring-of-multi-variable-polynomials-over-a-field/?comment=37543#post-id-37543Answer by B r u n o for <p>Suppose I create a field in SAGE. Maybe it is my own field implemented in some particular way, but I know it is a field and it can do all the operations. Is there any way at all to create a ring of polynomials in several variables over my field? Of course it might be less efficient than SINGULAR implementation, but still some fall back "toy" implementation would be nice, so that I can run the "toy" Groebner basis algorithm on it.</p>
<p>UPDATE: it turns out, the question should have been formulated as "how to make SAGE believe that my field is a field?". Once this is solved, the usual PolynomialRing function works as expected.</p>
http://ask.sagemath.org/question/37542/is-there-a-way-to-create-the-ring-of-multi-variable-polynomials-over-a-field/?answer=37546#post-id-37546As mentioned, `PolynomialRing` should work with your field.
Note though that the fact that *you* know it is a field is not the same as *SageMath* knows it is a field. And the second case is much more interesting of course, since then SageMath will provide you generic implementations for multivariate polynomial rings over fields (such as the "toy" Groebner basis algorithm).
To learn how to create some algebraic structure (with SageMath knowing its nature), you may begin with the thematic tutorial: [How to implement new algebraic structures in Sage?](http://doc.sagemath.org/html/en/thematic_tutorials/coercion_and_categories.html)Tue, 09 May 2017 04:12:32 -0500http://ask.sagemath.org/question/37542/is-there-a-way-to-create-the-ring-of-multi-variable-polynomials-over-a-field/?answer=37546#post-id-37546Comment by Anton Mellit for <p>As mentioned, <code>PolynomialRing</code> should work with your field. </p>
<p>Note though that the fact that <em>you</em> know it is a field is not the same as <em>SageMath</em> knows it is a field. And the second case is much more interesting of course, since then SageMath will provide you generic implementations for multivariate polynomial rings over fields (such as the "toy" Groebner basis algorithm). </p>
<p>To learn how to create some algebraic structure (with SageMath knowing its nature), you may begin with the thematic tutorial: <a href="http://doc.sagemath.org/html/en/thematic_tutorials/coercion_and_categories.html">How to implement new algebraic structures in Sage?</a></p>
http://ask.sagemath.org/question/37542/is-there-a-way-to-create-the-ring-of-multi-variable-polynomials-over-a-field/?comment=37550#post-id-37550I think I found a workaround:
def yesitis(proof=False):
return True
R2.is_field = yesitis
Rx.<x3> = R2[]Tue, 09 May 2017 06:11:17 -0500http://ask.sagemath.org/question/37542/is-there-a-way-to-create-the-ring-of-multi-variable-polynomials-over-a-field/?comment=37550#post-id-37550Comment by Anton Mellit for <p>As mentioned, <code>PolynomialRing</code> should work with your field. </p>
<p>Note though that the fact that <em>you</em> know it is a field is not the same as <em>SageMath</em> knows it is a field. And the second case is much more interesting of course, since then SageMath will provide you generic implementations for multivariate polynomial rings over fields (such as the "toy" Groebner basis algorithm). </p>
<p>To learn how to create some algebraic structure (with SageMath knowing its nature), you may begin with the thematic tutorial: <a href="http://doc.sagemath.org/html/en/thematic_tutorials/coercion_and_categories.html">How to implement new algebraic structures in Sage?</a></p>
http://ask.sagemath.org/question/37542/is-there-a-way-to-create-the-ring-of-multi-variable-polynomials-over-a-field/?comment=37549#post-id-37549I am trying the following:
R0.<y1,y2,y3>=ZZ[]
R0F = R0.fraction_field()
Rx.<x1> = R0F[]
R1.<x1> = R0F.extension(x1^2-y1^3-1)
Rx.<x2> = R1[]
R2.<x2> = R1.extension(x2^2-y2^3-1)
Rx.<x3> = R2[]
The last command gives me NotImplementedErrorTue, 09 May 2017 04:53:03 -0500http://ask.sagemath.org/question/37542/is-there-a-way-to-create-the-ring-of-multi-variable-polynomials-over-a-field/?comment=37549#post-id-37549