diff --git a/Project.toml b/Project.toml index 34ee9dc..eb457cb 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "AlgebraicSolving" uuid = "66b61cbe-0446-4d5d-9090-1ff510639f9d" -authors = ["ederc ", "Mohab Safey El Din "] -version = "0.9.2" +authors = ["ederc ", "Mohab Safey El Din ", "Rémi Prebet "] +version = "0.10.0" [deps] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" @@ -29,4 +29,4 @@ Random = "1.6" StaticArrays = "1" Test = "1.6" julia = "1.6" -msolve_jll = "0.800.000" +msolve_jll = "0.900.100" diff --git a/src/algorithms/solvers.jl b/src/algorithms/solvers.jl index 2428ccb..0a7d8d9 100644 --- a/src/algorithms/solvers.jl +++ b/src/algorithms/solvers.jl @@ -393,18 +393,17 @@ QQMPolyRingElem[x1 + 2*x2 + 2*x3 - 1, x1^2 - x1 + 2*x2^2 + 2*x3^2, 2*x1*x2 + 2*x julia> real_solutions(I) 4-element Vector{Vector{QQFieldElem}}: - [21667317587//34359738368, 21667317587//68719476736, -2844258330290649520990905062759917788583//21778071482940061661655974875633165533184] + [1454069069139182487//2305843009213693952, 1454069069139182487//4611686018427387904, -154187553040555781639//1180591620717411303424] [1, 0, 0] - [15567773459//68719476736, 15567773459//137438953472, 744426424910260862653434112767010536665//2722258935367507707706996859454145691648] - [11453246123//34359738368, 460175067//5846006549323611672814739330865132078623730171904, 3629678580490010276942662479272194255531//10889035741470030830827987437816582766592] + [8357884734418025835//36893488147419103232, 4178942367209012917//36893488147419103232, 40355437357166103123//147573952589676412928] + [6148914691236517205//18446744073709551616, 123527304065019319//85070591730234615865843651857942052864, 196765270119568550571//590295810358705651712] julia> real_solutions(I, interval=true) 4-element Vector{Vector{Vector{QQFieldElem}}}: - [[10833658793//17179869184, 5416829397//8589934592], [10833658793//34359738368, 5416829397//17179869184], [-355532291286331190123863132844989723573//2722258935367507707706996859454145691648, -1422129165145324760495452531379958894291//10889035741470030830827987437816582766592]] + [[11632552553113459895//18446744073709551616, 11632552553113459897//18446744073709551616], [5816276276556729947//18446744073709551616, 5816276276556729949//18446744073709551616], [-19273444130069472705//147573952589676412928, -77093776520277890819//590295810358705651712]] [[1, 1], [0, 0], [0, 0]] - [[7783886729//34359738368, 3891943365//17179869184], [7783886729//68719476736, 3891943365//34359738368], [93053303113782607831679264095876317083//340282366920938463463374607431768211456, 372213212455130431326717056383505268333//1361129467683753853853498429727072845824]] - [[5726623061//17179869184, 2863311531//8589934592], [-4371663141//1461501637330902918203684832716283019655932542976, 9203501349//2923003274661805836407369665432566039311865085952], [1814839290245005138471331239636097127765//5444517870735015415413993718908291383296, 907419645122502569235665619818048563883//2722258935367507707706996859454145691648]] - + [[2089471183604506445//9223372036854775808, 4178942367209012945//18446744073709551616], [1044735591802253225//9223372036854775808, 2089471183604506467//18446744073709551616], [20177718678583051561//73786976294838206464, 10088859339291525781//36893488147419103232]] + [[6148914691236517197//18446744073709551616, 6148914691236517213//18446744073709551616], [-9388075108941468237//170141183460469231731687303715884105728, 9882184325201545513//170141183460469231731687303715884105728], [98382635059784275285//295147905179352825856, 49191317529892137643//147573952589676412928]] ``` """ function real_solutions( diff --git a/test/algorithms/groebner-bases.jl b/test/algorithms/groebner-bases.jl index a86d966..e14bbc9 100644 --- a/test/algorithms/groebner-bases.jl +++ b/test/algorithms/groebner-bases.jl @@ -54,7 +54,14 @@ I = Ideal([x+2*y+2*z-1, x^2+2*y^2+2*z^2-x, 2*x*y+2*y*z-y]) G = eliminate(I, 2) H = MPolyRingElem[ - 84*z^4 - 38 + 84*z^4+y-39 + ] + @test G == H + R, (a,b,c,d,x,y,z,w) = polynomial_ring(QQ, ["a", "b", "c", "d", "x", "y", "z", "w"]) + I = Ideal([x - a*c, y - a*c*d, z - a*c^2 - b, w - a*c^2*d - b*d]); + G = eliminate(I, 4) + H = MPolyRingElem[ + -x*w + y*z ] @test G == H end diff --git a/test/algorithms/solvers.jl b/test/algorithms/solvers.jl index d6d2908..e81eafa 100644 --- a/test/algorithms/solvers.jl +++ b/test/algorithms/solvers.jl @@ -5,20 +5,20 @@ 2*x1*x2 + 2*x2*x3 + 2*x3*x4 - x2, x2^2 + 2*x1*x3 + 2*x2*x4 - x3]) sols = Vector{QQFieldElem}[ - [9725097551//17179869184, 10252503395//68719476736, 8780272825//34359738368, -32714273694608759819673593948262790419337//174224571863520493293247799005065324265472], - [15118542013//34359738368, 10553904527//34359738368, 14535579013//137438953472, -92633843493479102248442236077889080803361//696898287454081973172991196020261297061888], - [1, 0, 0, 0], - [12820958949//17179869184, 16044245225//68719476736, -12686161419//68719476736, 55658687714722201275489356321691134094555601//713623846352979940529142984724747568191373312], - [12891314913//68719476736, 10768857835//137438953472, 10114780001//137438953472, 708759148891639684402860468800417934359477//2787593149816327892691964784081045188247552], - [11453246123//34359738368, 393751//45671926166590716193865151022383844364247891968, 5717949//182687704666362864775460604089535377456991567872, 14518714321960041107770649917088777022123//43556142965880123323311949751266331066368] + [5221121991829859395//9223372036854775808, 5504270848248823931//36893488147419103232, 9427746158008080579//36893488147419103232, -1773444330549010351039//9444732965739290427392], + [16233410876972203325//36893488147419103232, 11332168696478546611//36893488147419103232, 3901864780605853159//36893488147419103232, -5021690718065612612481//37778931862957161709568], + [1, 0, 0, 0], + [27532799693394918193//36893488147419103232, 8613688565890011307//36893488147419103232, -6810831051238017945//36893488147419103232, 46039787397761586515//590295810358705651712], + [6920971994354151069//36893488147419103232, 2890743263533053499//36893488147419103232, 2715165582075437623//36893488147419103232, 38421910449864642395061//151115727451828646838272], + [12297829382473034411//36893488147419103232, 0, 0, 787061080478274202283//2361183241434822606848] ] inter_sols = Vector{Vector{QQFieldElem}}[ - [[4862548775//8589934592, 607818597//1073741824], [5126251697//34359738368, 2563125849//17179869184], [1097534103//4294967296, 4390136413//17179869184], [-16357136847304379909836796974131395209669//87112285931760246646623899502532662132736, -4089284211826094977459199243532848802417//21778071482940061661655974875633165533184]], - [[3779635503//8589934592, 7559271007//17179869184], [5276952263//17179869184, 659619033//2147483648], [3633894753//34359738368, 7267789507//68719476736], [-46316921746739551124221118038944540401681//348449143727040986586495598010130648530944, -2894807609171221945263819877434033775105//21778071482940061661655974875633165533184]], - [[1, 1], [0, 0], [0, 0], [0, 0]], - [[3205239737//4294967296, 6410479475//8589934592], [2005530653//8589934592, 8022122613//34359738368], [-3171540355//17179869184, -6343080709//34359738368], [3478667982170137579718084770105695880909725//44601490397061246283071436545296723011960832, 27829343857361100637744678160845567047277801//356811923176489970264571492362373784095686656]], - [[402853591//2147483648, 6445657457//34359738368], [5384428917//68719476736, 2692214459//34359738368], [316086875//4294967296, 5057390001//68719476736], [177189787222909921100715117200104483589869//696898287454081973172991196020261297061888, 354379574445819842201430234400208967179739//1393796574908163946345982392040522594123776]], - [[5726623061//17179869184, 2863311531//8589934592], [-3795019955//365375409332725729550921208179070754913983135744, 3801319971//365375409332725729550921208179070754913983135744], [-2148414955//182687704666362864775460604089535377456991567872, 2159850853//182687704666362864775460604089535377456991567872], [7259357160980020553885324958544388511061//21778071482940061661655974875633165533184, 3629678580490010276942662479272194255531//10889035741470030830827987437816582766592]] + [[10442243983659718789//18446744073709551616, 10442243983659718791//18446744073709551616], [2752135424124411965//18446744073709551616, 1376067712062205983//9223372036854775808], [4713873079004040289//18446744073709551616, 2356936539502020145//9223372036854775808], [-27710067664828286735//147573952589676412928, -886722165274505175519//4722366482869645213696]], + [[4058352719243050831//9223372036854775808, 8116705438486101663//18446744073709551616], [5666084348239273305//18446744073709551616, 2833042174119636653//9223372036854775808], [1950932390302926579//18446744073709551616, 487733097575731645//4611686018427387904], [-2510845359032806306241//18889465931478580854784, -39231958734887598535//295147905179352825856]], + [[1, 1], [0, 0], [0, 0], [0, 0]], + [[6883199923348729541//9223372036854775808, 13766399846697459111//18446744073709551616], [4306844282945005649//18446744073709551616, 2153422141472502829//9223372036854775808], [-212838470351188061//1152921504606846976, -3405415525619008969//18446744073709551616], [23019893698880793257//295147905179352825856, 11509946849440396629//147573952589676412928]], + [[3460485997177075533//18446744073709551616, 216280374823567221//1152921504606846976], [1445371631766526749//18446744073709551616, 722685815883263375//9223372036854775808], [1357582791037718811//18446744073709551616, 339395697759429703//4611686018427387904], [9605477612466160598765//37778931862957161709568, 19210955224932321197531//75557863725914323419136]], + [[3074457345618258583//9223372036854775808, 6148914691236517245//18446744073709551616], [-1//4611686018427387904, 1//4611686018427387904], [-5//18446744073709551616, 5//18446744073709551616], [393530540239137101141//1180591620717411303424, 196765270119568550571//590295810358705651712]] ] rat_sols = Vector{QQFieldElem}[[1, 0, 0, 0], [1//3, 0, 0, 1//3]]