{
 "cells": [
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Introduction to polymake\n",
    "\n",
    "### Installation\n",
    "For installation instructions, see the [HowTo](/howto/start) pages.\n",
    "### Getting started\n",
    "\n",
    "Starting up `polymake` on the command line gives:\n",
    "\n",
    "    \n",
    "    Welcome to polymake version 3.1\n",
    "    Copyright (c) 1997-2018\n",
    "    Ewgenij Gawrilow, Michael Joswig (TU Berlin)\n",
    "    http://www.polymake.org\n",
    "    \n",
    "    This is free software licensed under GPL; see the source for copying conditions.\n",
    "    There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n",
    "    \n",
    "    Press F1 or enter 'help;' for basic instructions.\n",
    "    \n",
    "    Application polytope currently uses following third-party software packages:\n",
    "    cdd, jreality, libnormaliz, lrs, nauty, permlib, povray, ppl, sketch, sympol, threejs, tikz, tosimplex\n",
    "    For more details:  show_credits;\n",
    "\n",
    "\n",
    "You will face an input prompt which indicates the start up application (usually `polytope >`). After the prompt you can enter (an enriched form of) perl code. See [this introduction](tutorial/perl_intro) and [the advanced polymake/perl tutorial](tutorial/perl_continued) for more info.\n",
    "\n",
    "### Applications\n",
    "\n",
    "`polymake`s namespace is subdivided into so-called \"applications\". They group functions and objects that belong together mathematically (see [this article](howto/lingo#Application) for more). For example, the default application `polytope` deals with polyhedra, while `topaz` provides tools for topology and `tropical` for tropical geometry. \n",
    "\n",
    "To switch to another application, do this:\n",
    "\n",
    "    \n",
    "    application 'topaz';\n",
    "\n",
    "There are [introductory tutorials](tutorial/start#application_tutorials) for all applications. Also check out the [documentation](/release_docs/3.0).\n",
    "\n",
    "### Getting help\n",
    "\n",
    "Apart from the [tutorials](start) and [HowTos](/howto/start), you can often find out what to do to reach your goal by using the built-in help features of the `polymake` shell.\n",
    "\n",
    "The polymake help system provides extensive usage information. In the shell, type \n",
    "\n",
    "    \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "help;"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "to get started. Invoking\n",
    "\n",
    "    \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "help 'help';"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "will explain thy syntax of the help system.\n",
    "\n",
    "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`:\n",
    "\n",
    "    \n",
    "     polytope > cube(3)->GRAPH->                              # hit TAB!\n",
    "    add                               disable_rules                     MAX_CLIQUES                       set_as_default\n",
    "    ADJACENCY                         dont_save                         name                              set_as_default_now\n",
    "    apply_rule                        EDGE_DIRECTIONS                   N_CONNECTED_COMPONENTS            SIGNATURE\n",
    "    attach                            EDGES                             N_EDGES                           SIGNED_INCIDENCE_MATRIX\n",
    "    AVERAGE_DEGREE                    EIGENVALUES_LAPLACIAN             N_NODES                           SQUARED_EDGE_LENGTHS\n",
    "    BICONNECTED_COMPONENTS            get_attachment                    NODE_DEGREES                      STRONG_COMPONENTS\n",
    "    BIPARTITE                         get_schedule                      NODE_IN_DEGREES                   STRONGLY_CONNECTED\n",
    "    CHARACTERISTIC_POLYNOMIAL         give                              NODE_LABELS                       take\n",
    "    CONNECTED                         LATTICE_ACCUMULATED_EDGE_LENGTHS  NODE_OUT_DEGREES                  TRIANGLE_FREE\n",
    "    CONNECTED_COMPONENTS              LATTICE_EDGE_LENGTHS              properties                        type\n",
    "    CONNECTIVITY                      list_attachments                  provide                           VISUAL\n",
    "    DEGREE_SEQUENCE                   list_names                        remove                            WEAKLY_CONNECTED\n",
    "    description                       list_properties                   remove_attachment                 WEAKLY_CONNECTED_COMPONENTS\n",
    "    DIAMETER   \n",
    "\n",
    "\n",
    "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:\n",
    "\n",
    "    \n",
    "     polytope > simplex(                                      # hit F1 twice!\n",
    "    functions/Producing a polytope from scratch/simplex:\n",
    "    simplex(d; scale, Options) -> Polytope\n",
    "    \n",
    "     Produce the standard d-simplex.\n",
    "     Combinatorially equivalent to a regular polytope corresponding to the Coxeter group of type A<sub>d-1</sub>.\n",
    "     Optionally, the simplex can be scaled by the parameter scale.\n",
    "    \n",
    "    Arguments:\n",
    "      Int d the dimension\n",
    "      Scalar scale default value: 1\n",
    "    \n",
    "    Options: \n",
    "      group => Bool \n",
    "    \n",
    "    Returns Polytope \n",
    "    \n",
    "    Examples:\n",
    "    \n",
    "\n",
    "    *) To print the vertices (in homogeneous coordinates) of the standard\n",
    "       2-simplex, i.e. a right-angled isoceles triangle, type this:\n",
    "        > print simplex(2)->VERTICES;\n",
    "        (3) (0 1)\n",
    "        1 1 0\n",
    "        1 0 1\n",
    "       The first row vector is sparse and encodes the origin.\n",
    "\n",
    "    *) To create a 3-simplex and also calculate its symmetry group, type this:\n",
    "        > simplex(3, group=>1);\n",
    "\n",
    "\n",
    "If you have any questions, feel free to ask in the [forum](https///forum.polymake.org/).\n",
    "\n",
    "\n",
    "----\n",
    "\n",
    "Back to [Tutorial Overview](start)\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "polymake",
   "language": "polymake",
   "name": "polymake"
  },
  "language_info": {
   "codemirror_mode": "perl",
   "file_extension": ".pm",
   "mimetype": "text/x-polymake",
   "name": "polymake"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}