First steps with polymake

Installation

To get your copy of polymake, visit the downloads page. For installation instructions, see the installation instructions.

Getting started

Once you have polymake installed, fire it up by entering polymake on the command line. You should be presented with a greeting, followed by an input prompt which looks like this:

polytope >

After the prompt you can enter an enriched form of perl code. You will probably want to look at some of the various code examples performing tasks of different complexity that can be found in the tutorials. Also see the polymake-perl introduction for more info.

To get helpful tips on things you can do in the shell, visit the interactive shell wiki page.

Applications

An application is a collection of object types, functions and other stuff all related to some distinct mathematical subject. Currently polymake consists of the following applications:

The prompt in the polymake shell indicates the currently active application. You can switch by typing

 application 'topaz'; 

The only difference between the current application and the rest is that you can call the functions and object constructors of the former without having to qualify them with the application name as a prefix. To use things from other applications, you need to do this:

topaz > $c = polytope::cube(3);

There are introductory tutorials for all applications. Also check out the documentation.

Getting help

If you have any questions or problems, feel free to ask in the forum.

Apart from reading the user guide, you can often find out what to do to reach your goal by using the built-in help features of the polymake shell.

The polymake help system provides extensive usage information. In the shell, type

polytope > help;

to get started. Invoking

polytope > help 'help';

will explain thy syntax of the help system.

If you type part of an expresison in the shell, you can hit TAB to display possible ways of completing it. For example, to see what methods you can invoke on the graph of the 3-cube, enter the following and hit TAB:

 polytope > $c = cube(3);
 polytope > $c->GRAPH->                              # hit TAB!
add                               disable_rules                     MAX_CLIQUES                       set_as_default
ADJACENCY                         dont_save                         name                              set_as_default_now
apply_rule                        EDGE_DIRECTIONS                   N_CONNECTED_COMPONENTS            SIGNATURE
attach                            EDGES                             N_EDGES                           SIGNED_INCIDENCE_MATRIX
AVERAGE_DEGREE                    EIGENVALUES_LAPLACIAN             N_NODES                           SQUARED_EDGE_LENGTHS
BICONNECTED_COMPONENTS            get_attachment                    NODE_DEGREES                      STRONG_COMPONENTS
BIPARTITE                         get_schedule                      NODE_IN_DEGREES                   STRONGLY_CONNECTED
CHARACTERISTIC_POLYNOMIAL         give                              NODE_LABELS                       take
CONNECTED                         LATTICE_ACCUMULATED_EDGE_LENGTHS  NODE_OUT_DEGREES                  TRIANGLE_FREE
CONNECTED_COMPONENTS              LATTICE_EDGE_LENGTHS              properties                        type
CONNECTIVITY                      list_attachments                  provide                           VISUAL
DEGREE_SEQUENCE                   list_names                        remove                            WEAKLY_CONNECTED
description                       list_properties                   remove_attachment                 WEAKLY_CONNECTED_COMPONENTS
DIAMETER   

You can conveniently access the polymake documentation in the shell. Place the cursor above a thing you want to know about and hit F1. Hitting it once will display brief info on types or function signatures. Hitting it a second time will show you the complete documentation, sometimes even small usage examples:

 polytope > simplex(                                      # hit F1 twice!
functions/Producing a polytope from scratch/simplex:
simplex(d; scale, Options) -> Polytope

 Produce the standard d-simplex.
 Combinatorially equivalent to a regular polytope corresponding to the Coxeter group of type A<sub>d-1</sub>.
 Optionally, the simplex can be scaled by the parameter scale.

Arguments:
  Int d the dimension
  Scalar scale default value: 1

Options: 
  group => Bool 

Returns Polytope 

Examples:

*) To print the vertices (in homogeneous coordinates) of the standard
   2-simplex, i.e. a right-angled isoceles triangle, type this:
    > print simplex(2)->VERTICES;
    (3) (0 1)
    1 1 0
    1 0 1
   The first row vector is sparse and encodes the origin.
*) To create a 3-simplex and also calculate its symmetry group, type this:
    > simplex(3, group=>1);

Back to User Guide

  • user_guide/intro_tutorial.txt
  • Last modified: 2019/03/07 10:34
  • by kalmar