This package provides an interface to the software PHCpack, a general-purpose polynomial system solver that uses homotopy continuation. The main method is a numerical blackbox solver, implemented for Laurent systems. The package also provides a fast mixed volume computation, ability to filter solutions, extract real solutions, or track homotopy paths.
The software PHCpack itself is available at http://www.math.uic.edu/~jan/download.html. This site provides source code and its executable version phc. To use the methods from this package, the user must have the executable program phc available, preferably in the execution path. The functions in this package call the phc executable, behind the scenes, with appropriate input options, and save intermediate output to temporary files. For convenience, the file names are displayed, and the commands that are invoked are documented under "Consequences" for each function.
Below is a simple example using the most popular function, the numerical blackbox solver.
i1 : R = CC[x,y,z] o1 = R o1 : PolynomialRing |
i2 : system = {y-x^2,z-x^3,x+y+z-1} 2 3 o2 = {- x + y, - x + z, x + y + z - 1} o2 : List |
i3 : solns = solveSystem(system) using temporary files /var/folders/40/dy88l5qd361391m_3v2m51bm0000gn/T/M2-44653-0/0PHCinput and /var/folders/40/dy88l5qd361391m_3v2m51bm0000gn/T/M2-44653-0/0PHCoutput o3 = {{.543689, .295598, .160713}, {-.771845+1.11514*ii, -.647799-1.72143*ii, ------------------------------------------------------------------------ 2.41964+.606291*ii}, {-.771845-1.11514*ii, -.647799+1.72143*ii, ------------------------------------------------------------------------ 2.41964-.606291*ii}} o3 : List |
i4 : numSolns = #solns o4 = 3 |
i5 : solns/print {.543689, .295598, .160713} {-.771845+1.11514*ii, -.647799-1.72143*ii, 2.41964+.606291*ii} {-.771845-1.11514*ii, -.647799+1.72143*ii, 2.41964-.606291*ii} o5 = {, , } o5 : List |
We see that there are three solutions to the above system. Each solution is of type Point and contains diagnostic information about the quality of the solution.
i6 : oneSoln = solns_0 o6 = {.543689, .295598, .160713} o6 : Point |
i7 : peek oneSoln o7 = Point{ConditionNumber => 3.07977 } Coordinates => {.543689, .295598, .160713} LastT => 1 SolutionStatus => Regular |
1. If you are having trouble installing the package, check whether the path to your PHCpack executable was set correctly. You can check this by typing the following command:
options PHCpack
If it is wrong, you can update it by putting the absolute path into the init-PHCpack.m2 file, For example, if the executable phc is located in C:/cygwin/PHC, then the line inside the init-PHCpack.m2 file will look like this:
"path" => "C:/cygwin/PHC/" .
Alternately, the path could be set when loading the package using the following command:
loadPackage ("PHCpack", Configuration=>"path"=>"C:/cygwin/PHC/","PHCexe"=>"./phc")