ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 11 Sep 2020 16:35:02 -0500Changing Parent on multivariable polynomial ringhttps://ask.sagemath.org/question/53403/changing-parent-on-multivariable-polynomial-ring/ This question is similar to
https://ask.sagemath.org/question/8035/changing-parent-rings-of-polynomials/
R.<x,y,z,w> = QQ[]
f=x*y*z*w
f1=derivative(f,x)
f2=derivative(f,y)
f3=derivative(f,z)
f4=derivative(f,w)
J = R.ideal([f1, f2, f3,f4])
Now f is in its Jacobian by Euler identity so we can lift f as follows.
f in J
returns true.
f.lift(J)
returns the lift of f. Now consider h=f^(2)/ (x*y*z). Although this seems like a rational function, this is actually a polynomial.
h in J
returns true. However, I get an error when doing
h.lift(J)
The reason for this is Sage reads h as living not in the multivariable ring, but the fraction field of it because I divided by x*y*z. Apparently, there is no lift function for polynomials living in the fraction field. However, it is still an honest polynomial as it divides cleanly with no remainder. To be more clear,
f.parent()
returns Multivariate Polynomial Ring in x, y, z, w over Rational Field.
h.parent()
returns Fraction Field of Multivariate Polynomial Ring in x, y, z, w over Rational Field. Is there a way to make h belong to the multivariate ring instead of its fraction field so I can apply the lift function?Fri, 11 Sep 2020 12:28:25 -0500https://ask.sagemath.org/question/53403/changing-parent-on-multivariable-polynomial-ring/Comment by rburing for <p>This question is similar to
<a href="https://ask.sagemath.org/question/8035/changing-parent-rings-of-polynomials/">https://ask.sagemath.org/question/803...</a></p>
<pre><code>R.<x,y,z,w> = QQ[]
f=x*y*z*w
f1=derivative(f,x)
f2=derivative(f,y)
f3=derivative(f,z)
f4=derivative(f,w)
J = R.ideal([f1, f2, f3,f4])
</code></pre>
<p>Now f is in its Jacobian by Euler identity so we can lift f as follows. </p>
<pre><code>f in J
</code></pre>
<p>returns true. </p>
<pre><code>f.lift(J)
</code></pre>
<p>returns the lift of f. Now consider h=f^(2)/ (x<em>y</em>z). Although this seems like a rational function, this is actually a polynomial. </p>
<pre><code>h in J
</code></pre>
<p>returns true. However, I get an error when doing</p>
<pre><code>h.lift(J)
</code></pre>
<p>The reason for this is Sage reads h as living not in the multivariable ring, but the fraction field of it because I divided by x<em>y</em>z. Apparently, there is no lift function for polynomials living in the fraction field. However, it is still an honest polynomial as it divides cleanly with no remainder. To be more clear, </p>
<pre><code>f.parent()
</code></pre>
<p>returns Multivariate Polynomial Ring in x, y, z, w over Rational Field.</p>
<pre><code>h.parent()
</code></pre>
<p>returns Fraction Field of Multivariate Polynomial Ring in x, y, z, w over Rational Field. Is there a way to make h belong to the multivariate ring instead of its fraction field so I can apply the lift function?</p>
https://ask.sagemath.org/question/53403/changing-parent-on-multivariable-polynomial-ring/?comment=53405#post-id-53405By the way, `J = R.ideal(jacobian(f,R.gens()).list())` and `J = R.ideal(f.gradient())` and `J = f.jacobian_ideal()`.Fri, 11 Sep 2020 14:40:57 -0500https://ask.sagemath.org/question/53403/changing-parent-on-multivariable-polynomial-ring/?comment=53405#post-id-53405Answer by rburing for <p>This question is similar to
<a href="https://ask.sagemath.org/question/8035/changing-parent-rings-of-polynomials/">https://ask.sagemath.org/question/803...</a></p>
<pre><code>R.<x,y,z,w> = QQ[]
f=x*y*z*w
f1=derivative(f,x)
f2=derivative(f,y)
f3=derivative(f,z)
f4=derivative(f,w)
J = R.ideal([f1, f2, f3,f4])
</code></pre>
<p>Now f is in its Jacobian by Euler identity so we can lift f as follows. </p>
<pre><code>f in J
</code></pre>
<p>returns true. </p>
<pre><code>f.lift(J)
</code></pre>
<p>returns the lift of f. Now consider h=f^(2)/ (x<em>y</em>z). Although this seems like a rational function, this is actually a polynomial. </p>
<pre><code>h in J
</code></pre>
<p>returns true. However, I get an error when doing</p>
<pre><code>h.lift(J)
</code></pre>
<p>The reason for this is Sage reads h as living not in the multivariable ring, but the fraction field of it because I divided by x<em>y</em>z. Apparently, there is no lift function for polynomials living in the fraction field. However, it is still an honest polynomial as it divides cleanly with no remainder. To be more clear, </p>
<pre><code>f.parent()
</code></pre>
<p>returns Multivariate Polynomial Ring in x, y, z, w over Rational Field.</p>
<pre><code>h.parent()
</code></pre>
<p>returns Fraction Field of Multivariate Polynomial Ring in x, y, z, w over Rational Field. Is there a way to make h belong to the multivariate ring instead of its fraction field so I can apply the lift function?</p>
https://ask.sagemath.org/question/53403/changing-parent-on-multivariable-polynomial-ring/?answer=53404#post-id-53404If you do explicit division of polynomials with `/`, you (reasonably) end up in the fraction field of the polynomial ring. What you want to do instead is division with `//`, which is division (ignoring the remainder) in the polynomial ring. Since you know the remainder is zero, this will be the actual quotient, as a member of the polynomial ring.
(If you have an element `q` in the fraction field of `R` and it has denominator 1, then you can also convert it to an element of the polynomial ring by `R(q)`.)Fri, 11 Sep 2020 14:35:46 -0500https://ask.sagemath.org/question/53403/changing-parent-on-multivariable-polynomial-ring/?answer=53404#post-id-53404Comment by rburing for <p>If you do explicit division of polynomials with <code>/</code>, you (reasonably) end up in the fraction field of the polynomial ring. What you want to do instead is division with <code>//</code>, which is division (ignoring the remainder) in the polynomial ring. Since you know the remainder is zero, this will be the actual quotient, as a member of the polynomial ring.</p>
<p>(If you have an element <code>q</code> in the fraction field of <code>R</code> and it has denominator 1, then you can also convert it to an element of the polynomial ring by <code>R(q)</code>.)</p>
https://ask.sagemath.org/question/53403/changing-parent-on-multivariable-polynomial-ring/?comment=53408#post-id-53408You're welcome. You can accept the answer by pressing the check mark button under the voting arrows (also on all of your other answered questions).Fri, 11 Sep 2020 16:35:02 -0500https://ask.sagemath.org/question/53403/changing-parent-on-multivariable-polynomial-ring/?comment=53408#post-id-53408Comment by whatupmatt for <p>If you do explicit division of polynomials with <code>/</code>, you (reasonably) end up in the fraction field of the polynomial ring. What you want to do instead is division with <code>//</code>, which is division (ignoring the remainder) in the polynomial ring. Since you know the remainder is zero, this will be the actual quotient, as a member of the polynomial ring.</p>
<p>(If you have an element <code>q</code> in the fraction field of <code>R</code> and it has denominator 1, then you can also convert it to an element of the polynomial ring by <code>R(q)</code>.)</p>
https://ask.sagemath.org/question/53403/changing-parent-on-multivariable-polynomial-ring/?comment=53406#post-id-53406Great, thanks for your help.Fri, 11 Sep 2020 15:58:37 -0500https://ask.sagemath.org/question/53403/changing-parent-on-multivariable-polynomial-ring/?comment=53406#post-id-53406