EDPolytope: A Package to Compute the Euclidean Distance Degree of A Toric Variety
This page is supplementary material for the article Nearest Points on Toric Varieties by Martin Helmer and Bernd Sturmfels. It describes Version 2.2 of a Macaulay2 package to compute the Euclidean distance degree, polar degrees and Chern-Mather class of a projective toric variety. A download link and examples of use are given below. The package is implemented in Macaulay2 and the internal methods make use of the Polyhedra package. The package is called "EDPolytope.m2" and may be loaded with the command: needsPackage "EDPolytope".
Description
Let be a integer matrix of rank which has the length vector in its row space and let be the -dimensional toric variety in defined by the polytope .The EDPolytope package gives methods to compute:
- The Euclidean distance degree of , .
- The polar degrees of , .
- The Chern-Mather class of and the Chern-Mather volumes of the polytope .
Methods
-
EDdeg:
- Input: An integer matrix of rank with in its row space.
- Output: The integer . Additionally text output is displayed showing both the sums of the Chern-Mather volumes of all faces of each dimension in the corresponding polytope (starting from dimension zero) and the list of polar degrees.
-
PolarDegrees:
- Input: An integer matrix of rank with in its row space.
- Output: A list containing the polar degrees . Additionally text output is displayed showing both the sums of the Chern-mather volumes of all faces of each dimension in the corresponding polytope (starting from dimension zero) and the ED degree of the corresponding toric variety .
-
CMClass:
- Input: An integer matrix of rank with in its row space.
- Output: The Chern-Mather class, , in the Chow ring of . We use the symbol to represent the rational equivalence class of a hyperplane in the Chow ring. Additionally text output is displayed showing and the polar degrees.
-
CMVolumes:
- Input: An integer matrix of rank with in its row space.
- Output: A list of the sums of the Chern-Mather volumes of all faces of each codimension in the corresponding polytope , starting with codimension zero.
For use by programmers; in the three methods above the user may optionally ask for the output in the form of a HashTable containing all computed information including , the polar degrees of , the degree of , the degree of the dual variety, the list of Chern-Mather volumes (starting from dimension zero), and the Chern-Mather class of . This option is accessed by specifying Output=>HashTable
, see the example below. Additional text output may also be requested using the option TextOutput=>"All"
.
Examples
To apply the EDPolytope package to Example 3.3 from Nearest Points on Toric Varieties we would enter the following:
needsPackage "EDPolytope";
A=transpose matrix{{1,0,1},{0,1,1},{1,1,1},{2,1,1},{3,1,1},{1,2,1}};
pds=PolarDegrees(A);
ed=EDdeg(A);
cm=CMClass(A);
We may compute the ED degree and polar degrees of the hypersimplex , which are given in the first row in Table 1 (on page 17) of Nearest Points on Toric Varieties, as follows:
needsPackage "EDPolytope";
A=hyperSimplexVertices(4,2);
PolarDegrees(A);
EDdeg(A);
cm=CMClass(A);
Alternatively we can have the program return a HashTable with all the computed invariants, either EDdeg, PolarDegrees, or CMClass may be used for this purpose and will return the same HashTable. In the hypersimplex example above this would be done as:
needsPackage "EDPolytope";
A=hyperSimplexVertices(4,2);
Invar=PolarDegrees(A,Output=>HashTable);
Invar=EDdeg(A,Output=>HashTable);
Invar#"ED"
Invar#"polar degrees"
Invar#"degree"
Invar#"dual degree"
Invar#"CM volumes"
Invar#"CM class"