Skip to content

Commit

Permalink
Merge pull request #3659 from fingolfin/mh/_normal_form_singular
Browse files Browse the repository at this point in the history
  • Loading branch information
ederc committed May 3, 2024
2 parents 00786b1 + dacdfae commit 7f5cfd2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Rings/groebner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1157,11 +1157,13 @@ julia> Oscar._normal_form_singular(A, J, default_ordering(base_ring(J)))
```
"""
function _normal_form_singular(A::Vector{T}, J::MPolyIdeal, ordering::MonomialOrdering) where { T <: MPolyRingElem }
SR = singular_poly_ring(base_ring(J), ordering)
IS = Singular.Ideal(SR, [SR(x) for x in A])
GS = singular_groebner_generators(J, ordering)
K = ideal(base_ring(J), reduce(IS, GS))
return [J.gens.Ox(x) for x = gens(K.gens.S)]
SR = base_ring(GS)
tmp = map(SR, A)
IS = Singular.Ideal(SR, tmp)
K = reduce(IS, GS)
OR = base_ring(J)
return map(OR, gens(K))
end

@doc raw"""
Expand Down
7 changes: 7 additions & 0 deletions test/Rings/groebner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@
@test_throws ArgumentError standard_basis_highest_corner(I)
end

@testset "normal form graded" begin
R, (a, b, c) = graded_polynomial_ring(QQ, ["a", "b", "c"])
I = ideal([a^2+b^2, c^3])
# verify normal form of inhomogeneous polynomial work
@test normal_form(a^2+b, I) == -b^2+b
end

@testset "groebner leading ideal" begin
R, (t, x, y, z) = polynomial_ring(QQ, ["t", "x", "y", "z"])

Expand Down

0 comments on commit 7f5cfd2

Please sign in to comment.