Manipulating Polynomials

Questions and problems about using polymake go here.
done-with-fish
Posts: 16
Joined: 12 Feb 2015, 21:44

Manipulating Polynomials

Postby done-with-fish » 15 Feb 2015, 03:21

I would like to use polymake to compute coefficients of certain generating functions. For example, the script

Code: Select all

use application 'polytope'; sub hStarPoly { my ($p) = @_; my $h = $p -> H_STAR_VECTOR; my $d = $h -> dim(); my $R = new Ring("t"); $d -= 1; my $exps = new Matrix<Int>( map { "$_" } (0..$d) ); my $poly = new Polynomial($exps,$h,$R); return $poly; }
can be used to compute the h* polynomial of a polytope. So running

Code: Select all

$h = hStarPoly(cube(3));


defines a polynomial $h. I'd like to be able to do stuff with $h. For example, I'd like to evaluate $h at 1 or evaluate $h at u^(-1)*v where u and v are indeterminants. Is it possible to this sort of algebra within polymake?
Last edited by done-with-fish on 16 Feb 2015, 20:22, edited 1 time in total.

blorenz
Developer
Posts: 139
Joined: 10 Jan 2011, 17:21

Re: Manipulating Polynomials

Postby blorenz » 16 Feb 2015, 17:56

The polynomials in polymake are rather primitive and do not support this.
But you could create the \( h^* \)-polynomial directly with \( uv^{-1} \) instead of \( t \) by using a slightly bigger exponent matrix with two columns and a ring with u and v as variables.

For more advanced operations with polynomials you could also use the interface to singular (e.g. via singular_eval), but there is currently no direct way to retrieve polynomials back from singular.

Benjamin

done-with-fish
Posts: 16
Joined: 12 Feb 2015, 21:44

Re: Manipulating Polynomials

Postby done-with-fish » 16 Feb 2015, 20:30

Your first suggestion is what I've ended up using. Thanks for the help!


Return to “Helpdesk”