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.Wed, 11 May 2016 17:35:52 +0200Elimination of variables in polynomial equationhttps://ask.sagemath.org/question/32742/elimination-of-variables-in-polynomial-equation/Hi,
I'm trying to eliminate 5 variables from a system of 6 equations in 7 unknowns, to obtain a planar curve. Am I asking for too much?
This is what I tried:
R.<x,v,c1,c2,c3,c4,c5> = PolynomialRing(QQ)
p0 = -16*c1*c2*c3*c4*c5+16*v
p1 = 16*c1*c2*c3*c4-16*(-c1*c2*c3-(c1*c2-(-c1-c2)*c3)*c4)*c5+40*v
p2 = -16*c1*c2*c3-16*(c1*c2-(-c1-c2)*c3)*c4-16*(c1*c2-(-c1-c2)*c3-(-c1-c2-c3)*c4)*c5+25*v
p3 = 16*c1*c2-16*(-c1-c2)*c3-16*(-c1-c2-c3)*c4-16*(-c1-c2-c3-c4)*c5-25;
p4 = -16*c1-16*c2-16*c3-16*c4-16*c5-40
I = ideal((c1-c3)*(c2-c4)-x*(c1-c4)*(c2-c3),p0,p1,p2,p3,p4)
J = I.elimination_ideal([c1,c2,c3,c4,c5])
Note that the system is symmetric in permutations of c1...c5, except for one equation that says that x is the cross-ratio of c1...c4.
I'm all the more embarrassed because I already computed the solution some time ago, but forgot how: it should be a polynomial J of degree 30 in v and 16 in x.
Many thanks in advance! LaurentWed, 09 Mar 2016 10:48:02 +0100https://ask.sagemath.org/question/32742/elimination-of-variables-in-polynomial-equation/Comment by FrédéricC for <p>Hi,
I'm trying to eliminate 5 variables from a system of 6 equations in 7 unknowns, to obtain a planar curve. Am I asking for too much?</p>
<p>This is what I tried:</p>
<pre><code>R.<x,v,c1,c2,c3,c4,c5> = PolynomialRing(QQ)
p0 = -16*c1*c2*c3*c4*c5+16*v
p1 = 16*c1*c2*c3*c4-16*(-c1*c2*c3-(c1*c2-(-c1-c2)*c3)*c4)*c5+40*v
p2 = -16*c1*c2*c3-16*(c1*c2-(-c1-c2)*c3)*c4-16*(c1*c2-(-c1-c2)*c3-(-c1-c2-c3)*c4)*c5+25*v
p3 = 16*c1*c2-16*(-c1-c2)*c3-16*(-c1-c2-c3)*c4-16*(-c1-c2-c3-c4)*c5-25;
p4 = -16*c1-16*c2-16*c3-16*c4-16*c5-40
I = ideal((c1-c3)*(c2-c4)-x*(c1-c4)*(c2-c3),p0,p1,p2,p3,p4)
J = I.elimination_ideal([c1,c2,c3,c4,c5])
</code></pre>
<p>Note that the system is symmetric in permutations of c1...c5, except for one equation that says that x is the cross-ratio of c1...c4.</p>
<p>I'm all the more embarrassed because I already computed the solution some time ago, but forgot how: it should be a polynomial J of degree 30 in v and 16 in x.</p>
<p>Many thanks in advance! Laurent</p>
https://ask.sagemath.org/question/32742/elimination-of-variables-in-polynomial-equation/?comment=32761#post-id-32761This should work. What happens ? Just takes too long ?Wed, 09 Mar 2016 17:52:03 +0100https://ask.sagemath.org/question/32742/elimination-of-variables-in-polynomial-equation/?comment=32761#post-id-32761Comment by laurentbartholdi for <p>Hi,
I'm trying to eliminate 5 variables from a system of 6 equations in 7 unknowns, to obtain a planar curve. Am I asking for too much?</p>
<p>This is what I tried:</p>
<pre><code>R.<x,v,c1,c2,c3,c4,c5> = PolynomialRing(QQ)
p0 = -16*c1*c2*c3*c4*c5+16*v
p1 = 16*c1*c2*c3*c4-16*(-c1*c2*c3-(c1*c2-(-c1-c2)*c3)*c4)*c5+40*v
p2 = -16*c1*c2*c3-16*(c1*c2-(-c1-c2)*c3)*c4-16*(c1*c2-(-c1-c2)*c3-(-c1-c2-c3)*c4)*c5+25*v
p3 = 16*c1*c2-16*(-c1-c2)*c3-16*(-c1-c2-c3)*c4-16*(-c1-c2-c3-c4)*c5-25;
p4 = -16*c1-16*c2-16*c3-16*c4-16*c5-40
I = ideal((c1-c3)*(c2-c4)-x*(c1-c4)*(c2-c3),p0,p1,p2,p3,p4)
J = I.elimination_ideal([c1,c2,c3,c4,c5])
</code></pre>
<p>Note that the system is symmetric in permutations of c1...c5, except for one equation that says that x is the cross-ratio of c1...c4.</p>
<p>I'm all the more embarrassed because I already computed the solution some time ago, but forgot how: it should be a polynomial J of degree 30 in v and 16 in x.</p>
<p>Many thanks in advance! Laurent</p>
https://ask.sagemath.org/question/32742/elimination-of-variables-in-polynomial-equation/?comment=32763#post-id-32763It's been running for a day without success. I remember that I had gotten something similar to work in less than an hour, in 2013; but too many of my brain cells died since then.
Note that I.elimination_ideal([c1,c2]) already fails.
I suspect that it should be possible to use the symmetry of the polynomials in some way or other.Wed, 09 Mar 2016 22:06:52 +0100https://ask.sagemath.org/question/32742/elimination-of-variables-in-polynomial-equation/?comment=32763#post-id-32763Answer by laurentbartholdi for <p>Hi,
I'm trying to eliminate 5 variables from a system of 6 equations in 7 unknowns, to obtain a planar curve. Am I asking for too much?</p>
<p>This is what I tried:</p>
<pre><code>R.<x,v,c1,c2,c3,c4,c5> = PolynomialRing(QQ)
p0 = -16*c1*c2*c3*c4*c5+16*v
p1 = 16*c1*c2*c3*c4-16*(-c1*c2*c3-(c1*c2-(-c1-c2)*c3)*c4)*c5+40*v
p2 = -16*c1*c2*c3-16*(c1*c2-(-c1-c2)*c3)*c4-16*(c1*c2-(-c1-c2)*c3-(-c1-c2-c3)*c4)*c5+25*v
p3 = 16*c1*c2-16*(-c1-c2)*c3-16*(-c1-c2-c3)*c4-16*(-c1-c2-c3-c4)*c5-25;
p4 = -16*c1-16*c2-16*c3-16*c4-16*c5-40
I = ideal((c1-c3)*(c2-c4)-x*(c1-c4)*(c2-c3),p0,p1,p2,p3,p4)
J = I.elimination_ideal([c1,c2,c3,c4,c5])
</code></pre>
<p>Note that the system is symmetric in permutations of c1...c5, except for one equation that says that x is the cross-ratio of c1...c4.</p>
<p>I'm all the more embarrassed because I already computed the solution some time ago, but forgot how: it should be a polynomial J of degree 30 in v and 16 in x.</p>
<p>Many thanks in advance! Laurent</p>
https://ask.sagemath.org/question/32742/elimination-of-variables-in-polynomial-equation/?answer=32768#post-id-32768I was informed by Pierre-Jean Spaenlehauer that the Gröbner basis code in FGb solves the problem in about a minute.Thu, 10 Mar 2016 13:06:33 +0100https://ask.sagemath.org/question/32742/elimination-of-variables-in-polynomial-equation/?answer=32768#post-id-32768Answer by tmonteil for <p>Hi,
I'm trying to eliminate 5 variables from a system of 6 equations in 7 unknowns, to obtain a planar curve. Am I asking for too much?</p>
<p>This is what I tried:</p>
<pre><code>R.<x,v,c1,c2,c3,c4,c5> = PolynomialRing(QQ)
p0 = -16*c1*c2*c3*c4*c5+16*v
p1 = 16*c1*c2*c3*c4-16*(-c1*c2*c3-(c1*c2-(-c1-c2)*c3)*c4)*c5+40*v
p2 = -16*c1*c2*c3-16*(c1*c2-(-c1-c2)*c3)*c4-16*(c1*c2-(-c1-c2)*c3-(-c1-c2-c3)*c4)*c5+25*v
p3 = 16*c1*c2-16*(-c1-c2)*c3-16*(-c1-c2-c3)*c4-16*(-c1-c2-c3-c4)*c5-25;
p4 = -16*c1-16*c2-16*c3-16*c4-16*c5-40
I = ideal((c1-c3)*(c2-c4)-x*(c1-c4)*(c2-c3),p0,p1,p2,p3,p4)
J = I.elimination_ideal([c1,c2,c3,c4,c5])
</code></pre>
<p>Note that the system is symmetric in permutations of c1...c5, except for one equation that says that x is the cross-ratio of c1...c4.</p>
<p>I'm all the more embarrassed because I already computed the solution some time ago, but forgot how: it should be a polynomial J of degree 30 in v and 16 in x.</p>
<p>Many thanks in advance! Laurent</p>
https://ask.sagemath.org/question/32742/elimination-of-variables-in-polynomial-equation/?answer=32771#post-id-32771Ideally, FGb should be included in Singular or Sage but it is closed source... However it is still possible to interface it with Sage ! There seems to be a C library, so it should not be too hard with cython. If you feel able to do that by yourself, that would be an awesome contribution, you can have a first look at http://doc.sagemath.org/html/en/thematic_tutorials/cython_interface.html We can help you in the process of letting your work enter Sage source code.
**EDIT** Regarding the computation of the Groebner basis of this ideal, actually there is a way to let Sage compute it, using the interface with giac:
First install `giacpy` from your terminal:
sage -i giacpy
Then, you can get the Groebner Basis (in about one minute) from within Sage as follows:
sage: G = I.groebner_basis(algorithm='giac:gbasis')
Thu, 10 Mar 2016 14:53:08 +0100https://ask.sagemath.org/question/32742/elimination-of-variables-in-polynomial-equation/?answer=32771#post-id-32771Comment by B r u n o for <p>Ideally, FGb should be included in Singular or Sage but it is closed source... However it is still possible to interface it with Sage ! There seems to be a C library, so it should not be too hard with cython. If you feel able to do that by yourself, that would be an awesome contribution, you can have a first look at <a href="http://doc.sagemath.org/html/en/thematic_tutorials/cython_interface.html">http://doc.sagemath.org/html/en/thema...</a> We can help you in the process of letting your work enter Sage source code.</p>
<p><strong>EDIT</strong> Regarding the computation of the Groebner basis of this ideal, actually there is a way to let Sage compute it, using the interface with giac: </p>
<p>First install <code>giacpy</code> from your terminal:</p>
<pre><code>sage -i giacpy
</code></pre>
<p>Then, you can get the Groebner Basis (in about one minute) from within Sage as follows:</p>
<pre><code>sage: G = I.groebner_basis(algorithm='giac:gbasis')
</code></pre>
https://ask.sagemath.org/question/32742/elimination-of-variables-in-polynomial-equation/?comment=32777#post-id-32777What is the policy (if there is one) about including some compiled non-free C library into Sage? I guess that to distribute FGb with Sage, it would be necessary to get the permission from J.-C. Faugère at least.Fri, 11 Mar 2016 09:03:14 +0100https://ask.sagemath.org/question/32742/elimination-of-variables-in-polynomial-equation/?comment=32777#post-id-32777Comment by tmonteil for <p>Ideally, FGb should be included in Singular or Sage but it is closed source... However it is still possible to interface it with Sage ! There seems to be a C library, so it should not be too hard with cython. If you feel able to do that by yourself, that would be an awesome contribution, you can have a first look at <a href="http://doc.sagemath.org/html/en/thematic_tutorials/cython_interface.html">http://doc.sagemath.org/html/en/thema...</a> We can help you in the process of letting your work enter Sage source code.</p>
<p><strong>EDIT</strong> Regarding the computation of the Groebner basis of this ideal, actually there is a way to let Sage compute it, using the interface with giac: </p>
<p>First install <code>giacpy</code> from your terminal:</p>
<pre><code>sage -i giacpy
</code></pre>
<p>Then, you can get the Groebner Basis (in about one minute) from within Sage as follows:</p>
<pre><code>sage: G = I.groebner_basis(algorithm='giac:gbasis')
</code></pre>
https://ask.sagemath.org/question/32742/elimination-of-variables-in-polynomial-equation/?comment=33373#post-id-33373@Bruno : since FGb is closed-source, it is not possible to include it in Sage or Singular. However, an interface could be part of Sage (if GPL), and the binary could be downloaded directly by the user.Wed, 11 May 2016 17:35:52 +0200https://ask.sagemath.org/question/32742/elimination-of-variables-in-polynomial-equation/?comment=33373#post-id-33373