Sage: Ticket #18220: disallow non exact fields for the 'field' backend
https://trac.sagemath.org/ticket/18220
<p>
The 'field' backend does not properly support non exact fields
</p>
<pre class="wiki">sage: omega = 2*RR.pi() / 5
sage: verts = [((i*omega).sin(), (i*omega).cos()) for i in range(5)]
sage: verts
sage: Polyhedron(vertices=verts, base_ring=RR)
Traceback (most recent call last):
...
AssertionError:
</pre><p>
or
</p>
<pre class="wiki">sage: Q = polytopes.icosahedron()
sage: Q = polytopes.icosahedron(); Q
A 3-dimensional polyhedron in (Number Field in sqrt5 with defining polynomial x^2 - 5)^3 defined as the convex hull of 12 vertices
sage: Q_RR = Polyhedron(vertices = [n(v.vector(),digits=10) for v in Q.vertices()])
sage: Q_RR
A 3-dimensional polyhedron in (Real Field with 37 bits of precision)^3 defined as the convex hull of 7 vertices
sage: Q_RR = Polyhedron(vertices = [n(v.vector(),digits=30) for v in Q.vertices()])
sage: Q_RR
A 3-dimensional polyhedron in (Real Field with 103 bits of precision)^3 defined as the convex hull of 1 vertex and 3 rays
</pre><p>
We simply raise an error if somebody want to try this.
</p>
en-usSagehttps://trac.sagemath.org/chrome/site/logo_sagemath_trac.png
https://trac.sagemath.org/ticket/18220
Trac 1.1.6vdelecroixThu, 16 Apr 2015 14:45:06 GMTkeywords set
https://trac.sagemath.org/ticket/18220#comment:1
https://trac.sagemath.org/ticket/18220#comment:1
<ul>
<li><strong>keywords</strong>
<em>bug</em> added
</li>
</ul>
TicketmkoeppeMon, 27 Jun 2016 04:48:30 GMT
https://trac.sagemath.org/ticket/18220#comment:2
https://trac.sagemath.org/ticket/18220#comment:2
<p>
Another bug for RDF polyhedra: <a class="closed ticket" href="https://trac.sagemath.org/ticket/21270" title="defect: Polyhedron RDF face lattice bug / intersection of polyhedra (closed: fixed)">#21270</a>
</p>
TicketmkoeppeWed, 17 Aug 2016 20:15:10 GMTmilestone changed; cc set
https://trac.sagemath.org/ticket/18220#comment:3
https://trac.sagemath.org/ticket/18220#comment:3
<ul>
<li><strong>cc</strong>
<em>chapoton</em> added
</li>
<li><strong>milestone</strong>
changed from <em>sage-6.7</em> to <em>sage-7.4</em>
</li>
</ul>
TicketjipilabMon, 06 Mar 2017 00:49:59 GMTcc, description changed
https://trac.sagemath.org/ticket/18220#comment:4
https://trac.sagemath.org/ticket/18220#comment:4
<ul>
<li><strong>cc</strong>
<em>jipilab</em> added
</li>
<li><strong>description</strong>
modified (<a href="/ticket/18220?action=diff&version=4">diff</a>)
</li>
</ul>
TicketvdelecroixMon, 06 Mar 2017 01:12:43 GMTstatus, description, summary changed; author, branch, commit set
https://trac.sagemath.org/ticket/18220#comment:5
https://trac.sagemath.org/ticket/18220#comment:5
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>needs_review</em>
</li>
<li><strong>description</strong>
modified (<a href="/ticket/18220?action=diff&version=5">diff</a>)
</li>
<li><strong>author</strong>
set to <em>Vincent Delecroix</em>
</li>
<li><strong>summary</strong>
changed from <em>Bug when creating a polyhedron with coefficients in RR</em> to <em>disallow non exact fields for the 'field' backend</em>
</li>
<li><strong>branch</strong>
set to <em>u/vdelecroix/18220</em>
</li>
<li><strong>commit</strong>
set to <em>c28fcf05115ba98f832e74a94eb518bb53117d2a</em>
</li>
</ul>
<p>
New commits:
</p>
<table class="wiki">
<tr><td><a class="ext-link" href="https://git.sagemath.org/sage.git/commit?id=c28fcf05115ba98f832e74a94eb518bb53117d2a"><span class="icon"></span>c28fcf0</a></td><td><code>18220: raise an error for non exact fields</code>
</td></tr></table>
TicketvdelecroixMon, 06 Mar 2017 01:13:17 GMTkeywords changed
https://trac.sagemath.org/ticket/18220#comment:6
https://trac.sagemath.org/ticket/18220#comment:6
<ul>
<li><strong>keywords</strong>
<em>days84</em> added
</li>
</ul>
TicketjipilabMon, 06 Mar 2017 15:19:37 GMTcc changed
https://trac.sagemath.org/ticket/18220#comment:7
https://trac.sagemath.org/ticket/18220#comment:7
<ul>
<li><strong>cc</strong>
<em>mkoeppe</em> added
</li>
</ul>
TicketjipilabMon, 06 Mar 2017 18:00:59 GMT
https://trac.sagemath.org/ticket/18220#comment:8
https://trac.sagemath.org/ticket/18220#comment:8
<p>
The tests pass on my machine with 7.6.beta6. The documentation looks fine as well. No idea what the quasar bot is up to.
</p>
<p>
The I believe it is a good idea to raise an error for such a behaviour.
</p>
<p>
Matthias, any thoughts? Does that look good for you?
</p>
TicketmkoeppeTue, 07 Mar 2017 22:38:23 GMT
https://trac.sagemath.org/ticket/18220#comment:9
https://trac.sagemath.org/ticket/18220#comment:9
<p>
I agree with disabling it for floating point,
but I'm not sure about disabling it for the SR as well. Maybe there are some people who want to work with polytopes with transcendental coordinates?
</p>
TicketvdelecroixTue, 07 Mar 2017 22:57:10 GMT
https://trac.sagemath.org/ticket/18220#comment:10
https://trac.sagemath.org/ticket/18220#comment:10
<p>
<strong>I</strong> would like to make computations with trascendental coordinates. However, the symbolic ring is not the proper way to do it. I am very much against special casing SR anywhere. SR has its own logic that does not fit at all with the Sage logic of parents and coercion. Moreover, comparison is completely broken
</p>
<pre class="wiki">sage: bool(pi == 245850922/78256779)
True
</pre>
TicketjipilabWed, 08 Mar 2017 21:26:19 GMTstatus changed; reviewer set
https://trac.sagemath.org/ticket/18220#comment:11
https://trac.sagemath.org/ticket/18220#comment:11
<ul>
<li><strong>status</strong>
changed from <em>needs_review</em> to <em>positive_review</em>
</li>
<li><strong>reviewer</strong>
set to <em>Jean-Philippe Labbé</em>
</li>
</ul>
<p>
Then, let's restrict the usage of the symbolic ring with polyhedron.
</p>
<p>
If it ever happens that there is a use case of the symbolic ring, we may consider adapting it properly then.
</p>
TicketnovoseltThu, 09 Mar 2017 04:02:42 GMTstatus changed
https://trac.sagemath.org/ticket/18220#comment:12
https://trac.sagemath.org/ticket/18220#comment:12
<ul>
<li><strong>status</strong>
changed from <em>positive_review</em> to <em>needs_info</em>
</li>
</ul>
<p>
WAIT!!! Are you proposing to drop support for RR/RDF and other floating points?! With all the bugs it is still useful to be able to operate with them, if you think it is too dangerous, how about throwing a warning?
</p>
TicketvdelecroixThu, 09 Mar 2017 12:44:11 GMT
https://trac.sagemath.org/ticket/18220#comment:13
https://trac.sagemath.org/ticket/18220#comment:13
<p>
As mentioned in the title description, it only concerns the "field" backend that is <strong>very much</strong> broken for non exact fields. Other backends still support <code>RDF</code> as it used to be.
</p>
TicketnovoseltFri, 10 Mar 2017 05:26:29 GMTstatus changed
https://trac.sagemath.org/ticket/18220#comment:14
https://trac.sagemath.org/ticket/18220#comment:14
<ul>
<li><strong>status</strong>
changed from <em>needs_info</em> to <em>positive_review</em>
</li>
</ul>
<p>
OK, sorry for the false alarm (it was an end of a tough day yesterday ;-)). I guess I got confused by the strange name for a backend as well...
</p>
TicketjipilabFri, 10 Mar 2017 08:07:33 GMT
https://trac.sagemath.org/ticket/18220#comment:15
https://trac.sagemath.org/ticket/18220#comment:15
<blockquote class="citation">
<p>
OK, sorry for the false alarm (it was an end of a tough day yesterday ;-)). I guess I got confused by the strange name for a backend as well...
</p>
</blockquote>
<p>
No worries!
</p>
<p>
It is true that the name 'field' is confusing...
</p>
TicketvdelecroixFri, 10 Mar 2017 08:18:58 GMT
https://trac.sagemath.org/ticket/18220#comment:16
https://trac.sagemath.org/ticket/18220#comment:16
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/18220#comment:15" title="Comment 15">jipilab</a>:
</p>
<blockquote class="citation">
<blockquote class="citation">
<p>
OK, sorry for the false alarm (it was an end of a tough day yesterday ;-)). I guess I got confused by the strange name for a backend as well...
</p>
</blockquote>
<p>
No worries!
</p>
<p>
It is true that the name 'field' is confusing...
</p>
</blockquote>
<p>
What about changing it to 'generic'?
</p>
TicketvdelecroixFri, 10 Mar 2017 08:19:22 GMT
https://trac.sagemath.org/ticket/18220#comment:17
https://trac.sagemath.org/ticket/18220#comment:17
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/18220#comment:16" title="Comment 16">vdelecroix</a>:
</p>
<blockquote class="citation">
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/18220#comment:15" title="Comment 15">jipilab</a>:
</p>
<blockquote class="citation">
<blockquote class="citation">
<p>
OK, sorry for the false alarm (it was an end of a tough day yesterday ;-)). I guess I got confused by the strange name for a backend as well...
</p>
</blockquote>
<p>
No worries!
</p>
<p>
It is true that the name 'field' is confusing...
</p>
</blockquote>
<p>
What about changing it to 'generic'?
</p>
</blockquote>
<p>
or 'generic_exact', or 'sage_toy', or ...
</p>
TicketjipilabFri, 10 Mar 2017 08:37:34 GMT
https://trac.sagemath.org/ticket/18220#comment:18
https://trac.sagemath.org/ticket/18220#comment:18
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/18220#comment:17" title="Comment 17">vdelecroix</a>:
</p>
<blockquote class="citation">
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/18220#comment:16" title="Comment 16">vdelecroix</a>:
</p>
<blockquote class="citation">
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/18220#comment:15" title="Comment 15">jipilab</a>:
</p>
<blockquote class="citation">
<blockquote class="citation">
<p>
OK, sorry for the false alarm (it was an end of a tough day yesterday ;-)). I guess I got confused by the strange name for a backend as well...
</p>
</blockquote>
<p>
No worries!
</p>
<p>
It is true that the name 'field' is confusing...
</p>
</blockquote>
<p>
What about changing it to 'generic'?
</p>
</blockquote>
<p>
or 'generic_exact', or 'sage_toy', or ...
</p>
</blockquote>
<p>
In this setup I would not call the backend generic, because it does not provide the principal reason to use it: irrational exact values.
</p>
<p>
What about <code>irrational_exact</code> ?
</p>
TicketvdelecroixFri, 10 Mar 2017 08:41:52 GMT
https://trac.sagemath.org/ticket/18220#comment:19
https://trac.sagemath.org/ticket/18220#comment:19
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/18220#comment:18" title="Comment 18">jipilab</a>:
</p>
<blockquote class="citation">
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/18220#comment:17" title="Comment 17">vdelecroix</a>:
</p>
<blockquote class="citation">
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/18220#comment:16" title="Comment 16">vdelecroix</a>:
</p>
<blockquote class="citation">
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/18220#comment:15" title="Comment 15">jipilab</a>:
</p>
<blockquote class="citation">
<blockquote class="citation">
<p>
OK, sorry for the false alarm (it was an end of a tough day yesterday ;-)). I guess I got confused by the strange name for a backend as well...
</p>
</blockquote>
<p>
No worries!
</p>
<p>
It is true that the name 'field' is confusing...
</p>
</blockquote>
<p>
What about changing it to 'generic'?
</p>
</blockquote>
<p>
or 'generic_exact', or 'sage_toy', or ...
</p>
</blockquote>
<p>
In this setup I would not call the backend generic, because it does not provide the principal reason to use it: irrational exact values.
</p>
<p>
What about <code>irrational_exact</code> ?
</p>
</blockquote>
<p>
It is even more confusing since this backend can deal with rationals... <code>generic_exact</code>?
</p>
TicketjipilabFri, 10 Mar 2017 08:48:18 GMT
https://trac.sagemath.org/ticket/18220#comment:20
https://trac.sagemath.org/ticket/18220#comment:20
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/18220#comment:19" title="Comment 19">vdelecroix</a>:
</p>
<blockquote class="citation">
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/18220#comment:18" title="Comment 18">jipilab</a>:
</p>
<blockquote class="citation">
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/18220#comment:17" title="Comment 17">vdelecroix</a>:
</p>
<blockquote class="citation">
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/18220#comment:16" title="Comment 16">vdelecroix</a>:
</p>
<blockquote class="citation">
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/18220#comment:15" title="Comment 15">jipilab</a>:
</p>
<blockquote class="citation">
<blockquote class="citation">
<p>
OK, sorry for the false alarm (it was an end of a tough day yesterday ;-)). I guess I got confused by the strange name for a backend as well...
</p>
</blockquote>
<p>
No worries!
</p>
<p>
It is true that the name 'field' is confusing...
</p>
</blockquote>
<p>
What about changing it to 'generic'?
</p>
</blockquote>
<p>
or 'generic_exact', or 'sage_toy', or ...
</p>
</blockquote>
<p>
In this setup I would not call the backend generic, because it does not provide the principal reason to use it: irrational exact values.
</p>
<p>
What about <code>irrational_exact</code> ?
</p>
</blockquote>
<p>
It is even more confusing since this backend can deal with rationals... <code>generic_exact</code>?
</p>
</blockquote>
<p>
Right... hmm.
</p>
<p>
+1 for <code>generic_exact</code>.
</p>
<p>
;-)
</p>
TicketvbraunSat, 11 Mar 2017 10:20:39 GMTstatus, branch changed; resolution set
https://trac.sagemath.org/ticket/18220#comment:21
https://trac.sagemath.org/ticket/18220#comment:21
<ul>
<li><strong>status</strong>
changed from <em>positive_review</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>fixed</em>
</li>
<li><strong>branch</strong>
changed from <em>u/vdelecroix/18220</em> to <em>c28fcf05115ba98f832e74a94eb518bb53117d2a</em>
</li>
</ul>
TicketjipilabWed, 15 Mar 2017 07:41:53 GMTcommit deleted
https://trac.sagemath.org/ticket/18220#comment:22
https://trac.sagemath.org/ticket/18220#comment:22
<ul>
<li><strong>commit</strong>
<em>c28fcf05115ba98f832e74a94eb518bb53117d2a</em> deleted
</li>
</ul>
<p>
I just saw that in the documentation of version 7.6.rc0, the doc file of the backend <code>field</code> is called "the python backend".
</p>
<p>
Maybe we should create a ticket about renaming the backend.
</p>
Ticket