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 Grassmann Pluecker #3382

Merged
merged 5 commits into from
Feb 19, 2024
Merged
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
42 changes: 24 additions & 18 deletions src/Rings/mpoly-ideals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1922,7 +1922,15 @@ small_generating_set(I::MPolyIdeal{<:MPolyDecRingElem}) = minimal_generating_set
#
################################################################################
function grassmann_pluecker_ideal(subspace_dimension::Int, ambient_dimension::Int)
return convert(MPolyIdeal{QQMPolyRingElem}, Polymake.ideal.pluecker_ideal(subspace_dimension, ambient_dimension))
I = convert(MPolyIdeal{QQMPolyRingElem},
Polymake.ideal.pluecker_ideal(subspace_dimension, ambient_dimension))
base = base_ring(I)
o = degrevlex(base)

return ideal(IdealGens(base, gens(I), o;
keep_ordering=true,
isReduced=true,
isGB=true))
end

@doc raw"""
Expand All @@ -1944,33 +1952,31 @@ julia> grassmann_pluecker_ideal(2, 4)
Ideal generated by
x[1]*x[6] - x[2]*x[5] + x[3]*x[4]

julia> R, x = polynomial_ring(residue_ring(ZZ, 7)[1], "x" => (1:2, 1:3), ordering=:degrevlex)
julia> R, x = polynomial_ring(residue_ring(ZZ, 7)[1], "x" => (1:2, 1:3))
(Multivariate polynomial ring in 6 variables over ZZ/(7), zzModMPolyRingElem[x[1, 1] x[1, 2] x[1, 3]; x[2, 1] x[2, 2] x[2, 3]])

julia> grassmann_pluecker_ideal(R, 2, 4)
Ideal generated by
x[1, 2]*x[2, 2] + 6*x[2, 1]*x[1, 3] + x[1, 1]*x[2, 3]
x[1, 1]*x[2, 3] + 6*x[2, 1]*x[1, 3] + x[1, 2]*x[2, 2]
```

"""
function grassmann_pluecker_ideal(ring::MPolyRing,
subspace_dimension::Int,
ambient_dimension::Int)
pluecker_ideal = grassmann_pluecker_ideal(subspace_dimension, ambient_dimension)
converted_generators = elem_type(ring)[]
coeff_ring = base_ring(ring)
for g in gens(pluecker_ideal)
converted_coeffs = [coeff_ring(numerator(c)) for c in AbstractAlgebra.coefficients(g)]
polynomial = MPolyBuildCtx(ring)

for (i, exponent) in enumerate(AbstractAlgebra.exponent_vectors(g))
c = converted_coeffs[i]
push_term!(polynomial, c, exponent)
end
converted_g = finish(polynomial)
push!(converted_generators, converted_g)
end
return ideal(ring, converted_generators)
I = grassmann_pluecker_ideal(subspace_dimension, ambient_dimension)
coeff_ring = base_ring(ring)
o = degrevlex(ring)
coeffmap = c -> begin
@assert is_integral(c)
return coeff_ring(numerator(c))
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)))]
ideal(IdealGens(ring, converted_generators, o;
keep_ordering=true,
isReduced=true,
isGB=true))
end

################################################################################
Expand Down
Loading