Higher level constructs

Higher level constructs

Total degree homotopy

Homotopy.totaldegreeFunction.
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

\[\begin{align*} z_1^{d_1} &- b_1\\ z_1^{d_2} &- b_2\\ &\vdots \\ z_n^{d_n} &- b_n\\ \end{align*}\]

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])
source
TotalDegreeSolutionIterator(degrees, b)

Given the Vectors degrees and b TotalDegreeSolutionIterator enumerates all solutions of the system

\[\begin{align*} z_1^{d_1} - b_1 &= 0 \\ z_1^{d_2} - b_2 &= 0 \\ &\vdots \\ z_n^{d_n} - b_n &= 0 \\ \end{align*}\]

where $d_i$ is degrees[i] and $b_i$ is b[i].

source
totaldegree_startsystem(F::Vector{FP.Polynomial{<:Complex}}, [unit_roots=false])

Return the system

\[\begin{align*} z_1^{d_1} &- b_1\\ z_1^{d_2} &- b_2\\ &\vdots \\ z_n^{d_n} &- b_n\\ \end{align*}\]

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).

source

Random homotopies

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
source
Homotopy.randomsystemFunction.
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.

source