Add tropical prevarieties generated by intersecting tropical hypersurfaces#4703
Add tropical prevarieties generated by intersecting tropical hypersurfaces#4703lkastner merged 20 commits intooscar-system:masterfrom
Conversation
fix conflicts
2d58662 to
6d847ee
Compare
|
Hi @danteluber, Thanks for the pr draft! Would it be possible to do the following changes:
(Number 1. can be its own separate pull-request, if you want to tackle it step-by-step) |
|
Oh, so there was a As for the remaining changes, you can construct tropical hypersurfaces from polynomials using |
YueRen
left a comment
There was a problem hiding this comment.
Hi Dante, thanks again for your effort! I just have two final requests (see enclosed).
|
|
||
|
|
||
| #Default to min convention | ||
| tropical_prevariety(A::Vector{<:MPolyRingElem}) = tropical_prevariety(min, A) |
There was a problem hiding this comment.
| tropical_prevariety(A::Vector{<:MPolyRingElem}) = tropical_prevariety(min, A) | |
| function tropical_prevariety(F::Vector{<:MPolyRingElem}, nu::TropicalSemiringMap=tropical_semiring_map(coefficient_ring(first(F)))) | |
| return tropical_prevariety(tropical_polynomial.(F,Ref(nu)) | |
| end |
I suggest adding a second optional TropicalSemiringMap that encodes a valuation + convention (default: trivial valuation, min convention). This allows users working over fields to create tropical hypersurfaces with respect to non-trivial valuations.
| function tropical_prevariety(convention::minmax, A::Vector{<:MPolyRingElem}) where {minmax<:Union{typeof(min),typeof(max)}} | ||
| length(A) > 0 || error("Empty array.") | ||
| nu = tropical_semiring_map(coefficient_ring(A[1]), convention) | ||
| ftrops = [tropical_polynomial(f, nu) for f in A] | ||
| HTA = [tropical_hypersurface(f) for f in ftrops] | ||
| return reduce(common_refinement, [h.polyhedralComplex for h in HTA]) | ||
| end |
There was a problem hiding this comment.
| function tropical_prevariety(convention::minmax, A::Vector{<:MPolyRingElem}) where {minmax<:Union{typeof(min),typeof(max)}} | |
| length(A) > 0 || error("Empty array.") | |
| nu = tropical_semiring_map(coefficient_ring(A[1]), convention) | |
| ftrops = [tropical_polynomial(f, nu) for f in A] | |
| HTA = [tropical_hypersurface(f) for f in ftrops] | |
| return reduce(common_refinement, [h.polyhedralComplex for h in HTA]) | |
| end |
I would suggest removing this, as it is superseded by the suggested function above.
Co-authored-by: Lars Kastner <lkastner@users.noreply.github.com>
benlorenz
left a comment
There was a problem hiding this comment.
Please add the function to some documentation page, i.e. an .md file in docs/src.
| Polyhedral complex in ambient dimension 10 | ||
| ``` | ||
| """ | ||
| #Input array of tropical polynomials |
There was a problem hiding this comment.
| #Input array of tropical polynomials |
This line needs to be removed for the docstring to work.
The doctest is also not run currently.
| #Give input as tropical polynomials | ||
| Dr25 = tropical_prevariety(tropical_polynomial.([f for f in gens(Gr25)])) | ||
| Polyhedral complex in ambient dimension 10 |
There was a problem hiding this comment.
| #Give input as tropical polynomials | |
| Dr25 = tropical_prevariety(tropical_polynomial.([f for f in gens(Gr25)])) | |
| Polyhedral complex in ambient dimension 10 | |
| julia> Dr25 = tropical_prevariety(tropical_polynomial.([f for f in gens(Gr25)])) # Give input as tropical polynomials | |
| Polyhedral complex in ambient dimension 10 |
There is a julia> missing, also I don't think comments like this before the julia> lines will work, we do have it like this in other cases so I added this as a suggestion:
julia> some + code # some explanation| #Compute with respect to max convention | ||
| julia> nu = tropical_semiring_map(QQ,max) |
There was a problem hiding this comment.
| #Compute with respect to max convention | |
| julia> nu = tropical_semiring_map(QQ,max) | |
| julia> nu = tropical_semiring_map(QQ,max) #Compute with respect to max convention |
| #Compute Dressian without specified tropicalization map. | ||
| julia> Dr25 = tropical_prevariety(gens(Gr25)) |
There was a problem hiding this comment.
| #Compute Dressian without specified tropicalization map. | |
| julia> Dr25 = tropical_prevariety(gens(Gr25)) | |
| julia> Dr25 = tropical_prevariety(gens(Gr25)) #Compute Dressian without specified tropicalization map. |
| # | ||
|
|
||
| @doc raw""" | ||
| tropical_prevariety(F::Vector{MPolyRingElem},nu::TropicalSemiringMap) |
There was a problem hiding this comment.
| tropical_prevariety(F::Vector{MPolyRingElem},nu::TropicalSemiringMap) | |
| tropical_prevariety(F::Vector{MPolyRingElem},nu::TropicalSemiringMap) |
This needs to be indented by 4 spaces.
Want to introduce methods to intersect tropical hypersurfaces and produce topical prevarieties from finite collections of polynomials.
Follows discussion with @lkastner
@YueRen Interested in your thoughts as well