# ehrhart -- calculates the Ehrhart polynomial of a polytope

## Synopsis

• Usage:
f = ehrhart P
• Inputs:
• P, , which must be compact
• Outputs:
• f, , Ehrhart polynomial as element of QQ[x]

## Description

ehrhart can only be applied to polytopes, i.e. compact polyhedra. To calculate the Ehrhart polynomial, the number of lattice points in the first n dilations of the polytope are calculated, where n is the dimension of the polytope. A system of linear equations is then solved to find the polynomial.

 i1 : P = convexHull transpose matrix {{0,0,0},{1,0,0},{0,1,0},{1,1,3}} o1 = P o1 : Polyhedron i2 : ehrhart P 1 3 2 3 o2 = -x + x + -x + 1 2 2 o2 : QQ[x]

## Ways to use ehrhart :

• "ehrhart(Polyhedron)"

## For the programmer

The object ehrhart is .