-
-
Notifications
You must be signed in to change notification settings - Fork 453
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #18213: A lot of polytope constructors are broken
A lot of polytopes constructors in `sage.geometry.polyhedron.library`. For example 1. The Rhombicuboctahedron does not return what it should (as Python division was thought as Sage integer divisions). There is in the code {{{ verts = [ [-3/2, -1/2, -1/2], [-3/2, -1/2, 1/2], [-3/2, 1/2, -1/2], ... }}} 2. The `great_rhombicuboctahedron` is defined over `QQ` but it should be defined over `QQ[sqrt(2)]`! There are in two places rough approximation of sqrt(2) in the code {{{ v1 = QQ(131739771357/54568400000) # ~ sqrt(2) + 1 but actually 2 due to Python division v2 = QQ(104455571357/27284200000) # ~ 2 sqrt(2) but actually 3 due to Python division }}} Instead, we should use the `base_ring` argument (with appropriate defaults) and use `base_ring(2).sqrt()` instead. 3. The functions unrelated to construction of Polytopes are moved out of the class `Polytopes`: - `Polytopes.orthonormal_1`, `Polytopes.project_1` will be renamed respectively `zero_sum_projection` and `project_points` - the one line `Polytopes._pfunc` is just removed While we're at it, remove the deprecations from #11634. During the process I discovered two annoying bugs: - #18214 Bug in volume computation of polyhedron - #18220 Bug when creating a polyhedron with coefficients in RR Moreover, we can get a great speed up with the following because many polytopes have now coordinates in a quadratic number fields: - #18215: Huge speed up for hash of quadratic number field elements - #18226: Native _mpfr_ method on quadratic number field elements URL: http://trac.sagemath.org/18213 Reported by: vdelecroix Ticket author(s): Vincent Delecroix Reviewer(s): Nathann Cohen
- Loading branch information
Showing
15 changed files
with
877 additions
and
547 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
Oops, something went wrong.