Positive Dimensional Solution Sets
The basic data structure to work with positive dimensional solution sets $V(F)$ of a polynomial system $F$ is a WitnessSet $W$. The general idea is to intersect $V(F)$ with an (affine) linear space $L$ such that the intersection $V(F) ∩ L$ consists of only finitely many points (witnesses).
HomotopyContinuation.WitnessSet — TypeWitnessSet(F, L, S)Store solutions S of the polynomial system F(x) = L(x) = 0 into a witness set.
To compute a WitnessSet call witness_set.
HomotopyContinuation.witness_set — Functionwitness_set(F; codim = nvariables(F) - length(F), dim = nothing, options...)Compute a WitnessSet for F in the given dimension (resp. codimension) by sampling a random (affine) linear subspace. After constructing the system this calls solve with the provided options.
witness_set(F, L; options...)Compute WitnessSet for F and the (affine) linear subspace L.
witness_set(W::WitnessSet, L; options...)Compute a new WitnessSet with the (affine) linear subspace L by moving the linear subspace stored in W to L.
Example
julia> @var x y;
julia> F = System([x^2 + y^2 - 5], [x, y])
System of length 1
2 variables: x, y
-5 + x^2 + y^2
julia> W = witness_set(F)
Witness set for dimension 1 of degree 2To compute witness sets for all possible dimensions use regeneration or witness_sets.
HomotopyContinuation.regeneration — Functionregeneration(F::System; options...)This solves $F=0$ equation-by-equations and returns a WitnessSet for every dimension without decomposing them into irreducible components (witness sets that are not decomposed are also called witness supersets).
The implementation is based on the algorithm u-regeneration by Duff, Leykin and Rodriguez.
Options
sorted = true: the polynomials in F will be sorted by degree in decreasing order.max_codim: the maximal codimension until which witness supersets should be computed.show_progress = true: indicate whether the progress of the computation should be displayed.endgame_options:EndgameOptionsfor theEndgameTracker.tracker_options:TrackerOptionsfor theTracker.seed: choose the random seed.
Example
The following example computes witness sets for a union of two circles.
julia> @var x y
julia> f = (x^2 + y^2 - 1) * ((x-1)^2 + (y-1)^2 - 1)
julia> W = regeneration([f])
1-element Vector{WitnessSet}:
Witness set for dimension 1 of degree 4 Witness sets can be decomposed into irreducible components by using the decompose function.
HomotopyContinuation.decompose — Functiondecompose(Ws::Vector{WitnessPoints}; options...)This function decomposes a WitnessSet or a vector of WitnessSet into irreducible components.
Options
show_progress = true: indicate whether the progress of the computation should be displayed.show_monodromy_progress = false: indicate whether the progress of the monodromy computation should be displayed.monodromy_options:MonodromyOptionsformonodromy_solve.max_iters = 50: maximal number of iterations for the decomposition step.warning = true: iftrueprints a warning when thetrace_testfails.threading = true: enables multiple threads.seed: choose the random seed.
Example
The following example decomposes the witness set for a union of two circles.
julia> @var x y
julia> f = (x^2 + y^2 - 1) * ((x-1)^2 + (y-1)^2 - 1)
julia> W = regeneration([f])
julia> decompose(W)
Numerical irreducible decomposition with 2 components
• 2 component(s) of dimension 1.
degree table of components:
╭───────────┬───────────────────────╮
│ dimension │ degrees of components │
├───────────┼───────────────────────┤
│ 1 │ (2, 2) │
╰───────────┴───────────────────────╯Numerical Irreducible Decomposition
A numerical irreducible decomposition for $F$ is a collection of witness sets $W₁, ..., Wᵣ$ such that the $Wᵢ$ are all witness sets for different irreducible components and $V(F)$ is their union.
HomotopyContinuation.numerical_irreducible_decomposition — Functionnumerical_irreducible_decomposition(F::System; options...)Computes the numerical irreducible of the variety defined by $F=0$.
Options
show_progress = true: indicate whether the progress of the computation should be displayed.show_monodromy_progress = false: indicate whether the progress of the monodromy computation should be displayed.sorted = true: the polynomials in F will be sorted by degree in decreasing order.max_codim: the maximal codimension until which witness supersets should be computed.endgame_options:EndgameOptionsfor theEndgameTracker.tracker_options:TrackerOptionsfor theTracker.monodromy_options:MonodromyOptionsformonodromy_solve.max_iters = 50: maximal number of iterations for the decomposition step.warning = true: iftrueprints a warning when thetrace_testfails.threading = true: enables multiple threads.seed: choose the random seed.
Example
The following example computes witness sets for a union of one 2-dimensional component of degree 2, two 1-dimensional components each of degree 4 and 8 points.
julia> @var x, y, z
julia> p = (x * y - x^2) + 1 - z
julia> q = x^4 + x^2 - y - 1
julia> F = [p * q * (x - 3) * (x - 5);
p * q * (y - 3) * (y - 5);
p * (z - 3) * (z - 5)]
julia> N = numerical_irreducible_decomposition(F)
Numerical irreducible decomposition with 11 components
• 1 component(s) of dimension 2.
• 2 component(s) of dimension 1.
• 8 component(s) of dimension 0.
degree table of components:
╭───────────┬──────────────────────────╮
│ dimension │ degrees of components │
├───────────┼──────────────────────────┤
│ 2 │ 2 │
│ 1 │ (4, 4) │
│ 0 │ (1, 1, 1, 1, 1, 1, 1, 1) │
╰───────────┴──────────────────────────╯HomotopyContinuation.nid — Functionnid(F::System; options...)Calls numerical_irreducible_decomposition.
Example
julia> @var x, y
julia> f = [x^2 + y^2 - 1]
julia> N = nid(f)
Numerical irreducible decomposition with 1 components
• 1 component(s) of dimension 1.
degree table of components:
╭───────────┬───────────────────────╮
│ dimension │ degrees of components │
├───────────┼───────────────────────┤
│ 1 │ 2 │
╰───────────┴───────────────────────╯The output of nid is a NumericalIrreducibleDecomposition.
HomotopyContinuation.NumericalIrreducibleDecomposition — TypeNumericalIrreducibleDecompositionStore the witness sets in a common data structure.
HomotopyContinuation.ncomponents — Functionncomponents(N::NumericalIrreducibleDecomposition;
dims::Union{Vector{Int},Nothing} = nothing)Returns the total number of components in N. dims specifies the dimensions that should be considered.
HomotopyContinuation.witness_sets — Functionwitness_sets(N::NumericalIrreducibleDecomposition;
dims::Union{Vector{Int},Nothing} = nothing)Returns the witness sets in N. dims specifies the dimensions that should be considered.
HomotopyContinuation.ModelKit.degrees — Functiondegrees(f::AbstractVector{Expression}, vars = variables(f); expanded = false)Compute the degrees of the expressions f in vars. Unless expanded is true the expressions are first expanded.
degrees(F::System)Return the degrees of the given system.
degrees(N::NumericalIrreducibleDecomposition;
dims::Union{Vector{Int},Nothing} = nothing)Returns the degrees of the components in N. dims specifies the dimensions that should be considered.
Computing Information about Witness Sets
To obtain information about a WitnessSet the following functions are provided.
HomotopyContinuation.solutions — Methodsolutions(W::WitnessSet)Get the solutions stored in W.
HomotopyContinuation.results — Methodresults(W::WitnessSet)Get the results stored in W.
HomotopyContinuation.system — Functionsystem(W::WitnessSet)Get the system stored in W.
HomotopyContinuation.linear_subspace — Functionlinear_subspace(W::WitnessSet)Get the linear subspace stored in W.
HomotopyContinuation.dim — Methoddim(W::WitnessSet)The dimension of the algebraic set encoded by the witness set.
HomotopyContinuation.codim — Methodcodim(W::WitnessSet)The dimension of the algebraic set encoded by the witness set.
MultivariatePolynomials.degree — Methoddegree(W::WitnessSet)Returns the degree of the witness set W. This equals the number of solutions stored.
To test for completeness of a WitnessSet you can perform a trace_test
HomotopyContinuation.trace_test — Functiontrace_test(W::WitnessSet; options...)Performs a trace test [LRS18] to verify whether the given witness set W is complete. Returns the trace of the witness set which should be theoretically be 0 if W is complete. Due to floating point arithmetic this is not the case, thus is has to be manually checked that the trace is sufficiently small. Returns nothing if the trace test failed due to path tracking failures. The options are the same as for calls to witness_set.
julia> @var x y;
julia> F = System([x^2 + y^2 - 5], [x, y])
System of length 1
2 variables: x, y
-5 + x^2 + y^2
julia> W = witness_set(F)
Witness set for dimension 1 of degree 2
julia> trace = trace_test(W)
9.981960497718987e-16APA
- LRS18Leykin, Anton, Jose Israel Rodriguez, and Frank Sottile. "Trace test." Arnold Mathematical Journal 4.1 (2018): 113-125.