## internal casting for LatticePolytope does not work in shell?

Questions and problems about using polymake go here.

Moderator: Moderators

tran.mai.ngoc
Posts: 3
Joined: 04 Nov 2017, 16:59

### internal casting for LatticePolytope does not work in shell?

Hi,
I'm using the online polymake
https://shell.polymake.org/

I have a lattice polytope, and I need to check if it is smooth.
The polytope is:
$C3 = new Polytope(POINTS =>[[1,1,0,0,0,0,0,0,0,0], [1,0,0,0,0,1,0,0,0,0], [1,0,0,0,0,0,0,0,0,1], [1,1,1,0,1,1,0,0,0,0], [1,1,0,1,0,0,0,1,0,1], [1,0,0,0,0,1,1,0,1,1], [1,1,1,1,1,1,1,1,1,1],[1,0,0,0,0,0,0,0,0,0]]);$C3->LATTICE
returns 1, but I cannot get it casted to to Polytope<LatticePolytope>

(ie: the $C3->REFLEXIVE trick did not work.$C3->SMOOTH just returns nothing).

I've tried the example with the cube:
https://polymake.org/doku.php/tutorial/ ... s_tutorial
ie:

$p = cube(3);$p->type->full_name;
$p->LATTICE;$p->REFLEXIVE;
$p->type->full_name; but in the end the polytope type is still Polytope<Rational> however, the command print$p->SMOOTH;
still works, so that is quite mysterious.

Could you please let me know how I can explicitly cast a polytope as a LatticePolytope?
(And shouldn't the casting be done after one runs $C3->LATTICE?) joswig Main Author Posts: 216 Joined: 24 Dec 2010, 11:10 ### Re: internal casting for LatticePolytope does not work in shell? Your polytope is low-dimensional. Therefore, it is not reflexive by definition (at least in the sense of polymake). Code: Select all polytope > print$C3->DIM; 6 polytope > print $C3->AMBIENT_DIM; 9 polytope > print$C3->REFLEXIVE; 
I agree that no output is not very encouraging. But it actually works alright:

Code: Select all

polytope > if (!$C3->REFLEXIVE) { print "not reflexive" } not reflexive  We should consistently change the output to 0 to indicate false. Sorry for the inconvenience. joswig Main Author Posts: 216 Joined: 24 Dec 2010, 11:10 ### Re: internal casting for LatticePolytope does not work in shell? To actually answer your question: that type LatticePolytope is a relic from ancient polymake times. It is not needed any more, but it still somehow exists in some dark corners for backward compatibility. You just need the Polytope<Rational> type, and if LATTICE gives true, then it is a lattice polytope. If you do not want to have that checked by polymake, it is legal to specify this on input: Code: Select all polytope >$square = new Polytope(POINTS=>[[1,0,0],[1,1,0],[1,0,1],[1,1,1]], LATTICE=>1); 
But in this case you are responsible for the correctness. That is to say, polymake does not complain about the following:

Code: Select all

polytope > \$badquadrangle = new Polytope(POINTS=>[[1,0,0],[1,1,0],[1,0,1],[1,4/3,6/7]], LATTICE=>1); 
So it may give you inconsistent output later. This behavior is not by accident but rather by design.