Skip to content

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

Merged
joschmitt merged 16 commits intooscar-system:masterfrom
Sami-Halaseh:polytropes
Aug 19, 2024
Merged

A function checking if a tropical polytope is ordinarily convex (ie a polytrope)#3989
joschmitt merged 16 commits intooscar-system:masterfrom
Sami-Halaseh:polytropes

Conversation

@Sami-Halaseh
Copy link
Copy Markdown
Contributor

No description provided.

@Sami-Halaseh
Copy link
Copy Markdown
Contributor Author

@ooinaruhugh @lenweis

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

@danteluber

@codecov
Copy link
Copy Markdown

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

Comment thread src/TropicalGeometry/matrix.jl Outdated
Copy link
Copy Markdown
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.

Comment thread src/TropicalGeometry/matrix.jl Outdated
Comment thread src/TropicalGeometry/matrix.jl Outdated
Comment thread src/TropicalGeometry/matrix.jl Outdated
Comment thread src/TropicalGeometry/matrix.jl Outdated
@Sami-Halaseh
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread src/TropicalGeometry/matrix.jl Outdated
Comment thread src/TropicalGeometry/matrix.jl Outdated
Sami-Halaseh and others added 2 commits August 12, 2024 20:49
Co-authored-by: Yue Ren <yue.ren.kl@gmail.com>
Co-authored-by: Yue Ren <yue.ren.kl@gmail.com>
@Sami-Halaseh
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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?

Comment thread src/TropicalGeometry/matrix.jl Outdated
Comment thread src/TropicalGeometry/matrix.jl Outdated
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
Copy Markdown
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 and others added 2 commits August 16, 2024 07:47
Co-authored-by: Benjamin Lorenz <benlorenz@users.noreply.github.com>
@Sami-Halaseh
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread src/TropicalGeometry/matrix.jl Outdated
Comment thread src/TropicalGeometry/matrix.jl Outdated
Comment thread test/TropicalGeometry/matrix.jl
Sami-Halaseh and others added 3 commits August 16, 2024 12:38
Co-authored-by: Benjamin Lorenz <benlorenz@users.noreply.github.com>
Co-authored-by: Benjamin Lorenz <benlorenz@users.noreply.github.com>
Co-authored-by: Benjamin Lorenz <benlorenz@users.noreply.github.com>
Copy link
Copy Markdown
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
@micjoswig
Copy link
Copy Markdown
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 <sami.halaseh@mail.utoronto.ca>
Co-authored-by: Yue Ren <yue.ren.kl@gmail.com>
Co-authored-by: Benjamin Lorenz <benlorenz@users.noreply.github.com>
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