Manipulation of Schlegel diagrams

Questions and problems about using polymake go here.
jbe
Posts: 3
Joined: 27 Mar 2021, 13:02

Manipulation of Schlegel diagrams

Postby jbe » 27 Mar 2021, 14:00

Hello,

I use polymake 4.3 on MacOS and I'd like to process Schlegel diagrams of 4-d polytopes.

I first create a 4-d polytope $p from points, then both '$p->VISUAL;' and '$p->SCHLEGEL;' open a browser window with a three.js script.
Everything looks great!
But how can I obtain the 3-d vertex coordinates and edges of the Schlegel diagram?
The tikz output works fine and I could grab the information from there, but there might be a simpler way.

Thank you very much for your help, and kudos for the great work.

User avatar
gawrilow
Main Author
Posts: 386
Joined: 25 Dec 2010, 17:40

Re: Manipulation of Schlegel diagrams

Postby gawrilow » 27 Mar 2021, 22:59

Coordinates (affine, not projective!) are available under $p->SCHLEGEL_DIAGRAM->VERTICES.
The edges are just the 1-skeleton, $p->GRAPH->EDGES.

jbe
Posts: 3
Joined: 27 Mar 2021, 13:02

Re: Manipulation of Schlegel diagrams

Postby jbe » 28 Mar 2021, 10:08

Thank you very much for your quick answer.
Unfortunately, I tried what you say, and I don't get any output.
The first time, it says "available properties insufficient to compute 'SCHLEGEL_DIAGRAM.VERTICES'"
The second time, it just remains silent. Visualization via '$p->SCHLEGEL;' is still fine.
Below is a dump of what I wrote.

----
polytope > $p = new Polytope(POINTS=>[[1.0, 0.0, 0.0, 0.0, 0.0], [1.0, 5.0, 0.0, 0.0, 0.0], [1.0, 5.0, 3.0, 0.0, 0.0], [1.0, 5.0, 3.0, 2.0, 0.0], [1.0, 5.0, 3.0, 2.0, 1.0], [1.0, 5.0, 3.0, 0.0, 2.0], [1.0, 5.0, 3.0, 1.0, 2.0], [1.0, 5.0, 0.0, 3.0, 0.0], [1.0, 5.0, 2.0, 3.0, 0.0], [1.0, 5.0, 2.0, 3.0, 1.0], [1.0, 5.0, 0.0, 3.0, 2.0], [1.0, 5.0, 1.0, 3.0, 2.0], [1.0, 5.0, 0.0, 0.0, 3.0], [1.0, 5.0, 2.0, 0.0, 3.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.0], [1.0, 0.0, 3.0, 0.0, 5.0], [1.0, 2.0, 3.0, 0.0, 5.0], [1.0, 2.0, 3.0, 1.0, 5.0], [1.0, 0.0, 3.0, 2.0, 5.0], [1.0, 1.0, 3.0, 2.0, 5.0], [1.0, 0.0, 0.0, 3.0, 5.0], [1.0, 2.0, 0.0, 3.0, 5.0], [1.0, 2.0, 1.0, 3.0, 5.0], [1.0, 0.0, 2.0, 3.0, 5.0], [1.0, 1.0, 2.0, 3.0, 5.0]]);

polytope > print $p->SCHLEGEL_DIAGRAM->VERTICES;
polymake: WARNING: available properties insufficient to compute 'SCHLEGEL_DIAGRAM.VERTICES'
polymake: used package cdd
cddlib
Implementation of the double description method of Motzkin et al.
Copyright by Komei Fukuda.
http://www-oldurls.inf.ethz.ch/personal ... /cdd_home/

polymake: used package lrs
Implementation of the reverse search algorithm of Avis and Fukuda.
Copyright by David Avis.
http://cgm.cs.mcgill.ca/~avis/C/lrs.html


polytope > print $p->SCHLEGEL_DIAGRAM->VERTICES;

polytope >
---

User avatar
gawrilow
Main Author
Posts: 386
Joined: 25 Dec 2010, 17:40

Re: Manipulation of Schlegel diagrams

Postby gawrilow » 28 Mar 2021, 14:00

There is apparently a bug which went unnoticed for years - you are the first user asking for these vertices explicitly :shock: . So far they were only temporarily created when such visualizations were asked for. While we'll being investigating and fixing it for the next due release, you can help yourself with a following workaround, namely create a SCHLEGEL_DIAGRAM with an explicit FACET parameter, like this:

Code: Select all

print $p->SCHLEGEL_DIAGRAM(FACET=>0)->VERTICES;
0 in this example is the default index of the facet which the projection is made on. You can specify any index or other tuning parameter like ZOOM much like in the visualization command $p->SCHLEGEL.

The empty output from the second print command is caused by an "undef" value stored as VERTICES after the first unsuccessful attempt. If you have saved your polytope in a file, you should first remove the defect diagram subobject:

Code: Select all

$p->remove("SCHLEGEL_DIAGRAM");
On a side note, there is another visualization front-end jreality, which allows to interactively change the projection direction and to select other facets, eventually storing the chosen settings in the polytope data file. Unfortunately, it does not work reliably on Macs, due to its inherent deep hostility towards anything written in Java, thus it's most probably not included in brew formulae or precompiled disk images. If you want to try it out, you'd have to build polymake from the sources. But if you are content with tuning the projection by specifying the parameters up front, it's probably not worth it to spend much time on rebuilding polymake.

jbe
Posts: 3
Joined: 27 Mar 2021, 13:02

Re: Manipulation of Schlegel diagrams

Postby jbe » 29 Mar 2021, 15:05

Thank you very much, Ewgenij. The trick you suggest works fine.
The povray and tikz output are also very nice; I'll try to do without jreality for now (indeed not compiled on my mac).


Return to “Helpdesk”

cron