First time here? Check out the FAQ!

Ask Your Question
1

projection_direction broken for polytopes?

asked 10 years ago

smbelcas gravatar image

updated 10 years ago

kcrisman gravatar image

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... 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?

Preview: (hide)

Comments

Update: http://trac.sagemath.org/ticket/16625 now has a fix (and then some!) for this issue. Reviewers needed!

kcrisman gravatar imagekcrisman ( 10 years ago )

And has positive review, thanks Andrey.

kcrisman gravatar imagekcrisman ( 10 years ago )

2 Answers

Sort by » oldest newest most voted
2

answered 10 years ago

Volker Braun gravatar image

updated 10 years ago

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.

Preview: (hide)
link

Comments

And they are different, yay! Is it possible that in the past `show` did accept this argument?

kcrisman gravatar imagekcrisman ( 10 years ago )

Indeed, the example smbelcas gives is essentially identical to one in the documentation, so at the very least that would have to be updated.

kcrisman gravatar imagekcrisman ( 10 years ago )

Well, 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.)

smbelcas gravatar imagesmbelcas ( 10 years ago )
Volker Braun gravatar imageVolker Braun ( 10 years ago )
0

answered 10 years ago

kcrisman gravatar image

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.)

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.

Preview: (hide)
link

Comments

Um. When I execute that command, I get AttributeError: 'Polyhedra_ZZ_ppl_with_category.element_class' object has no attribute 'schlegel'

smbelcas gravatar imagesmbelcas ( 10 years ago )

?? 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.

kcrisman gravatar imagekcrisman ( 10 years ago )

Sage 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.)

smbelcas gravatar imagesmbelcas ( 10 years ago )

Okay, 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()`.

kcrisman gravatar imagekcrisman ( 10 years ago )

Wait, 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)?

smbelcas gravatar imagesmbelcas ( 10 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 10 years ago

Seen: 527 times

Last updated: Jul 08 '14