#18213: A lot of polytopes constructor are broken
-------------------------------------+-------------------------------------
Reporter: vdelecroix | Owner:
Type: defect | Status: needs_review
Priority: major | Milestone: sage-6.7
Component: geometry | Resolution:
Keywords: | Merged in:
Authors: Vincent Delecroix | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/vdelecroix/18213 | c44b53efbe0fa899951481b96c4ab0a15ebb88e3
Dependencies: #18211 | Stopgaps:
-------------------------------------+-------------------------------------
Description changed by vdelecroix:
Old description:
> 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.
>
> While we're at it, remove the deprecations from #11634.
New description:
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.
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
--
--
Ticket URL: <http://trac.sagemath.org/ticket/18213#comment:7>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.