Higher level constructs
Total degree homotopy
Homotopy.totaldegree
— Function.totaldegree(H::Type{AbstractPolynomialHomotopy}, F, [unitroots=false])
Construct a total degree homotopy of type H
with F
and an iterator of its solutions. This is the homotopy with start system
and target system F
, where $d_i$ is the degree of the $i$-th polynomial of F
. If unitroots=true
then $b_i=1$ otherwise $b_i$ is a random complex number (with real and imaginary part in the unit interval).
Example
H, startsolutions = totaldegree(StraightLineHomotopy{Complex128}, [x^2+y+1, x^3*y-2])
TotalDegreeSolutionIterator(degrees, b)
Given the Vector
s degrees
and b
TotalDegreeSolutionIterator
enumerates all solutions of the system
where $d_i$ is degrees[i]
and $b_i$ is b[i]
.
Homotopy.totaldegree_startsystem
— Function.totaldegree_startsystem(F::Vector{FP.Polynomial{<:Complex}}, [unit_roots=false])
Return the system
where $d_i$ is the degree of the $i$-th polynomial of F
and an iterator of its solutions. If unitroots=true
then $b_i=1$ otherwise $b_i$ is a random complex number (with real and imaginary part in the unit interval).
Random homotopies
Homotopy.randomhomotopy
— Function.randomhomotopy(::Type{AbstractPolynomialHomotopy{T}}, size::Int; kwargs...)
Create a total degree homotopy where the target system is a randomsystem(T, size, size; kwargs...)
.
Example
julia> H, solutions = randomhomotopy(StraightLineHomotopy{Complex128}, 2, mindegree=3, maxdegree=6);
julia> length(H)
3
julia> nvariables(H)
3
Homotopy.randomsystem
— Function.randomsystem([T=Complex128,] nequations::Int, nvars::Int; mindegree=0, maxdegree=5, rng=Base.Random.GLOBAL_RNG, density=rand() * 0.8 + 0.1)
Creates a random polynomial system of nequations
equations with nvars
variables (named $x_1$, ...$x_{nvars}$). Each polynomial has a total degree uniformly drawn from $[mindegree, maxdegree]$. The coefficients are drawn independently from the given rng
. With density
you can control how many coefficients are non-zero. A value of 1.0
creates a dense polynomial (i.e. every coefficient is non-zero). A value of 0.5
creates a polynomial where only half of all monomials are non zero.
randomsystem([T=Complex128,] degrees::Vector{Int}, variables::Vector{Symbol}; rng=N(0,1))
Create a random polynomial system with the given degrees
and variables
.