Algebraic Systems Solving
Introduction
AlgebraicSolving allows to compute solutions of polynomial systems with input generators over the rationals. In addition, the computation of rational parametrizations of solution sets is implemented for polynomial systems with input generators over finite fields of order $p$ where $p$ is a prime number $<2^{31}$, over the rationals and over fraction fields of polynomial rings.
The underlying engine is provided by msolve.
Functionality
AlgebraicSolving.rational_parametrization — Method
rational_parametrization(I::Ideal{T} where T <: MPolyRingElem, <keyword arguments>)Given an ideal I with a finite solution set over the complex numbers, return the rational parametrization of the ideal with a given precision (default 32 bits).
Note: At the moment only QQ is supported as ground field. If the dimension of the ideal is greater than zero an ErrorException is thrown.
Arguments
I::Ideal{T} where T <: MPolyRingElem: input generators.initial_hts::Int=17: initial hash table sizelog_2.nr_thrds::Int=1: number of threads for parallel linear algebra.max_nr_pairs::Int=0: maximal number of pairs per matrix, only bounded by minimal degree if0.la_option::Int=2: linear algebra option: exact sparse-dense (1), exact sparse (2, default), probabilistic sparse-dense (42), probabilistic sparse(44).info_level::Int=0: info level printout: off (0, default), summary (1), detailed (2).precision::Int=32: bit precision for the computed solutions.
Examples
julia> using AlgebraicSolving
julia> R,(x1,x2,x3) = polynomial_ring(QQ, ["x1","x2","x3"])
(Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x1, x2, x3])
julia> I = Ideal([x1+2*x2+2*x3-1, x1^2+2*x2^2+2*x3^2-x1, 2*x1*x2+2*x2*x3-x2])
QQMPolyRingElem[x1 + 2*x2 + 2*x3 - 1, x1^2 - x1 + 2*x2^2 + 2*x3^2, 2*x1*x2 + 2*x2*x3 - x2]
julia> rational_parametrization(I)
AlgebraicSolving.RationalParametrization([:x1, :x2, :x3], ZZRingElem[], 84*x^4 - 40*x^3 + x^2 + x, 336*x^3 - 120*x^2 + 2*x + 1, Nemo.QQPolyRingElem[184*x^3 - 80*x^2 + 4*x + 1, 36*x^3 - 18*x^2 + 2*x])AlgebraicSolving.rational_parametrization — Method
rational_parametrization(I::ParametricIdeal{K}; <keyword arguments>) -> (Vector{Symbol}, Vector{MPoly{K}}, MPoly{K}, MPoly{K}, Vector{MPoly{K}})Computes the parametric rational parametrization associated with the parametric ideal I. The rational parametrization is computed by evaluating the ideal at a number of parameter values and interpolating the coefficients of the resulting rational parametrizations.
Arguments
retry::Int=10: the maximum number of consecutive failures allowed when computing the rational parametrization or interpolating the coefficients.nr_thrds::Int=1: the number of threads to use for parallel computations.worker_pool::AbstractWorkerPool=default_worker_pool(): the worker pool to use for parallel computations.show_progress::Bool=false: whether to show a progress bar while computing the rational parametrization.
AlgebraicSolving.real_solutions — Method
real_solutions(I::Ideal{T} where T <: MPolyRingElem, <keyword arguments>)Given an ideal I with a finite solution set over the complex numbers, return the real roots of the ideal with a given precision (default 32 bits).
Note: At the moment only QQ is supported as ground field. If the dimension of the ideal is greater than zero an ErrorException is thrown.
Arguments
I::Ideal{T} where T <: MPolyRingElem: input generators.initial_hts::Int=17: initial hash table sizelog_2.nr_thrds::Int=1: number of threads for parallel linear algebra.max_nr_pairs::Int=0: maximal number of pairs per matrix, only bounded by minimal degree if0.la_option::Int=2: linear algebra option: exact sparse-dense (1), exact sparse (2, default), probabilistic sparse-dense (42), probabilistic sparse(44).info_level::Int=0: info level printout: off (0, default), summary (1), detailed (2).precision::Int=32: bit precision for the computed solutions.interval::Bool=false: return real solutions as intervals.
Examples
julia> using AlgebraicSolving
julia> R,(x1,x2,x3) = polynomial_ring(QQ, ["x1","x2","x3"])
(Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x1, x2, x3])
julia> I = Ideal([x1+2*x2+2*x3-1, x1^2+2*x2^2+2*x3^2-x1, 2*x1*x2+2*x2*x3-x2])
QQMPolyRingElem[x1 + 2*x2 + 2*x3 - 1, x1^2 - x1 + 2*x2^2 + 2*x3^2, 2*x1*x2 + 2*x2*x3 - x2]
julia> real_solutions(I)
4-element Vector{Vector{QQFieldElem}}:
[1454069069139182487//2305843009213693952, 1454069069139182487//4611686018427387904, -154187553040555781639//1180591620717411303424]
[1, 0, 0]
[8357884734418025835//36893488147419103232, 4178942367209012917//36893488147419103232, 40355437357166103123//147573952589676412928]
[6148914691236517205//18446744073709551616, 123527304065019319//85070591730234615865843651857942052864, 196765270119568550571//590295810358705651712]
julia> real_solutions(I, interval=true)
4-element Vector{Vector{Vector{QQFieldElem}}}:
[[11632552553113459895//18446744073709551616, 11632552553113459897//18446744073709551616], [5816276276556729947//18446744073709551616, 5816276276556729949//18446744073709551616], [-19273444130069472705//147573952589676412928, -77093776520277890819//590295810358705651712]]
[[1, 1], [0, 0], [0, 0]]
[[2089471183604506445//9223372036854775808, 4178942367209012945//18446744073709551616], [1044735591802253225//9223372036854775808, 2089471183604506467//18446744073709551616], [20177718678583051561//73786976294838206464, 10088859339291525781//36893488147419103232]]
[[6148914691236517197//18446744073709551616, 6148914691236517213//18446744073709551616], [-9388075108941468237//170141183460469231731687303715884105728, 9882184325201545513//170141183460469231731687303715884105728], [98382635059784275285//295147905179352825856, 49191317529892137643//147573952589676412928]]AlgebraicSolving.rational_solutions — Method
rational_solutions(I::Ideal{T} where T <: MPolyRingElem, <keyword arguments>)Given an ideal I with a finite solution set over the complex numbers, return the rational roots of the ideal.
Arguments
I::Ideal{T} where T <: MPolyRingElem: input generators.initial_hts::Int=17: initial hash table sizelog_2.nr_thrds::Int=1: number of threads for parallel linear algebra.max_nr_pairs::Int=0: maximal number of pairs per matrix, only bounded by minimal degree if0.la_option::Int=2: linear algebra option: exact sparse-dense (1), exact sparse (2, default), probabilistic sparse-dense (42), probabilistic sparse(44).info_level::Int=0: info level printout: off (0, default), summary (1), detailed (2).precision::Int=32: bit precision for the computed solutions.
Examples
julia> using AlgebraicSolving
julia> R,(x1,x2,x3) = polynomial_ring(QQ, ["x1","x2","x3"])
(Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x1, x2, x3])
julia> I = Ideal([x1+2*x2+2*x3-1, x1^2+2*x2^2+2*x3^2-x1, 2*x1*x2+2*x2*x3-x2])
QQMPolyRingElem[x1 + 2*x2 + 2*x3 - 1, x1^2 - x1 + 2*x2^2 + 2*x3^2, 2*x1*x2 + 2*x2*x3 - x2]
julia> rat_sols = rational_solutions(I)
2-element Vector{Vector{QQFieldElem}}:
[1//3, 0, 1//3]
[1, 0, 0]
julia> map(r->map(p->evaluate(p, r), I.gens), rat_sols)
2-element Vector{Vector{QQFieldElem}}:
[0, 0, 0]
[0, 0, 0]AlgebraicSolving.curve_rational_parametrization — Method
curve_rational_parametrization(I::Ideal{<:MPolyRingElem}, <keyword arguments>)Given a radical ideal I with solution set X being of dimension 1 over the complex numbers, return a rational curve parametrization of the one-dimensional irreducible components of X.
Important: In the output, the variables x and y correspond respectively to the last and second-to-last entries of the vars attribute.
Note: At the moment only QQ is supported as ground field. If the dimension of the ideal is not one an ErrorException is thrown.
Arguments
I::Ideal{<:QQMPolyRingElem}: input generators.info_level::Int=0: info level printout: off (0, default), summary (1), detailed (2).cfs_lfs::Vector{Vector{ZZRingElem}} = []: coefficients for the above linear formsnr_thrds::Int=1: number of threads for msolve
Examples
julia> using AlgebraicSolving
julia> R, (x1,x2,x3) = polynomial_ring(QQ, ["x1","x2","x3"])
(Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x1, x2, x3])
julia> I = Ideal([x1+2*x2+2*x3-1, x1^2+2*x2^2+2*x3^2-x1])
QQMPolyRingElem[x1 + 2*x2 + 2*x3 - 1, x1^2 - x1 + 2*x2^2 + 2*x3^2]
julia> curve_rational_parametrization(I)
AlgebraicSolving.CurveRationalParametrization([:x1, :x2, :x3, :_Z2, :_Z1], Vector{ZZRingElem}[[0, 0, 1, 0, -1], [0, 1, 0, -1, 0]], x^2 + 4//3*x*y - 1//3*x + y^2 - 1//3*y, 4//3*x + 2*y - 1//3, QQMPolyRingElem[4//3*x^2 - 4//3*x*y + 2//3*x + 4//3*y - 1//3, -2*x^2 - 4//3*x*y + 2//3*x + 1//3*y, 4//3*x^2 + 2*x*y - 1//3*x])
julia> curve_rational_parametrization(I, cfs_lfs=[[-3,2,2], [1,4,-3]])
AlgebraicSolving.CurveRationalParametrization([:x1, :x2, :x3, :_Z2, :_Z1], Vector{ZZRingElem}[[-3, 2, 2, 0, -1], [1, 4, -3, -1, 0]], 127//128*x^2 + 3//8*x*y + 161//64*x + y^2 - 7//8*y - 49//128, 3//8*x + 2*y - 7//8, QQMPolyRingElem[-3//32*x^2 - 1//2*x*y + 5//16*x + 1//2*y - 7//32, -1//4*x^2 + 1//8*x*y - 3//4*x + 3//8*y, 19//64*x^2 + 1//8*x*y + 25//32*x + 3//8*y - 21//64])
julia> curve_rational_parametrization(I, cfs_lfs=[[-3,2,2,-1,-2], [1,4,-3,2,-1]])
AlgebraicSolving.CurveRationalParametrization([:x1, :x2, :x3, :_Z2, :_Z1], Vector{ZZRingElem}[[-3, 2, 2, -1, -2], [1, 4, -3, 2, -1]], 244//181*x^2 - 148//543*x*y + 532//543*x + y^2 + 182//181*y - 49//543, -148//543*x + 2*y + 182//181, QQMPolyRingElem[440//543*x^2 - 580//543*x*y - 44//543*x + 136//181*y + 112//543, 80//181*x^2 + 320//543*x*y + 122//181*x + 81//181*y + 49//543, -460//543*x^2 - 10//181*x*y - 418//543*x + 32//181*y + 56//181])