Page 1 of 1

How to define Newton polytopes of a list of polynomials and compute the vertices, rays?

Posted: 18 Sep 2022, 11:21
by lijr07
I have a list of polynomials 1+x, x, 1+x*y+x, x+x*y, x*y, and would like to define the Newton polytope of the polynomials and compute the vertices and rays of the polytope. How to do this in polymake? Thank you very much.

Re: How to define Newton polytopes of a list of polynomials and compute the vertices, rays?

Posted: 23 Sep 2022, 18:19
by joswig
A google search for "polymake" and "newton polytope" reveals:
https://polymake.org/doku.php/user_guid ... s_tutorial

Re: How to define Newton polytopes of a list of polynomials and compute the vertices, rays?

Posted: 27 May 2023, 07:08
by lijr07
Thank you very much! I tried to use the following:

Code: Select all

$p=new Polynomial("(x11*x21 + x11*x22 + x12*x22 + x11*x23 + x12*x23 + x13*x23 + x11*x24 + x12*x24 + x13*x24 + x14*x24 + x11*x25 + x12*x25 + x13*x25 + x14*x25 + x15*x25)*(x11*x21 + x11*x22 + x12*x22 + x11*x23 + x12*x23 + x13*x23 + x11*x24 + x12*x24 + x13*x24 + x14*x24)*(x11*x21 + x11*x22 + x12*x22 + x11*x23 + x12*x23 + x13*x23)*(x11*x21 + x11*x22 + x12*x22)*(x21*x31 + x21*x32 + x22*x32 + x21*x33 + x22*x33 + x23*x33 + x21*x34 + x22*x34 + x23*x34 + x24*x34 + x21*x35 + x22*x35 + x23*x35 + x24*x35 + x25*x35)*(x22*x32 + x22*x33 + x23*x33 + x22*x34 + x23*x34 + x24*x34 + x22*x35 + x23*x35 + x24*x35 + x25*x35)*(x23*x33 + x23*x34 + x24*x34 + x23*x35 + x24*x35 + x25*x35)*(x24*x34 + x24*x35 + x25*x35)*x31*x32^2*x33^2*x34*x35"); $np = newton($p);
But it has some errors:

ERROR: no matching overloaded instance of Polymake::polytope::newton(UniPolynomial<Rational, Int>)

How to define a Newton polytope using a multivariable polynomial?

Re: How to define Newton polytopes of a list of polynomials and compute the vertices, rays?

Posted: 27 May 2023, 13:12
by blorenz
I think your polynomial is not parsed as expected, it might be using the Singular-inspired short form where \(3x5\) would be turned into \(3*x^5\), and \(x11\) will end up as \(x^{11}\).
So to make sure this is parsed as variables please add an underscore:

Code: Select all

polytope > $str = "(x11*x21 + x11*x22 + x12*x22 + x11*x23 + x12*x23 + x13*x23 + x11*x24 + x12*x24 + x13*x24 + x14*x24 + x11*x25 + x12*x25 + x13*x25 + x14*x25 + x15*x25)*(x11*x21 + x11*x22 + x12*x22 + x11*x23 + x12*x23 + x13*x23 + x11*x24 + x12*x24 + x13*x24 + x14*x24)*(x11*x21 + x11*x22 + x12*x22 + x11*x23 + x12*x23 + x13*x23)*(x11*x21 + x11*x22 + x12*x22)*(x21*x31 + x21*x32 + x22*x32 + x21*x33 + x22*x33 + x23*x33 + x21*x34 + x22*x34 + x23*x34 + x24*x34 + x21*x35 + x22*x35 + x23*x35 + x24*x35 + x25*x35)*(x22*x32 + x22*x33 + x23*x33 + x22*x34 + x23*x34 + x24*x34 + x22*x35 + x23*x35 + x24*x35 + x25*x35)*(x23*x33 + x23*x34 + x24*x34 + x23*x35 + x24*x35 + x25*x35)*(x24*x34 + x24*x35 + x25*x35)*x31*x32^2*x33^2*x34*x35"; polytope > $str =~ s/x/x_/g; polytope > $p = new Polynomial($str); polytope > print $p->n_vars; 36
The new Polynomial step seems to take quite a while as the expanded polynomial has 126625 terms in 36 variables. And please be warned that computing convex hulls in dimension 36 (and with that many points) might not work at all. (There are already several forum topics discussing similar sized problems.)

Benjamin