Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #4018 #4038

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Rings/mpoly-graded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1502,8 +1502,8 @@ mutable struct HilbertData
@req coefficient_ring(R) isa AbstractAlgebra.Field "The coefficient ring must be a field"
@req all(is_homogeneous, gens(I)) "The generators of the ideal must be homogeneous"

G = groebner_assure(I)
cf = Singular.hilbert_series_data(G.S, W)
S = singular_groebner_generators(I, false, true)
cf = Singular.hilbert_series_data(S, W)
Comment on lines -1505 to +1506
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that we want singular_groebner_generators here and not just groebner_assure. The doc string of groebner_assure explains that one should not rely on the basis being defined on the Singular side.
I also assume that we need a global ordering here; otherwise one can change the true to false.

return new(cf, W, I)
end
function HilbertData(B::IdealGens)
Expand Down
2 changes: 1 addition & 1 deletion src/Rings/mpoly-ideals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2112,7 +2112,7 @@ function grassmann_pluecker_ideal(ring::MPolyRing,
return coeff_ring(numerator(c))
end
if !is_graded(ring)
ring, _ = grade(ring)
ring, _ = grade(ring)
end
h = hom(base_ring(I), ring, coeffmap, gens(ring))
converted_generators = elem_type(ring)[h(g) for g in groebner_basis(I; ordering = degrevlex(base_ring(I)))]
Expand Down
8 changes: 6 additions & 2 deletions src/Rings/mpoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,11 @@ function singular_generators(B::IdealGens, monorder::MonomialOrdering=default_or
isdefined(B, :ord) && B.ord == monorder && monomial_ordering(B.Ox, Singular.ordering(base_ring(B.S))) == B.ord && return B.gens.S
SR = singular_poly_ring(B.Ox, monorder)
f = Singular.AlgebraHomomorphism(B.Sx, SR, gens(SR))
return Singular.map_ideal(f, B.gens.S)
S = Singular.map_ideal(f, B.gens.S)
if isdefined(B, :ord) && B.ord == monorder
S.isGB = B.isGB
end
return S
Comment on lines +386 to +390
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should fix the main problem in #4018: singular_generators would not carry the information that the polynomials form a Gröbner basis with respect to monorder over to the Singular side.

end

@doc raw"""
Expand Down Expand Up @@ -745,7 +749,7 @@ function singular_assure(I::IdealGens)
I.gens.Sx = singular_poly_ring(I.Ox; keep_ordering = I.keep_ordering)
I.gens.S = Singular.Ideal(I.Sx, elem_type(I.Sx)[I.Sx(x) for x = I.O])
end
if I.isGB
if I.isGB && (!isdefined(I, :ord) || I.ord == monomial_ordering(I.gens.Ox, internal_ordering(I.gens.Sx)))
I.gens.S.isGB = true
end
end
Expand Down
15 changes: 12 additions & 3 deletions test/Rings/mpoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,18 @@ end
end

@testset "Grassmann Plücker Relations" begin
R, x = graded_polynomial_ring(residue_ring(ZZ, 7)[1], "x" => (1:2, 1:3))
test_ideal =ideal([x[1, 2]*x[2, 2] + 6*x[2, 1]*x[1, 3] + x[1, 1]*x[2, 3]])
@test grassmann_pluecker_ideal(R, 2, 4) == test_ideal
R, x = graded_polynomial_ring(residue_ring(ZZ, 7)[1], "x" => (1:2, 1:3))
test_ideal =ideal([x[1, 2]*x[2, 2] + 6*x[2, 1]*x[1, 3] + x[1, 1]*x[2, 3]])
@test grassmann_pluecker_ideal(R, 2, 4) == test_ideal

# Issue #4018
I = grassmann_pluecker_ideal(2, 5)
@test degree(I) == 5
@test dim(I) == 7
R, x = graded_polynomial_ring(GF(7), 10, "x")
I = grassmann_pluecker_ideal(R, 2, 5)
@test degree(I) == 5
@test dim(I) == 7
end

@testset "IdealGens" begin
Expand Down
Loading