Skip to content

Commit 901d3cb

Browse files
committed
adds groebner tests for qq
1 parent e048a95 commit 901d3cb

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

test/algorithms/groebner-bases.jl

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
@testset "Algorithms -> Gröbner bases" begin
2-
R, (x,y,z) = polynomial_ring(QQ,["x","y","z"], internal_ordering=:degrevlex)
3-
F = [x^2+1-3, x*y-z, x*z^2-3*y^2]
4-
#= not a finite field =#
5-
@test_throws ErrorException groebner_basis(Ideal(F))
62
R, (x,y,z) = polynomial_ring(GF(101),["x","y","z"], internal_ordering=:degrevlex)
73
I = Ideal([x+2*y+2*z-1, x^2+2*y^2+2*z^2-x, 2*x*y+2*y*z-y])
84
G = groebner_basis(I)
@@ -38,6 +34,22 @@
3834
I = Ideal([R(0)])
3935
G = groebner_basis(I)
4036
@test G == [R(0)]
37+
38+
R, (x1, x2) = polynomial_ring(QQ, ["x1", "x2"])
39+
I = Ideal([3*x1^2 + ZZRingElem(2)^100, 2*x1*x2 + 5*x1 + ZZRingElem(2)^100])
40+
G = groebner_basis(I)
41+
H = MPolyRingElem[
42+
3*x1 - 2*x2 - 5
43+
4*x2^2 + 20*x2 + 3802951800684688204490109616153
44+
]
45+
@test G == H
46+
J = Ideal([3*x1^2 + ZZRingElem(2)^100, 2*x1*x2 + 5*x1 + ZZRingElem(2)^100])
47+
G = groebner_basis(J, normalize=true)
48+
H = MPolyRingElem[
49+
x1 - 2//3*x2 - 5//3
50+
x2^2 + 5*x2 + 3802951800684688204490109616153//4
51+
]
52+
@test G == H
4153
end
4254

4355
@testset "Algorithms -> Sig Gröbner bases" begin

0 commit comments

Comments
 (0)