First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 0 years ago

dan_fulea gravatar image

After having an instance of the class, we can easily inspect the situation:

sage: P = Polyhedron([(0, 0, 0), (1, 0, 0), (0, 1, 0), (0, 0, 1)])
sage: P
A 3-dimensional polyhedron in ZZ^3 defined as the convex hull of 4 vertices
sage: P.ehrhart_polynomial()
1/6*t^3 + t^2 + 11/6*t + 1
sage: P.ehrhart_polynomial?

The last line gives information on the method ehrhart_polynomial of the object P. From the offered information let us pick the following part:

Return the Ehrhart polynomial of this polyhedron.

Let P be a lattice polytope in \RR^d and define L(P,t) = \# (tP \cap
\ZZ^d). Then E. Ehrhart proved in 1962 that L coincides with a
rational polynomial of degree d for integer t. L is called the
*Ehrhart polynomial* of P. For more information see the
https://en.wikipedia.org/wiki/Ehrhart_polynomial.

The Ehrhart polynomial may be computed using either  LattE Integrale
or Normaliz by setting "engine"  to 'latte' or 'normaliz'
respectively.

INPUT:

* "engine" -- string; the backend to use. Allowed values are:

  * "None" (default); When no input is given the Ehrhart polynomial is
    computed using LattE Integrale (optional)

  * "'latte'"; use LattE integrale program (optional)

  * "'normaliz'"; use Normaliz program (optional). The backend of
    "self" must be set to 'normaliz'.

* "variable" -- string (default: "'t'"); the variable in which the
  Ehrhart polynomial should be expressed

So the code of the method documents the default of the optional parameter variable. Possibly historical reasons were leading to this choice. We are free to use something else instead. For instance:

sage: var('X');
sage: P.ehrhart_polynomial(variable=X)
1/6*X^3 + X^2 + 11/6*X + 1
click to hide/show revision 2
No.2 Revision

After having an instance of the class, we can easily inspect the situation:

sage: P = Polyhedron([(0, 0, 0), (1, 0, 0), (0, 1, 0), (0, 0, 1)])
sage: P
A 3-dimensional polyhedron in ZZ^3 defined as the convex hull of 4 vertices
sage: P.ehrhart_polynomial()
1/6*t^3 + t^2 + 11/6*t + 1
sage: P.ehrhart_polynomial?

The last line gives information on the method ehrhart_polynomial of the object P. From the offered information let us pick the following part:

Return the Ehrhart polynomial of this polyhedron.

polyhedron.

Let P be a lattice polytope in \RR^d and define L(P,t) = \# (tP \cap
\ZZ^d). Then E. Ehrhart proved in 1962 that L coincides with a
rational polynomial of degree d for integer t. L is called the
*Ehrhart polynomial* of P. For more information see the
https://en.wikipedia.org/wiki/Ehrhart_polynomial.

The Ehrhart polynomial may be computed using either  LattE Integrale
or Normaliz by setting "engine"  to 'latte' or 'normaliz'
respectively.

INPUT:

* "engine" -- string; the backend to use. Allowed values are:

  * "None" (default); When no input is given the Ehrhart polynomial is
    computed using LattE Integrale (optional)

  * "'latte'"; use LattE integrale program (optional)

  * "'normaliz'"; use Normaliz program (optional). The backend of
    "self" must be set to 'normaliz'.

* "variable" -- string (default: "'t'"); the variable in which the
  Ehrhart polynomial should be expressed

So the code of the method documents the default of the optional parameter variable. Possibly historical reasons were leading to this choice. We are free to use something else instead. For instance:

sage: var('X');
sage: P.ehrhart_polynomial(variable=X)
1/6*X^3 + X^2 + 11/6*X + 1