Solving homotopies

Solving homotopies

The solve function

The solve function solves homotopies with given starting values.

    solve(H::AbstractHomotopy, startvalues_s, [algorithm]; kwargs...)

Solve the homotopy H via homotopy continuation with the given startvalues_s and the given algorithm.

kwargs are the keyword arguments for the solver options.

The default pathtracking algorithm is SphericalPredictorCorrector().

To specify another pathracking algorithm, e.g.AffinePredictorCorrector(), write

    solve(H::AbstractHomotopy, startvalues_s, AffinePredictorCorrector(); kwargs...)

The function also takes polynomials as inputs:

    solve(f::Vector{<:MP.AbstractPolynomial{T}})

solves the polynomial system f via a totaldegree homotopy of type StraightLineHomotopy and the SphericalPredictorCorrector pathtracking routine.

To specify homotopy and pathtracker, use

    solve(f::Vector{<:MP.AbstractPolynomial{T}}, [homotopy], [algorithm]; kwargs...)

Default is homotopy = StraightLineHomotopy and algorithm = SphericalPredictorCorrector. For instance,

    solve(f, GeodesicOnTheSphere, AffinePredictorCorrector())

solves $f=0$ with a GeodesicOnTheSphere homotopy and the AffinePredictorCorrector pathtracking routine.

source

Solver options

Solver(homotopy, pathtracking_algorithm=SphericalPredictorCorrector(), endgame=CauchyEndgame(); kwargs...)

Create a mutable Solver struct. This contains a Pathtracker and an Endgamer, everything you need to solve the given homotopy. Solver supports the following options:

  • endgame_start=0.1: Where the endgame starts

  • abstol=1e-12: The desired accuracy of the final roots

  • at_infinity_tol=1e-10: An point is at infinity if the maginitude of the homogenous variable

is less than at_infinity_tol.

  • singular_tol=1e4: If the winding number is 1 but the condition number is larger than

singular_tol then the root is declared as singular.

  • refinement_maxiters=100: The maximal number of newton iterations to achieve abstol.

  • verbose=false: Print additional warnings / informations

  • apply_gammatrick=true: This modifies the start system to make it generic.

  • gamma=apply_gammatrick ? exp(im*2π*rand()) : complex(1.0): You can overwrite the default gamma. This is useful if you want to rerun only some paths.

  • pathcrossing_tolerance=1e-8: The tolerance for when two paths are considered to be crossed.

  • pathcrossing_check=true: Enable the pathcrossing check.

  • parallel_type=:pmap: Currently there are two modes: :pmap will use pmap for parallelism

and :none will use the standard map. :pmap is by defautl enabled since it works reliable, but if you develop new algorithms you probably want to disable parallelism.

  • batch_size=1: The batch_size for pmap if parallel_type is :pmap.

For instance, to solve the homotopy H with starting values s with no endgame and a singular tolerance of 1e5, write

    solve(H, s, endgame_start=0.0, singular_tol=1e5)

To solve the polynomial system $f$ with the same options write

    solve(f, endgame_start=0.0, singular_tol=1e5)
source

Result

The solve function returns a Result struct:

Result(pathresults, solver)

A thin wrapper around the PathResults of the Solver instance. Result behaves like an array of PathResults but also contains some additional informations. For example you can obtain the γ which was used for the gammatrick.

source

PathResult

For each tracked path there is a PathResult:

PathResult(startvalue, pathtracker_result, endgamer_result, solver)

Construct a PathResult for a given startvalue. pathtracker_result is the PathtrackerResult until the endgame radius is reached. endgamer_result is the EndgamerResult resulting from the corresponding endgame.

A PathResult contains:

  • returncode: One of :success, :at_infinity or any error code from the EndgamerResult

  • solution::Vector{T}: The solution vector. If the algorithm computed in projective space

and the solution is at infinity then the projective solution is given. Otherwise an affine solution is given if the startvalue was affine and a projective solution is given if the startvalue was projective.

  • residual::Float64: The value of the infinity norm of H(solution, 0).

  • newton_residual: The value of the 2-norm of $J_H(\text{solution})^{-1}H(\text{solution}, 0)$

  • log10_condition_number: A high condition number indicates singularty. See Homotopies.κ for details. The value is the logarithmic condition number (with base 10).

  • windingnumber: The estimated winding number

  • angle_to_infinity: The angle to infinity is the angle of the solution to the hyperplane where the homogenizing coordinate is $0$.

  • real_solution: Indicates whether the solution is real given the defined tolerance at_infinity_tol (from the solver options).

  • startvalue: The startvalue of the path

  • iterations: The number of iterations the pathtracker needed.

  • endgame_iterations: The number of steps in the geometric series the endgamer did.

  • npredictions: The number of predictions the endgamer did.

  • predictions: The predictions of the endgamer.

source

The solutions function

The solution function helps to extract information from a Result:

solutions(r::Result; success=true, at_infnity=true, only_real=false, singular=true)

Filters the solutions which satisfy the constraints.

source