Skip to content

Commit

Permalink
TropicalGeometry: fixed bug in binomial tropical varieties (#3212)
Browse files Browse the repository at this point in the history
* 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
YueRen and thofma authored Jan 29, 2024
1 parent 910cd54 commit 3244ba2
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 3244ba2

Please sign in to comment.