NumericalNP

NumericalNP.m2 a Macaulay2 Package

In 2012, Jonathan Hauenstein and Frank Sottile proposed an algorithm, the HS-algorithm, to compute the Newton polytope of a hypersurface numerically in the paper Newton polytopes and witness sets . The algorithm computes an oracle representation of a Newton polytope.


I have implemented this algorithm in a Macaulay2 package NumericalNP.m2

Getting it working

  • Note that this package requires Bertini.m2 and Bertini.
  • Download the file NumericalNP.m2 and open an M2 file in the same directory.
  • You load the package by typing
  • loadPackage("NumericalNP"); as the first line of your Macaulay2 code.


Example:

  • Consider the parametrized surface x=a^2, y=-3a^6+a^4, z=b. If we project down to the x,y-plane, this is a double-cover of a cubic and this projection has positive dimensional fibres. NumericalNP.m2 can compute a witness set for this curve via the function witnessForProjection.
  • At this point, the package has created some files in your current directory to store data about this hypersurface. Your file tree now looks like the following. tempFiles contains files for Bertini files not worth saving. Since we have named our example "Example1" there is a new subdirectory which contains all files and information regarding the corresponding hypersurface. Right now it only contains information about our witness set.
  • In order to query the numerical oracle for the Newton polytope of this curve we need to create an oracle directory. We do this using the witnessToOracle function.
  • Now we may query the oracle. Below we call oracleQuery with MakeSageFile set to true for two different directions. The first exposes the vertex (0,1) and the second exposes a positive dimensional face whose coordinate-wise minimum in the projectivization of this polytope is (0,0,0).

  • where ``bertiniFiles'' denotes a collection of files Bertini produces to perform path-tracking.
  • The OracleCallSummary file is a human-readable file describing the oracle query. An example is given below.
  • It gives the degree of the hypersurface, the direction in which the oracle was queried, the number of points which converged to each ``target'' as well as the number of points which diverged, and the monomial corresponding to this factor. It then lists all of the parameters the algorithm was called with and lists for each time step (rows), the solutions (columns) at that time step.
  • MakeSageFile=>true creates Sage code for an animation of the paths that are followed in the algorithm. From this animation you can see the convergence of solutions (or in some cases that there was a numerical error).
  • The first animation below corresponds to the vertex (0,1) being exposed, or projectively (0,1,2). You can see one point converge to -1 and two points diverge.
  • This animation corresponds to the second oracle call which exposed a positive dimensional face. You can see the three points converging to non-targets (points other than -1 and 1)