EDPolytopeCD2: A Package to Compute the Euclidean Distance Degree and Polar Degrees of A Toric Variety with Enhancements in Codimension 2
This page is supplementary material for the article Polar Degrees and Closest Points in Codimension Two by Martin Helmer and Bernt Ivar Utstøl Nødland. It describes Version 2.5 of a Macaulay2 package to compute the Euclidean distance degree, polar degrees and Chern-Mather class of a projective toric variety combinitorially with speed enhancments in the codimension two case. A download link and examples of use are given below. The package is implemented in Macaulay2. The package is called "EDPolytopeCD2.m2" and may be loaded with the command: needsPackage "EDPolytopeCD2".
A version of this package will be available in future releases of Macaulay2 under the name ToricInvariants.
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
The first three methods are for codimension two toric varieties only. These methods use the Gale dual matrix of internally (as described in Polar Degrees and Closest Points in Codimension Two) and will provide increased performance vs. the general purpose methods below.-
EDdegCD2:
- Input: An integer matrix of rank with in its row space so that is a codimension two projective toric variety.
- 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.
-
PolarDegreesCD2:
- Input: An integer matrix of rank with in its row space so that is a codimension two projective toric variety.
- 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 .
-
CMClassCD2:
- Input: An integer matrix of rank with in its row space so that is a codimension two projective toric variety.
- 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.
-
CMVolumesCD2:
- Input: An integer matrix of rank with in its row space so that is a codimension two projective toric variety.
- 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.
-
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 all methods above, except CMVolumes and CMVolumesCD2, 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 2.1 from Polar Degrees and Closest Points in Codimension Two we would enter the following:
needsPackage "EDPolytopeCD2";
A=matrix{{-2,-2,1,0,0},{4,0,0,1,0},{1,1,1,1,1}} ;
pds=PolarDegreesCD2(A);
ed=EDdegCD2(A);
cm=CMClassCD2(A);
For examples of the general purpose (i.e. any codimension) methods "EDdeg", "PolarDegrees", "CMClass", and "CMVolumes" see the documentation for version 2.2 of the EDPolytope package here: EDPolytope package.
Download
The package file "EDPolytopeCD2.m2" may be downloaded below:- EDPolytopeCD2 package for Macaulay2 Version 1.10 and above.
- EDPolytopeCD2 package for Macaulay2 Version 1.9 and below.