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

Dimension of an ideal #4244

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
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
3 changes: 2 additions & 1 deletion src/Rings/groebner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,11 @@ end

function is_f4_applicable(I::MPolyIdeal, ordering::MonomialOrdering)
return (ordering == degrevlex(base_ring(I)) && !is_graded(base_ring(I))
&& !is_zero(I)
&& ((coefficient_ring(I) isa FqField
&& absolute_degree(coefficient_ring(I)) == 1
&& characteristic(coefficient_ring(I)) < 2^31)
|| coefficient_ring(I) == QQ))
|| base_ring(I) == QQMPolyRing))
end

@doc raw"""
Expand Down
7 changes: 6 additions & 1 deletion src/Rings/mpoly-ideals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1884,8 +1884,13 @@ julia> dim(I)
if I.dim > -1
return I.dim
end
is_one(I) && return -1 # Catch a boundary case
Copy link
Member

@lgoettgens lgoettgens Oct 24, 2024

Choose a reason for hiding this comment

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

Maybe stupid question: if I remember correctly, this is_one call already computes a groebner basis (possibly via singular). Wouldn't it then be more efficient to use this knowledge in Singular.dimension? Or does AlgebraicSolving.dimension make use of that as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right, is_one() computes a GB via Singular. I will work on this tomorrow, there is more that can be optimized, e.g. caching GBs.

is_zero(ngens(base_ring(I))) && return 0 # Catch a boundary case
I.dim = Singular.dimension(singular_groebner_generators(I, false, true))
if is_f4_applicable(I, degrevlex(base_ring(I)))
I.dim = AlgebraicSolving.dimension(AlgebraicSolving.Ideal(I.gens.O))
else
I.dim = Singular.dimension(singular_groebner_generators(I, false, true))
end
return I.dim
end

Expand Down
1 change: 1 addition & 0 deletions test/Rings/mpoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ end
S, (a, b, c) = polynomial_ring(QQ, [:a, :b, :c])
J = ideal(S, [(c^2+1)*(c^3+2)^2, b-c^2])
@test_throws ErrorException Oscar.check_base_rings(P, J)
@test dim(J) == 1
r1 = c^2-b
r2 = b^2*c+c^3+2*c^2+2
L = gens(radical(J))
Expand Down
Loading