-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
Implement dual subdivision and weight vectors for tropical variety #38536
base: develop
Are you sure you want to change the base?
Conversation
Documentation preview for this PR (built with commit 60aa804; changes) is ready! 🎉 |
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.
Sorry for taking so long to get to this. Here are my comments.
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.
I think this is all of them that you did not change the case. Please be sure to run the doctests before pushing it.
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.
Thank you. A few other little changes. This should be the last round.
sage: (x + R(3)*x) * (x^2 + x) | ||
3*x^3 + 3*x^2 | ||
sage: (x^2 + R(1)*x + R(-1))^2 | ||
0*x^4 + 1*x^3 + 2*x^2 + 0*x + (-2) | ||
sage: (R(3)*x + R(1)) * (x^2 + x) | ||
3*x^3 + 3*x^2 + 1*x | ||
sage: (x^2 + x + R(0))^2 | ||
0*x^4 + 0*x^3 + 0*x^2 + 0*x + 0 |
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.
Again, why are you changing these tests? If you want to have different tests, just add them instead.
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.
You haven't answered why these tests are changed instead of adding additional ones.
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.
The test was changed to make it clearer while testing the same functionality.
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.
I would just have both. More examples/tests is not a bad thing. :)
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.
Also, the bot is reporting that the doc is not building. Have you checked locally?
sage: R.<x,y> = PolynomialRing(T) | ||
sage: p1 = R(3) + R(2)*x + R(2)*y + R(3)*x*y + x^2 + y^2 | ||
sage: p1.dual_subdivision() | ||
Polyhedral complex with 4 maximal cells |
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.
You should have it also display the maximal cell polytopes in this complex (with their explicit data) and also below.
sage: (x + R(3)*x) * (x^2 + x) | ||
3*x^3 + 3*x^2 | ||
sage: (x^2 + R(1)*x + R(-1))^2 | ||
0*x^4 + 1*x^3 + 2*x^2 + 0*x + (-2) | ||
sage: (R(3)*x + R(1)) * (x^2 + x) | ||
3*x^3 + 3*x^2 + 1*x | ||
sage: (x^2 + x + R(0))^2 | ||
0*x^4 + 0*x^3 + 0*x^2 + 0*x + 0 |
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.
You haven't answered why these tests are changed instead of adding additional ones.
The html doc builds properly locally, but the pdf does not. I am still figuring out where the error is. |
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.
This might fix the pdf docbuild issue; that can be more strict with the type of object linked. Other than that, I don't see any latex or formatting issues.
corresponding to the exponents of the monomials of tropical | ||
polynomial. | ||
|
||
OUTPUT: :class:`~sage.geometry.polyhedron.constructor.Polyhedron` |
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.
OUTPUT: :class:`~sage.geometry.polyhedron.constructor.Polyhedron` | |
OUTPUT: :func:`~sage.geometry.polyhedron.constructor.Polyhedron` |
sage: (x + R(3)*x) * (x^2 + x) | ||
3*x^3 + 3*x^2 | ||
sage: (x^2 + R(1)*x + R(-1))^2 | ||
0*x^4 + 1*x^3 + 2*x^2 + 0*x + (-2) | ||
sage: (R(3)*x + R(1)) * (x^2 + x) | ||
3*x^3 + 3*x^2 + 1*x | ||
sage: (x^2 + x + R(0))^2 | ||
0*x^4 + 0*x^3 + 0*x^2 + 0*x + 0 |
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.
I would just have both. More examples/tests is not a bad thing. :)
This PR introduces some new methods in
TropicalVariety
related to dual subdivision and weight vectors.Summary of changes:
Add
dual_subdivision
inTropicalVariety
: return the dual subdivision for any tropical variety as a Graph objectAdd
_components_of_vertices
inTropicalCurve
: intermediate method the help calculate weight vectorsAdd
weight_vectors
inTropicalCurve
: return the weight vectors of each vertexAdd
weight_vectors
inTropicalSurface
: return the weight vectors of each unique line of intersectionAdd a few methods related to dual subdivision of tropical curve such as:
is_smooth
is_simple
genus
contribution
CC: @tscrim
📝 Checklist
⌛ Dependencies
#37962: issues related to this PR
#38291: continuation of this PR