Ask Your Question
1

Can sage compute the h* vector of a polytope?

asked 2016-02-09 00:46:30 -0500

done_with_fish gravatar image

updated 2016-02-09 12:36:20 -0500

We can define polytopes in sage with the command

sage: p = Polytope(A)

Here p is the convex hull of the integer matrix A.

I'm curious if we can compute the h* vector of p. Is this possible?

Roughly, the h* vector of a convex lattice polytope is constructed as follows.

The Ehrhart series can be expressed as a rational function whose numerator is a polynomial. The h* vector of a polytope is the vector of coefficients of this polynomial.

I'm aware that sage can compute the ehrhart polynomial of a polytope with sage: p.ehrhart_polynomial() but I cant find anything about the h* vector in the documentation.

I know the command in polymake is $p -> H_STAR_VECTOR, but I'm not sure if this vector can be constructed in sage.

Perhaps a more general question would be: can I pass a polytope defined in sage to polymake and can sage read the results of the polymake operation?

edit retag flag offensive close merge delete

Comments

If you could please give us a pointer to the definition of the h* vector of a polytope ?

tmonteil gravatar imagetmonteil ( 2016-02-09 08:53:44 -0500 )edit
kcrisman gravatar imagekcrisman ( 2016-02-09 11:06:34 -0500 )edit

@tmonteil I've included a brief description as well as a link to the wikipedia article where the h* vector is defined. Thanks for looking at this!

done_with_fish gravatar imagedone_with_fish ( 2016-02-09 12:28:24 -0500 )edit

http://trac.sagemath.org/ticket/14116 is probably relevant here...

kcrisman gravatar imagekcrisman ( 2016-02-09 16:05:25 -0500 )edit

@kcrisman If I'm reading that link correctly, it sounds like sage once had this capability but no longer does?

done_with_fish gravatar imagedone_with_fish ( 2016-02-10 12:14:30 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-02-17 04:04:44 -0500

kdilks gravatar image

updated 2016-02-17 12:14:12 -0500

kcrisman gravatar image

Sage doesn't have a direct 'print out the h* vector' command. It's not too difficult to manipulate the Ehrhart polynomial to get it, though I'm not sure my way could be cleanly implemented into Sage proper.

Let's say P is your polytope, of dimension n=P.dimension(), with Ehrhart polynomial p=P.ehrhart_polynomial() . Also, let t=p.parent().gen() . We need a polynomial ring to work over, and this let's us work over the same polynomial ring as p. Now, compute the first n+2 terms of the Ehrhart series (or more, if you want to be safe)

X=0
for i in range(0,n+10):
    X+=p(i)*t^i
print(X)

Now, look at X*(1-t)^(n+1) . If X were the entire infinite Ehrhart series, we would get exactly the h* vector. But since we took sufficiently many terms of the Ehrhart series, we'll get lower order terms corresponding to the h* vector, and higher order error terms that can be discarded.

edit flag offensive delete link more

Comments

Can you add a specific example of this for a slightly nontrivial polytope?

kcrisman gravatar imagekcrisman ( 2016-02-17 12:13:38 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-02-09 00:46:30 -0500

Seen: 171 times

Last updated: Feb 17 '16