Skip to content
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

A function checking if a tropical polytope is ordinarily convex (ie a polytrope) #3989

Merged
merged 16 commits into from
Aug 19, 2024

Conversation

Sami-Halaseh
Copy link
Contributor

No description provided.

@Sami-Halaseh
Copy link
Contributor Author

@ooinaruhugh @lenweis

@joschmitt joschmitt requested a review from YueRen August 2, 2024 17:17
@Sami-Halaseh
Copy link
Contributor Author

@danteluber

Copy link

codecov bot commented Aug 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.56%. Comparing base (184dd4a) to head (f34d439).
Report is 23 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3989      +/-   ##
==========================================
+ Coverage   84.44%   84.56%   +0.11%     
==========================================
  Files         596      596              
  Lines       81888    82074     +186     
==========================================
+ Hits        69150    69404     +254     
+ Misses      12738    12670      -68     
Files Coverage Δ
src/TropicalGeometry/matrix.jl 97.29% <100.00%> (+2.29%) ⬆️

... and 19 files with indirect coverage changes

Copy link
Member

@YueRen YueRen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dear @Sami-Halaseh,

Thanks for the pull-request! Overall it looks great, I just have a few super-minor changes.

One general question: Wouldn't it be more sensible to make the input a polytope?

Best regards, Yue.

src/TropicalGeometry/matrix.jl Outdated Show resolved Hide resolved
src/TropicalGeometry/matrix.jl Outdated Show resolved Hide resolved
src/TropicalGeometry/matrix.jl Outdated Show resolved Hide resolved
src/TropicalGeometry/matrix.jl Outdated Show resolved Hide resolved
@Sami-Halaseh
Copy link
Contributor Author

Dear @Sami-Halaseh,

Thanks for the pull-request! Overall it looks great, I just have a few super-minor changes.

One general question: Wouldn't it be more sensible to make the input a polytope?

Best regards, Yue.

@YueRen thank you for the feedback. I have made the changes you suggested over a few commits (sorry about that). One thing I have not addressed is this comment you made. This is actually a confusion of mine. Are tropical polytopes a type in OSCAR? I thought the way do tropical convex hull computations was to somehow go through polymake. For example

tropical > $H = new Polytope<Min>(POINTS=>[[0,1,0],[0,0,1],[1,0,0]]);
julia> H = Polymake.Shell.H
name: H
type: Polytope<Min, Rational>
...
julia> typeof(H)
Polymake.LibPolymake.BigObjectAllocated

Here it seems like I get two different types. The one when I pull $P into julia out of Polymake says something about type Polytope<Min, Rational>. But then the typeof gives something else. Excuse my ignorance here. At MEGA you suggested I speak with Michael Joswig about tropical convexity in OSCAR. I have reached out about a meeting so hopefully that will help soon.

Copy link
Member

@YueRen YueRen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dear @Sami-Halaseh,

The pull request looks great, maybe just two little changes to the docstring to make it clearer and it's good to be merged. If the changes works for you, you can just ask github to apply my suggestions (no need to manually change them yourself).

Best regards, Yue.

src/TropicalGeometry/matrix.jl Outdated Show resolved Hide resolved
src/TropicalGeometry/matrix.jl Outdated Show resolved Hide resolved
@Sami-Halaseh
Copy link
Contributor Author

Dear @Sami-Halaseh,

The pull request looks great, maybe just two little changes to the docstring to make it clearer and it's good to be merged. If the changes works for you, you can just ask github to apply my suggestions (no need to manually change them yourself).

Best regards, Yue.

Hey Yue, thanks for the feedback. I think those suggestions are good and I have committed them. We are talking about a tropical polytope/polyhedron type but it looks like it will take some time to flesh out what it should look like and how to put it into OSCAR. For now I think its good for this function to work on matrices.
Sami

@thofma
Copy link
Collaborator

thofma commented Aug 12, 2024

It is kind of opposite the design of Oscar to have something like

function is_polytrope(A::QQMatrix)

For the same reason we don't have is_bijective(A::QQMatrix), although one could interpret A in some (arbitrary) way as a linear map between vector spaces.

@YueRen
Copy link
Member

YueRen commented Aug 13, 2024

It is kind of opposite the design of Oscar to have something like

function is_polytrope(A::QQMatrix)

For the same reason we don't have is_bijective(A::QQMatrix), although one could interpret A in some (arbitrary) way as a linear map between vector spaces.

Then how about renaming the function to do_rows_form_polytrope?

@benlorenz
Copy link
Member

Maybe we can keep this function internal (non-exported) for now, until we have the tropical polytope type? Then we don't need to commit to a public interface function but it is still possible to be used for development.

@YueRen
Copy link
Member

YueRen commented Aug 13, 2024

@benlorenz That's also a good solution (removing the export part of the changes). @Sami-Halaseh What do you say?

  1. Rename the function to do_rows_form_polytrope (or something similar; optional)
  2. Remove the export of the function so that it remains private

and wait for the tropical polytope type before having a public is_polytrope function?

src/TropicalGeometry/matrix.jl Outdated Show resolved Hide resolved
Comment on lines 138 to 142
pPMCV = P.POLYTOPE_MAXIMAL_COVECTORS
Polymake.Shell.CV = pPMCV
Polymake.shell_execute(raw"""$tmp = $CV->size;""")
l = Polymake.Shell.tmp
return l == 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pPMCV = P.POLYTOPE_MAXIMAL_COVECTORS
Polymake.Shell.CV = pPMCV
Polymake.shell_execute(raw"""$tmp = $CV->size;""")
l = Polymake.Shell.tmp
return l == 1
return length(P.POLYTOPE_MAXIMAL_COVECTORS) == 1

as above

@Sami-Halaseh
Copy link
Contributor Author

Thank you for the feedback everyone. @YueRen I made those two changes. @benlorenz Thank you for the fix, the perl shell code was definitely not a good way to get the length. The wrapped type is much better, we just couldn't figure out how to do that properly.
We are working on a tropical polytope type in OSCAR. There are some bigger things to figure out since it would be nice for them to be able to exist in tropical projective space, not just the tropical torus. Hopefully there will be something to show in the coming months.

Copy link
Member

@benlorenz benlorenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now needs the Oscar. prefix until exported again.

src/TropicalGeometry/matrix.jl Outdated Show resolved Hide resolved
src/TropicalGeometry/matrix.jl Outdated Show resolved Hide resolved
test/TropicalGeometry/matrix.jl Show resolved Hide resolved
Copy link
Member

@YueRen YueRen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for incorporating all suggestions! Looking forward to having polytropes in OSCAR, in the meantime this function is an excellent bandaid.

@joschmitt joschmitt merged commit 6caa552 into oscar-system:master Aug 19, 2024
27 of 28 checks passed
@micjoswig
Copy link
Member

This is the wrong algorithm; must be replaced. Will be dealt with in #4001 .

@ooinaruhugh

HechtiDerLachs pushed a commit to HechtiDerLachs/Oscar.jl that referenced this pull request Sep 13, 2024
… polytrope) (oscar-system#3989)

Co-authored-by: SamiHalaseh <[email protected]>
Co-authored-by: Yue Ren <[email protected]>
Co-authored-by: Benjamin Lorenz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants