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

PHCpack -- Interface for PHCpack

Description

Interfaces the functionality of the software PHCpack available at http://www.math.uic.edu/~jan/download.html. (The user needs to have PHCpack installed on his/her machine.)

PHCpack uses homotopy continuation methods to numerically solve systems of polynomial equations. The most popular function, the blackbox solver, returns solution vectors for the isolated roots of a system and diagnostical information about the quality of each solution.

i1 : R=QQ[x,y,z]      --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 =phcSolve(system);
using temporary file name /tmp/M2-7468-1PHCinput
i4 : numSolns = #solns

o4 = 3
i5 : solns/print
{-.771845-1.11514*ii, -.647799+1.72143*ii, 2.41964-.606291*ii}
{.543689, .295598, .160713}
{-.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. In addition to the values of the three variables, the hashtable for each solution contains the following keys for diagnostics: err, the magnitude of the last correction term used in Newton’s method; mult, the multiplicity of the solution; rco, estimate for the inverse condition of the root; residual, the maginitude of the system when evaluated at the given solution; and time, the end value of the continuation parameter, if t=1 then the solver reached the end of the path properly.
i6 : vol = mixedVolume(system)
using temporary file name /tmp/M2-7468-2PHCinput

o6 = 3
i7 : vol == 3 --in this case the mixed volume bound is sharp

o7 = true

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, which is located in Library/Application Support/Macaulay2 . For example, if PHC executable 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.

Version

This documentation describes version 0.2 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
    • convertToPoly -- converts a rational system to a Laurent polynomial system
    • mixedVolume -- mixed volume of a polynomial system; invokes "phc -m" from PHCpack
    • phcSolve -- a black-box solver, which returns approximations to all complex isolated roots of a polynomial system; invokes "phc -b" from PHCpack
    • refineSoln -- refines a solution of a system by increasing number of decimal places
    • refineSolutions (missing documentation)
    • trackPaths (missing documentation)