Skip to content

Commit

Permalink
Merge pull request #3292 from LukasKuehne/matroid_realization_spaces
Browse files Browse the repository at this point in the history
Fixed two bugs in the matroid realization code
  • Loading branch information
lkastner committed Jan 31, 2024
2 parents 4fb8528 + 8e3d110 commit b7a413b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ function realization_space(
RS = reduce_realization_space(RS)
end

if q != nothing
if q != nothing && RS.ambient_ring isa MPolyRing
I = RS.defining_ideal
R = RS.ambient_ring
eqs = Vector{RingElem}()
Expand Down Expand Up @@ -820,11 +820,14 @@ function reduce_realization_space(
normal_Sgens = Vector{RingElem}()
else
Sgens_new = phi.(Sgens)
normal_Sgens = gens_2_prime_divisors([normal_form(g, Inew) for g in Sgens_new])
normal_Sgens = [normal_form(g, Inew) for g in Sgens_new]
if !(ambR(0) in normal_Sgens)
normal_Sgens = gens_2_prime_divisors(Sgens_new)
end
end
end

if isone(Inew)
if isone(Inew) || ambR(0) in normal_Sgens
MRS_new = MatroidRealizationSpace(Inew, normal_Sgens, ambR, nothing, MRS.char, MRS.q, MRS.ground_ring)
set_attribute!(MRS_new, :is_realizable, :false)
return MRS_new
Expand Down
17 changes: 17 additions & 0 deletions experimental/MatroidRealizationSpaces/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@
x1 = gens(R1)
x2 = gens(R2)
x3 = gens(R3)

@testset "is_realizable" begin
@test is_realizable(M1) == true
@test is_realizable(M2) == true
@test is_realizable(M3) == false
@test is_realizable(M4) == true

@test is_realizable(M1, char = 2) == true
@test is_realizable(M1, char = 3) == false
@test is_realizable(M1, q = 2) == true
@test is_realizable(M1, q = 3) == false

@test is_realizable(M2, char = 2) == true
@test is_realizable(M2, char = 3) == true
@test is_realizable(M2, q = 2) == false
@test is_realizable(M2, q = 7) == true
end

@testset "realization_space_matrix" begin

Expand Down

0 comments on commit b7a413b

Please sign in to comment.