Reference
Input
We support any polynomials which follow the MultivariatePolynomials interface. By default we export the routines @polyvar
, PolyVar
, differentiate
and variables
from the DynamicPolynomials implementation. With these you can simply create variables
# Create variables x, y, z
@polyvar x y z
f = x^2+y^2+z^2
# You can also create an array of variables
@polyvar x[1:3] # This creates x1, x2, x3 accessed by x[1], x[2], x[3]
f = dot(x, x) # = x[1]^2+x[2]^2+x[3]^2
# Also you can create matrices of variables
# This creates x1_1, x1_2, x2_1, x2_2 accessed by
# x[1,1], x[1,2], x[2,1], x[2,2]
@polyvar x[1:2, 1:2]
We also provide methods construct compositions of polynomial systems:
HomotopyContinuation.compose
— Function.compose(g, f)::Composition
Compose the polynomial systems g
and f
. You can also use the infix operator ∘
(written by \circ).
julia> @polyvar a b c x y z;
julia> g = [a * b * c];
julia> f = [x+y, y + z, x + z];
julia> expand(compose(g, f))
1-element Array{DynamicPolynomials.Polynomial{true,Int64},1}:
x²y + x²z + xy² + 2xyz + xz² + y²z + yz²
Utilities
HomotopyContinuation.bezout_number
— Function.bezout_number(F::MPPolys; variable_groups=[variables(F)], homvars=nothing, parameters=nothing)
bezout_number(multidegrees, groups::VariableGroups)
Compute the multi-homogeneous bezout number associated to the given system and variable groups.
HomotopyContinuation.ishomogeneous
— Function.ishomogeneous(f::MP.AbstractPolynomialLike)
Checks whether f
is homogeneous.
ishomogeneous(f::MP.AbstractPolynomialLike, vars)
Checks whether f
is homogeneous in the variables vars
with possible weights.
ishomogeneous(F::Vector{MP.AbstractPolynomialLike}, variables)
Checks whether each polynomial in F
is homogeneous in the variables variables
.
HomotopyContinuation.uniquevar
— Function.uniquevar(f::MP.AbstractPolynomialLike, tag=:x0)
uniquevar(F::MPPolys, tag=:x0)
Creates a unique variable.
HomotopyContinuation.homogenize
— Function.homogenize(f::MP.AbstractPolynomial, variable=uniquevar(f))
Homogenize the polynomial f
by using the given variable variable
.
homogenize(F::Vector{<:MP.AbstractPolynomial}, variable=uniquevar(F))
Homogenize each polynomial in F
by using the given variable variable
.
homogenize(f::MP.AbstractPolynomial, v::Vector{<:MP.AbstractVariable}, variable=uniquevar(f))
Homogenize the variables v
in the polynomial f
by using the given variable variable
.
homogenize(F::Vector{<:MP.AbstractPolynomial}, v::Vector{<:MP.AbstractVariable}, variable=uniquevar(F))
Homogenize the variables v
in each polynomial in F
by using the given variable variable
.
AffinePatches
Affine patches are there to augment projective system such that they can be considered as (locally) affine system. By default the following patches are defined
OrthogonalPatch()
EmbeddingPatch()
Holds an PVector
onto its affine patch. With this the effect is basically the same as tracking in affine space.
HomotopyContinuation.RandomPatch
— Type.RandomPatch()
A random patch. The vector has norm 1.
HomotopyContinuation.FixedPatch
— Type.FixedPatch()