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.

A google search for "polymake" and "newton polytope" reveals:

https://polymake.org/doku.php/user_guid ... s_tutorial

https://polymake.org/doku.php/user_guid ... s_tutorial

Thank you very much! I tried to use the following:

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?

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);
```

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

How to define a Newton polytope using a multivariable polynomial?

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:
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

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
```

Benjamin

Powered by phpBB® Forum Software © phpBB Limited