ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 17 Jul 2014 04:48:43 +0200projection_direction broken for polytopes?https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/Some years back (probably 2 or 3) Marshall very kindly sent me a notebook of polytope commands.
In that notebook there were the following:
poly = polytopes.twenty_four_cell()
poly.show()
poly.show(projection_direction=[2,5,11,17])
These last two commands produced different green diagrams... two years ago.
Today, they produce identical blue diagrams.
I search "sage projection_direction" and http://www.sagemath.org/doc/reference/geometry/sage/geometry/polyhedron/plot.html seems to indicate that the projection_direction option is still valid (not deprecated? should work? what's the correct phrasing here?).
Anyone know what's up with that?
Sat, 05 Jul 2014 15:43:45 +0200https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/Comment by kcrisman for <p>Some years back (probably 2 or 3) Marshall very kindly sent me a notebook of polytope commands.
In that notebook there were the following:</p>
<pre><code>poly = polytopes.twenty_four_cell()
poly.show()
poly.show(projection_direction=[2,5,11,17])
</code></pre>
<p>These last two commands produced different green diagrams... two years ago.
Today, they produce identical blue diagrams.</p>
<p>I search "sage projection_direction" and <a href="http://www.sagemath.org/doc/reference/geometry/sage/geometry/polyhedron/plot.html">http://www.sagemath.org/doc/reference...</a> seems to indicate that the projection_direction option is still valid (not deprecated? should work? what's the correct phrasing here?).</p>
<p>Anyone know what's up with that? </p>
https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23301#post-id-23301Update: http://trac.sagemath.org/ticket/16625 now has a fix (and then some!) for this issue. Reviewers needed!Wed, 09 Jul 2014 14:46:20 +0200https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23301#post-id-23301Comment by kcrisman for <p>Some years back (probably 2 or 3) Marshall very kindly sent me a notebook of polytope commands.
In that notebook there were the following:</p>
<pre><code>poly = polytopes.twenty_four_cell()
poly.show()
poly.show(projection_direction=[2,5,11,17])
</code></pre>
<p>These last two commands produced different green diagrams... two years ago.
Today, they produce identical blue diagrams.</p>
<p>I search "sage projection_direction" and <a href="http://www.sagemath.org/doc/reference/geometry/sage/geometry/polyhedron/plot.html">http://www.sagemath.org/doc/reference...</a> seems to indicate that the projection_direction option is still valid (not deprecated? should work? what's the correct phrasing here?).</p>
<p>Anyone know what's up with that? </p>
https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23445#post-id-23445And has positive review, thanks Andrey.Thu, 17 Jul 2014 04:48:43 +0200https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23445#post-id-23445Answer by kcrisman for <p>Some years back (probably 2 or 3) Marshall very kindly sent me a notebook of polytope commands.
In that notebook there were the following:</p>
<pre><code>poly = polytopes.twenty_four_cell()
poly.show()
poly.show(projection_direction=[2,5,11,17])
</code></pre>
<p>These last two commands produced different green diagrams... two years ago.
Today, they produce identical blue diagrams.</p>
<p>I search "sage projection_direction" and <a href="http://www.sagemath.org/doc/reference/geometry/sage/geometry/polyhedron/plot.html">http://www.sagemath.org/doc/reference...</a> seems to indicate that the projection_direction option is still valid (not deprecated? should work? what's the correct phrasing here?).</p>
<p>Anyone know what's up with that? </p>
https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?answer=23235#post-id-23235This is a bit weird. (Not the blue, that shouldn't have been green in the first place, though I can confirm that with older Sage versions it is.)
The Schlegel projection stuff is still technically working, or at least something is happening:
sage: from sage.geometry.polyhedron.plot import Projection
sage: P = Projection(poly)
sage: P.schlegel([2,3,5,7]).coordinates_of([1])
[(0.0538250745189, 0.279021759081, 0.729415128204)]
sage: P.schlegel([2,5,11,17]).coordinates_of([1])
[(-0.209018866441, 0.144793545531, 0.852418369476)]
And luckily, there is a workaround.
sage: P.schlegel([2,5,11,17]).show()
sage: P.schlegel([2,3,5,7]).show() # different!
But why the renderings directly from `projection_direction` are not different I can't say. To be fair, I don't see any difference in older (green) versions either, but I'm not that into polytopes or their projections myself so it could be inexperience. I'm putting some comments on some possible tickets that might have changed this in the hopes of getting you a better answer than this, though.Sun, 06 Jul 2014 03:41:16 +0200https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?answer=23235#post-id-23235Comment by smbelcas for <p>This is a bit weird. (Not the blue, that shouldn't have been green in the first place, though I can confirm that with older Sage versions it is.) </p>
<p>The Schlegel projection stuff is still technically working, or at least something is happening:</p>
<pre><code>sage: from sage.geometry.polyhedron.plot import Projection
sage: P = Projection(poly)
sage: P.schlegel([2,3,5,7]).coordinates_of([1])
[(0.0538250745189, 0.279021759081, 0.729415128204)]
sage: P.schlegel([2,5,11,17]).coordinates_of([1])
[(-0.209018866441, 0.144793545531, 0.852418369476)]
</code></pre>
<p>And luckily, there is a workaround.</p>
<pre><code>sage: P.schlegel([2,5,11,17]).show()
sage: P.schlegel([2,3,5,7]).show() # different!
</code></pre>
<p>But why the renderings directly from <code>projection_direction</code> are not different I can't say. To be fair, I don't see any difference in older (green) versions either, but I'm not that into polytopes or their projections myself so it could be inexperience. I'm putting some comments on some possible tickets that might have changed this in the hopes of getting you a better answer than this, though.</p>
https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23237#post-id-23237Um. When I execute that command, I get
AttributeError: 'Polyhedra_ZZ_ppl_with_category.element_class' object
has no attribute 'schlegel'Sun, 06 Jul 2014 05:22:11 +0200https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23237#post-id-23237Comment by kcrisman for <p>This is a bit weird. (Not the blue, that shouldn't have been green in the first place, though I can confirm that with older Sage versions it is.) </p>
<p>The Schlegel projection stuff is still technically working, or at least something is happening:</p>
<pre><code>sage: from sage.geometry.polyhedron.plot import Projection
sage: P = Projection(poly)
sage: P.schlegel([2,3,5,7]).coordinates_of([1])
[(0.0538250745189, 0.279021759081, 0.729415128204)]
sage: P.schlegel([2,5,11,17]).coordinates_of([1])
[(-0.209018866441, 0.144793545531, 0.852418369476)]
</code></pre>
<p>And luckily, there is a workaround.</p>
<pre><code>sage: P.schlegel([2,5,11,17]).show()
sage: P.schlegel([2,3,5,7]).show() # different!
</code></pre>
<p>But why the renderings directly from <code>projection_direction</code> are not different I can't say. To be fair, I don't see any difference in older (green) versions either, but I'm not that into polytopes or their projections myself so it could be inexperience. I'm putting some comments on some possible tickets that might have changed this in the hopes of getting you a better answer than this, though.</p>
https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23251#post-id-23251?? Can you report exactly which version and OS you see that error on? This works for me both on bleeding-edge as well as a two-year-old copy of Sage.Mon, 07 Jul 2014 14:43:02 +0200https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23251#post-id-23251Comment by smbelcas for <p>This is a bit weird. (Not the blue, that shouldn't have been green in the first place, though I can confirm that with older Sage versions it is.) </p>
<p>The Schlegel projection stuff is still technically working, or at least something is happening:</p>
<pre><code>sage: from sage.geometry.polyhedron.plot import Projection
sage: P = Projection(poly)
sage: P.schlegel([2,3,5,7]).coordinates_of([1])
[(0.0538250745189, 0.279021759081, 0.729415128204)]
sage: P.schlegel([2,5,11,17]).coordinates_of([1])
[(-0.209018866441, 0.144793545531, 0.852418369476)]
</code></pre>
<p>And luckily, there is a workaround.</p>
<pre><code>sage: P.schlegel([2,5,11,17]).show()
sage: P.schlegel([2,3,5,7]).show() # different!
</code></pre>
<p>But why the renderings directly from <code>projection_direction</code> are not different I can't say. To be fair, I don't see any difference in older (green) versions either, but I'm not that into polytopes or their projections myself so it could be inexperience. I'm putting some comments on some possible tickets that might have changed this in the hopes of getting you a better answer than this, though.</p>
https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23254#post-id-23254Sage 6.2, Mac OS X 10.7.5.
Let's be extra clear: I executed
P8 = polytopes.n_cube(4)
P8.show()
P8.schlegel([2,5,11,17]).show() (Sorry, I don't know how to get carriage returns or boxes in comments.)Mon, 07 Jul 2014 23:30:38 +0200https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23254#post-id-23254Comment by kcrisman for <p>This is a bit weird. (Not the blue, that shouldn't have been green in the first place, though I can confirm that with older Sage versions it is.) </p>
<p>The Schlegel projection stuff is still technically working, or at least something is happening:</p>
<pre><code>sage: from sage.geometry.polyhedron.plot import Projection
sage: P = Projection(poly)
sage: P.schlegel([2,3,5,7]).coordinates_of([1])
[(0.0538250745189, 0.279021759081, 0.729415128204)]
sage: P.schlegel([2,5,11,17]).coordinates_of([1])
[(-0.209018866441, 0.144793545531, 0.852418369476)]
</code></pre>
<p>And luckily, there is a workaround.</p>
<pre><code>sage: P.schlegel([2,5,11,17]).show()
sage: P.schlegel([2,3,5,7]).show() # different!
</code></pre>
<p>But why the renderings directly from <code>projection_direction</code> are not different I can't say. To be fair, I don't see any difference in older (green) versions either, but I'm not that into polytopes or their projections myself so it could be inexperience. I'm putting some comments on some possible tickets that might have changed this in the hopes of getting you a better answer than this, though.</p>
https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23264#post-id-23264Okay, that is a different question (note that you did a different polytope than in your original question) and presumably a bug, which I can replicate (see http://trac.sagemath.org/ticket/16625). Apparently `P8.schlegel_projection().show()` works but doesn't do anything different than `show()`.Tue, 08 Jul 2014 15:29:23 +0200https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23264#post-id-23264Comment by smbelcas for <p>This is a bit weird. (Not the blue, that shouldn't have been green in the first place, though I can confirm that with older Sage versions it is.) </p>
<p>The Schlegel projection stuff is still technically working, or at least something is happening:</p>
<pre><code>sage: from sage.geometry.polyhedron.plot import Projection
sage: P = Projection(poly)
sage: P.schlegel([2,3,5,7]).coordinates_of([1])
[(0.0538250745189, 0.279021759081, 0.729415128204)]
sage: P.schlegel([2,5,11,17]).coordinates_of([1])
[(-0.209018866441, 0.144793545531, 0.852418369476)]
</code></pre>
<p>And luckily, there is a workaround.</p>
<pre><code>sage: P.schlegel([2,5,11,17]).show()
sage: P.schlegel([2,3,5,7]).show() # different!
</code></pre>
<p>But why the renderings directly from <code>projection_direction</code> are not different I can't say. To be fair, I don't see any difference in older (green) versions either, but I'm not that into polytopes or their projections myself so it could be inexperience. I'm putting some comments on some possible tickets that might have changed this in the hopes of getting you a better answer than this, though.</p>
https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23266#post-id-23266Wait, how is that a different question? The schlegel command should work for all internally-defined sage polytopes equally well, shouldn't it?
Plus, when I do
poly = polytopes.twenty_four_cell()
poly.schlegel([2,5,11,17]).show()
I get
AttributeError: 'Polyhedra_QQ_ppl_with_category.element_class' object
has no attribute 'schlegel'
Maybe this is because you loaded some extra package that I did not load (because I'm just trying to use stuff built in to sage at this point)?Tue, 08 Jul 2014 16:23:11 +0200https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23266#post-id-23266Comment by kcrisman for <p>This is a bit weird. (Not the blue, that shouldn't have been green in the first place, though I can confirm that with older Sage versions it is.) </p>
<p>The Schlegel projection stuff is still technically working, or at least something is happening:</p>
<pre><code>sage: from sage.geometry.polyhedron.plot import Projection
sage: P = Projection(poly)
sage: P.schlegel([2,3,5,7]).coordinates_of([1])
[(0.0538250745189, 0.279021759081, 0.729415128204)]
sage: P.schlegel([2,5,11,17]).coordinates_of([1])
[(-0.209018866441, 0.144793545531, 0.852418369476)]
</code></pre>
<p>And luckily, there is a workaround.</p>
<pre><code>sage: P.schlegel([2,5,11,17]).show()
sage: P.schlegel([2,3,5,7]).show() # different!
</code></pre>
<p>But why the renderings directly from <code>projection_direction</code> are not different I can't say. To be fair, I don't see any difference in older (green) versions either, but I'm not that into polytopes or their projections myself so it could be inexperience. I'm putting some comments on some possible tickets that might have changed this in the hopes of getting you a better answer than this, though.</p>
https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23268#post-id-23268No extra loading. I am confused myself now, and will try to go back to the drawing board... it did work for me, I promise!Tue, 08 Jul 2014 18:04:53 +0200https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23268#post-id-23268Comment by kcrisman for <p>This is a bit weird. (Not the blue, that shouldn't have been green in the first place, though I can confirm that with older Sage versions it is.) </p>
<p>The Schlegel projection stuff is still technically working, or at least something is happening:</p>
<pre><code>sage: from sage.geometry.polyhedron.plot import Projection
sage: P = Projection(poly)
sage: P.schlegel([2,3,5,7]).coordinates_of([1])
[(0.0538250745189, 0.279021759081, 0.729415128204)]
sage: P.schlegel([2,5,11,17]).coordinates_of([1])
[(-0.209018866441, 0.144793545531, 0.852418369476)]
</code></pre>
<p>And luckily, there is a workaround.</p>
<pre><code>sage: P.schlegel([2,5,11,17]).show()
sage: P.schlegel([2,3,5,7]).show() # different!
</code></pre>
<p>But why the renderings directly from <code>projection_direction</code> are not different I can't say. To be fair, I don't see any difference in older (green) versions either, but I'm not that into polytopes or their projections myself so it could be inexperience. I'm putting some comments on some possible tickets that might have changed this in the hopes of getting you a better answer than this, though.</p>
https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23269#post-id-23269Sorry, I figured it out - you need the business about importing `Projection`. (Read the whole answer - apparently I also forgot to do so.) And then all works fine. I will repurpose #16625 for the first bug.Tue, 08 Jul 2014 18:21:28 +0200https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23269#post-id-23269Answer by Volker Braun for <p>Some years back (probably 2 or 3) Marshall very kindly sent me a notebook of polytope commands.
In that notebook there were the following:</p>
<pre><code>poly = polytopes.twenty_four_cell()
poly.show()
poly.show(projection_direction=[2,5,11,17])
</code></pre>
<p>These last two commands produced different green diagrams... two years ago.
Today, they produce identical blue diagrams.</p>
<p>I search "sage projection_direction" and <a href="http://www.sagemath.org/doc/reference/geometry/sage/geometry/polyhedron/plot.html">http://www.sagemath.org/doc/reference...</a> seems to indicate that the projection_direction option is still valid (not deprecated? should work? what's the correct phrasing here?).</p>
<p>Anyone know what's up with that? </p>
https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?answer=23270#post-id-23270 This works for me:
sage: P8.schlegel_projection([2,5,11,17]).show()
The polyhedron show() method does not support a `projection_direction` optional argument. The reference manual link that you gave points to the internally-used `Projection` class, not the `Polyhedron` class which is the user interface.Tue, 08 Jul 2014 18:25:40 +0200https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?answer=23270#post-id-23270Comment by kcrisman for <p>This works for me:</p>
<pre><code>sage: P8.schlegel_projection([2,5,11,17]).show()
</code></pre>
<p>The polyhedron show() method does not support a <code>projection_direction</code> optional argument. The reference manual link that you gave points to the internally-used <code>Projection</code> class, not the <code>Polyhedron</code> class which is the user interface.</p>
https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23273#post-id-23273Indeed, the example smbelcas gives is essentially identical to one in the documentation, so at the very least that would have to be updated.Tue, 08 Jul 2014 18:34:32 +0200https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23273#post-id-23273Comment by kcrisman for <p>This works for me:</p>
<pre><code>sage: P8.schlegel_projection([2,5,11,17]).show()
</code></pre>
<p>The polyhedron show() method does not support a <code>projection_direction</code> optional argument. The reference manual link that you gave points to the internally-used <code>Projection</code> class, not the <code>Polyhedron</code> class which is the user interface.</p>
https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23271#post-id-23271And they are different, yay! Is it possible that in the past `show` did accept this argument?Tue, 08 Jul 2014 18:30:44 +0200https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23271#post-id-23271Comment by smbelcas for <p>This works for me:</p>
<pre><code>sage: P8.schlegel_projection([2,5,11,17]).show()
</code></pre>
<p>The polyhedron show() method does not support a <code>projection_direction</code> optional argument. The reference manual link that you gave points to the internally-used <code>Projection</code> class, not the <code>Polyhedron</code> class which is the user interface.</p>
https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23280#post-id-23280Well, it's *certain* that 'show' used to take the argument, as it worked when Marshall sent me the code way back when. (And yes, it would be good to update the documentation so that people aren't confused.)Tue, 08 Jul 2014 21:44:38 +0200https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23280#post-id-23280Comment by Volker Braun for <p>This works for me:</p>
<pre><code>sage: P8.schlegel_projection([2,5,11,17]).show()
</code></pre>
<p>The polyhedron show() method does not support a <code>projection_direction</code> optional argument. The reference manual link that you gave points to the internally-used <code>Projection</code> class, not the <code>Polyhedron</code> class which is the user interface.</p>
https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23314#post-id-23314Fixed in http://trac.sagemath.org/ticket/16625 (needs review)Wed, 09 Jul 2014 17:38:14 +0200https://ask.sagemath.org/question/23223/projection_direction-broken-for-polytopes/?comment=23314#post-id-23314