Core Tracker
A CoreTracker is the low-level path tracker. Its job is to track an initial solution x₁ from t₁ to t₀ by following a solution path $x(t)$. For this a predictor-corrector scheme is used. See our introduction guide for a high-level explanation of the predictor corrector scheme
Basic usage
HomotopyContinuation.CoreTracker — TypeCoreTrackerA CoreTracker is the low-level path tracker. Its job is to track an initial solution x₁ from t₁ to t₀ by following a solution path $x(t)$. For this a predictor-corrector scheme is used. See our introduction guide for a high-level explanation of the predictor corrector scheme. The CoreTracker accepts for a value t a solution $x^*$ if $||x(t) - x^*|| < τ$ where $τ$ is controlled by the accuracy option.
To interact with a CoreTracker take a look at track resp. track!. You can also use CoreTracker as an iterator. For this you need to call init!(::CoreTracker, x₁, t₁, t₀) first. There is also iterator if you are only interested in pairs (x,t).
The CoreTracker cannot handle singular solutions or divergent paths. For this you have to use a PathTracker (which uses internally again a CoreTracker).
The CoreTracker can track solutions in projective space if the underlying homotopy is homogeneous and the provided start solution is a projective vector (with type PVector) from the ProjectiveVectors.jl package.
The CoreTracker can also perform a reparamterization of the parameter $t$ from $[0,1]$ towards $[0,∞]$ by $t = e^{-s}$. If the homotopy assumes $t ∈ [0,1]$ this can be done by passing the log_transform = true option. If you already have a homotopy which assumes $s ∈ [0,∞]$ you can use the logarithmic_time_scale = true to tell the core tracker this. In this case the min_step_size criterion is still applied to $t$ and not $s$.
Options
CoreTracker accepts many different options. Here are the options in alphabetic order:
- accuracy(default- 1e-7): The maximal acceptable distance to the true solution at a time step- t.
- auto_scaling(default- true): Enables an automatic scaling of the variables by introducing a weighted norm. See also- WeightedNorm.
- initial_step_size: The size of the first step. By default an automatic estimate is computed but this can be overwritten with this option.
- max_cond(default- 1e10): The maximal condition number before a path is terminated due to ill-conditioning. This is only applicable if- terminate_ill_conditionedis- true.
- max_corrector_iters (default2`): The maximal number of Newton iteration steps until which the desired accuracy has to be achieved.
- max_step_size(default- Inf): Limit the path tracker to a maximal step size.
- max_steps(default- 1000): The maximal number of steps the path tracker makes. Note that this changes to- 10_000for parameter homotopies.
- min_step_size(default- 1e-14): The path tracking is terminated if the step size is smaller than this value.
- norm(default- InfNorm()): The norm used in the computations. Note that if the- auto_scalingis true, this will automatically be converted to a- WeightedNorm.
- patch: It is possible to perform tracking in projective space. For the actual compuations we still need to choose an affine chart. There are multiple charts possible, see- AbstractAffinePatch. The default is- RandomPatch.
- precision(default- :double): This controls the precision used in the computation of $H(x,t)$. If it is set to- :doubleonly double precision arithmetic is used (- Complex{Float64}). If it set to- :double_doubledouble double arithmetic as implemented by the- DoubleFloatspackage is always used. The option- :adaptivechanges adaptively the precision.
- predictor(default- Pade21): The predictor used.
- simple_step_size_alg(default- false): By default the step size algorithm presented in arXiv:1902.02968 is used. If this option is true a more simple step size algorithm is used which doubles the step size after 5 consecutive successive steps and halfes the step size after a failed step.
- terminate_ill_conditioned(default- true): Indicates whether the path tracking should be terminated for ill-conditioned paths. A path is considered ill-conditioned if the desirable accuracy is no more achievable or if the condition number of the Jacobian is larger than- 1e14.
The easiest way to construct a CoreTracker is to use coretracker and coretracker_startsolutions.
HomotopyContinuation.coretracker_startsolutions — Functioncoretracker_startsolutions(args...; kwargs...)Construct a CoreTracker and startsolutions in the same way solve does it. This also takes the same input arguments as solve. This is convenient if you want to investigate single paths.
HomotopyContinuation.coretracker — Functioncoretracker(args...; kwargs...)Construct a CoreTracker in the same way solve does it. This also takes the same input arguments as solve with the exception that you do not need to specify startsolutions. This is convenient if you want to investigate single paths.
Examples
Obtain single solution
We want to construct a path tracker to track a parametrized system f with parameters p from the parameters a to b.
tracker = coretracker(f; parameters = p, start_parameters = a, target_parameters = b)You then can obtain a single solution at b by using
x_b = track(tracker, x_a).xTrace a path
To trace a path you can use the iterator method.
tracker = coretracker(f; parameters = p, start_parameters = a, target_parameters = b)
for (x, t) in iterator(tracker, x₁)
    @show (x,t)
endIf we want to guarantee smooth traces we can limit the maximal step size.
tracker = coretracker(f; parameters = p, max_step_size = 0.01,
                         start_parameters = a, target_parameters = b)
for (x, t) in iterator(tracker, x₁)
    @show (x,t)
endResult and Status
HomotopyContinuation.CoreTrackerResult — Type CoreTrackerResult{V<:AbstractVector}The result of track(::CoreTracker, x₁, t₁, t₀). You can use is_success to check whether the tracking was successfull and solution to obtain the solution.
Fields
- returncodeThe- CoreTrackerStatus.statesenum.
- x::VThe solution at- t.
- t::ComplexF64The time- twhen the path tracker stopped.
- accuracy::Float64: The estimated accuracy of- x.
- accepted_steps::Int: The number of accepted steps during the tracking.
- rejected_steps::Int: The number of rejected_steps steps during the tracking.
HomotopyContinuation.is_success — Methodis_success(result::CoreTrackerResult)Returns true if the path tracking was successfull.
HomotopyContinuation.solution — Methodsolution(result::CoreTrackerResult)Returns the solutions obtained by the CoreTracker.
HomotopyContinuation.CoreTrackerStatus.states — TypeCoreTrackerStatus.statesThe possible states a CoreTracker can have are
- CoreTrackerStatus.success: Indicates a successfull completed tracking
- CoreTrackerStatus.tracking: The tracking is still in progress
- CoreTrackerStatus.terminated_maximal_iterations: Tracking terminated since maximal iterations reached.
- CoreTrackerStatus.terminated_ill_conditioned: Tracking terminated since the path was too ill-conditioned.
- CoreTrackerStatus.terminated_invalid_startvalue: Tracking terminated since the provided start value was invalid.
- CoreTrackerStatus.terminated_step_size_too_small
HomotopyContinuation.is_success — Methodis_success(S::CoreTrackerStatus.states)Returns true if S indicates a success in the path tracking.
HomotopyContinuation.is_terminated — Methodis_terminated(S::CoreTrackerStatus.states)Returns true if S indicates that the path tracking got terminated. This is not true if is_success(S) is true.
HomotopyContinuation.is_tracking — Methodis_tracking(S::CoreTrackerStatus.states)Returns true if S indicates that the path tracking is not yet finished.
HomotopyContinuation.is_invalid_startvalue — Methodis_invalid_startvalue(S::CoreTrackerStatus.states)Returns true if S indicates that the path tracking got terminated since the start value was not a zero.
Methods
To track from a start to an endpoint with the CoreTracker we provide the following routines.
HomotopyContinuation.track — FunctionHomotopyContinuation.track! — Methodtrack!(tracker::CoreTracker, x₁, t₁=1.0, t₀=0.0)::CoreTrackerStatus.statesTrack a value x₁ from t₁ to t₀ using the given CoreTracker tracker. Returns one of the enum values of CoreTrackerStatus indicating the status. Check is_success and is_terminated to test for the status.
If setup_patch is true then init! is called at the beginning of the tracking.
track!(x₀, tracker::CoreTracker, x₁, t₁=1.0, t₀=0.0)::CoreTrackerStatus.statesAdditionally also stores the result in x₀ if the tracking was successfull.
HomotopyContinuation.init! — Methodinit!(tracker::CT, x₁, t₁, t₀;
  setup_patch::Bool = tracker.options.update_patch,
  loop::Bool = false,
  check_start_value::Bool = !loop)Setup tracker to track x₁ from t₁ to t₀. Use this if you want to use the tracker as an iterator.
It is also possible to use a CoreTracker as an iterator. This can either be done by the high level iterator method or by directly using a CoreTracker as an iterator. The recommend approach is to simply use iterator.
HomotopyContinuation.iterator — Functioniterator(tracker::CoreTracker, x₁, t₁=1.0, t₀=0.0; affine=true)Prepare a tracker to make it usable as a (stateful) iterator. Use this if you want to inspect a specific path. In each iteration the tuple (x,t) is returned. If affine == true then x is the affine solution (internally we compute in projective space).
Example
Assume you have CoreTracker tracker and you wan to track x₁ from 1.0 to 0.25:
for (x,t) in iterator(tracker, x₁, 1.0, 0.25)
println("x at t=$t:")
println(x)
endNote that this is a stateful iterator. You can still introspect the state of the tracker. For example to check whether the tracker was successfull (and did not terminate early due to some problem) you can do
println("Success: ", status(tracker) == CoreTrackerStatus.success)Introspecting the current state
To introspect the current state we provide the following routines.
HomotopyContinuation.current_x — Functioncurrent_x(tracker::CoreTracker)Return the current value of x.
HomotopyContinuation.current_t — Functioncurrent_t(tracker::CoreTracker)Current t.
HomotopyContinuation.current_Δt — Functioncurrent_Δt(tracker::CoreTracker)Current step_size Δt.
HomotopyContinuation.steps — Functionsteps(tracker::CoreTracker)Current number of steps.
HomotopyContinuation.status — Functionstatus(tracker::CoreTracker)Current status.
LinearAlgebra.cond — MethodLinearAlgebra.cond(tracker::CoreTracker)Returns the currently computed approximation of the condition number of the Jacobian.
HomotopyContinuation.options — Functionoptions(tracker::CoreTracker)Returns the options used in the tracker.
Changing options
To change settings
HomotopyContinuation.accuracy — Methodaccuracy(tracker::CoreTracker)Current accuracy.
HomotopyContinuation.set_accuracy! — Functionset_accuracy!(tracker::CoreTracker, accuracy)Set the current accuracy to accuracy.
HomotopyContinuation.max_corrector_iters — Functionmax_corrector_iters(tracker::CoreTracker)Current correction max_steps.
HomotopyContinuation.set_max_corrector_iters! — Functionsetmaxcorrector_iters!(tracker::CoreTracker, n)
Set the correction max_steps to n.
HomotopyContinuation.max_step_size — Functionmax_step_size (tracker::CoreTracker)Current maximal step size.
HomotopyContinuation.set_max_step_size! — Functionset_max_corrector_iters!(tracker::CoreTracker, Δs)Set the maximal step size to Δs.
Deprecated
The following functions are deprecated.
HomotopyContinuation.max_refinement_iters — Functionmax_refinement_iters(tracker::CoreTracker)Current refinement max_steps.
HomotopyContinuation.set_max_refinement_iters! — Functionset_max_refinement_iters!(tracker::CoreTracker, n)Set the current refinement max_steps to n.
HomotopyContinuation.refinement_accuracy — Functionrefinement_accuracy(tracker::CoreTracker)Current refinement accuracy.
HomotopyContinuation.set_refinement_accuracy! — Functionset_max_refinement_iters!(tracker::CoreTracker, accuracy)Set the current refinement accuracy to accuracy.