-
Notifications
You must be signed in to change notification settings - Fork 138
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
first try at tropical prevarieties #4703
first try at tropical prevarieties #4703
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Dante, thanks again for your effort! I just have two final requests (see enclosed).
src/TropicalGeometry/hypersurface.jl
Outdated
|
||
|
||
#Default to min convention | ||
tropical_prevariety(A::Vector{<:MPolyRingElem}) = tropical_prevariety(min, A) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
src/TropicalGeometry/hypersurface.jl
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Co-authored-by: Lars Kastner <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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