Skip to content

Commit

Permalink
TropicalGeometry: fixed bug in binomial tropical varieties (oscar-sys…
Browse files Browse the repository at this point in the history
…tem#3212)

* TropicalGeometry: fixed bug in binomial tropical varieties

* TropicalGeometry: suggestion by Tommy

Co-authored-by: Tommy Hofmann <thofma@gmail.com>

---------

Co-authored-by: Tommy Hofmann <thofma@gmail.com>
  • Loading branch information
2 people authored and ooinaruhugh committed Feb 15, 2024
1 parent 845fe65 commit 2623638
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/TropicalGeometry/variety.jl
Original file line number Diff line number Diff line change
Expand Up @@ -243,19 +243,18 @@ end

function tropical_variety_binomial(I::MPolyIdeal,nu::TropicalSemiringMap; weighted_polyhedral_complex_only::Bool=false)
###
# Compute reduced Groebner basis (usually already cached),
# construct matrix of exponent vector differences
# Construct matrix of exponent vector differences
# and vector of coefficient valuation differences
###
G = groebner_basis(I,complete_reduction=true)
G = gens(I)
A = matrix(ZZ,[first(collect(expv))-last(collect(expv)) for expv in exponents.(G)])
b = [ QQ(nu(last(collect(coeff))/first(collect(coeff)))) for coeff in coefficients.(G)]

###
# Compute tropical variety multiplicity
###
@req ncols(A)>nrows(A) "input needs to be a GB"
weight = abs(prod([snf(A)[i,i] for i in 1:nrows(A)]))
snfAdiag = elementary_divisors(A)
weight = abs(prod([m for m in snfAdiag if !iszero(m)]))

###
# Constructing tropical variety set-theoretically
Expand Down

0 comments on commit 2623638

Please sign in to comment.