-
-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gh-38291: Implement a custom class for tropical polynomials
<!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes #12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes #12345". --> This pull request introduces some new class for handling tropical polynomials and its related functionality. ### Summary of changes: 1. Added a new class: `TropicalPolynomialSemiring` as a parent of univariate tropical polynomials and incorporated this class into the `PolynomialRing` constructor. 2. Added a new class: `TropicalPolynomial` as an element of univariate tropical polynomials, which include methods like: - `roots`: return the list of tropical roots, counted with multiplicity - `splif_form`: return the tropical polynomial which has the same roots, but which can be reduced to its linear factors - `factor`: perform factorization - `piecewise_function`: return the tropical polynomial function - `plot`: plotting the tropical polynomial function 3. Added a new class: `TropicalMPolynomialSemiring` as a parent of multivariate tropical polynomials and incorporated this class into the `PolynomialRing` constructor. 4. Added a new class: `TropicalMPolynomial` as an element of multivariate tropical polynomials, which include methods like: - `plot3d`: return the 3d plot of tropical polynomials in two variables - `tropical_variety`: find tropical variety for any multivariate tropical polynomials 5. Added a new class: `TropicalVariety` and its subclass `TropicalCurve` and `TropicalSurface` to handle the result of `tropical_variety()` of multivariate tropical polynomials. The `TropicalVariety` include methods like: - `__init__`: calculation of tropical variety - `dimension`: return the dimension of tropical variety - `number_of_components`: return the number of components that make up this tropical variety - `components`: show all the components of this tropical variety - `_components_intersection`: return the intersection of three or more components 6. Implement the `plot` method inside the two subclasses, `TropicalCurve` and `TropicalSurface`. Fixes #37962. CC: @tscrim ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> URL: #38291 Reported by: Verrel Rievaldo Wijaya Reviewer(s): Travis Scrimshaw, Verrel Rievaldo Wijaya
- Loading branch information
Showing
10 changed files
with
2,920 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.