next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
PHCpack :: PHCpack

PHCpack -- a package for Polynomial Homotopy Continuation

Description

Interfaces the functionality of the software PHCpack to solve polynomial systems and perform calculations in numerical algebraic geometry. The software is available at http://www.math.uic.edu/~jan/download.html. The site provides source code and its executable versions phc. The user must have the executable program phc available, preferably in the executation path.

Below is a simple example using the most popular function, the numerical blackbox solver.
i1 : R = QQ[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 = phcSolve(system)
using temporary files /tmp/M2-5170-1PHCinput and /tmp/M2-5170-1PHCoutput

o3 = {{-.771845-1.11514*ii, -.647799+1.72143*ii, 2.41964-.606291*ii},
     ------------------------------------------------------------------------
     {-.771845+1.11514*ii, -.647799-1.72143*ii, 2.41964+.606291*ii},
     ------------------------------------------------------------------------
     {.543689, .295598, .160713}}

o3 : List
i4 : numSolns = #solns

o4 = 3
i5 : solns/print
{-.771845-1.11514*ii, -.647799+1.72143*ii, 2.41964-.606291*ii}
{-.771845+1.11514*ii, -.647799-1.72143*ii, 2.41964+.606291*ii}
{.543689, .295598, .160713}

o5 = {, , }

o5 : List
We see that there are three solutions to the above system. In addition, we can obtain diagnostic information about the quality of each solution. Each solution is of type Point:
i6 : oneSoln = solns_0

o6 = {-.771845-1.11514*ii, -.647799+1.72143*ii, 2.41964-.606291*ii}

o6 : Point
i7 : peek oneSoln

o7 = Point{ConditionNumber => 33.3778                                                   }
           Coordinates => {-.771845-1.11514*ii, -.647799+1.72143*ii, 2.41964-.606291*ii}
           LastT => 1
           SolutionStatus => Regular
The value of LastT is the end value of the continuation parameter: if it equals 1, then the solver reached the end of the path properly.

Caveat

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")

2. If the package SimpleDoc is not found when installing PHCpack.m2, see questions and answers 6, 7, and 8 on the Macaulay2 web site.

Authors

Version

This documentation describes version 1.07 of PHCpack.

Source code

The source code from which this documentation is derived is in the file PHCpack.m2. The auxiliary files accompanying it are in the directory PHCpack/.

Exports

  • Functions and commands
    • cascade -- runs a cascade of homotopies to get witness sets for each component of the variety (invokes "phc -c")
    • convertToPoly -- converts a rational system into a Laurent polynomial system
    • mixedVolume -- mixed volume of a polynomial system (invokes "phc -m")
    • nonZeroFilter -- returns solutions with coordinate larger than given tolerance
    • phcEmbed -- calls phc -c to construct an embedding of a polynomial system
    • phcFactor -- applies monodromy to factor a witness set into irreducible components
    • phcSolve -- a blackbox solver to approximate all complex isolated solutions (invokes "phc -b")
    • realFilter -- returns real solutions with respect to a given tolerance
    • refineSolutions -- refines solutions of a system by increasing working precision (invokes "phc -v")
    • topWitnessSet -- returns a witness set and nonsolutions for the top dimensional solution set
    • trackPaths -- tracking paths defined by a typical homotopy between start and end systems (invokes "phc -p")
    • zeroFilter -- returns solutions with k-th coordinate less than the given tolerance
  • Symbols
    • gamma -- the constant in the gamma trick, optional input for trackPaths
    • stableMV -- optional input for computation of the stable mixed volume
    • startSystem -- optional input for computation of mixed volume by solving a random coefficient system
    • tDegree -- the degree of the continuation parameter