Skip to content

Tropical,_polyhedra,_toric

Mahrud Sayrafi edited this page Mar 12, 2021 · 1 revision

title: Tropical, polyhedra, toric permalink: wiki/Tropical,_polyhedra,_toric/ layout: wiki

To Do List

  • Make a new PolyhedralObject used by the packages Polyhedra, Polymake, and gfanInterface2. DONE, in package PolyhedralObjects.
  • Make Polyhedra utilize Polymake if available.
    • Translate types: cones, fans, polyhedra, polyhedral complexes
    • Important commands: convexHull, posHull, dualCone, fVector, vertices, rays, latticePoints, hilbertBasis, intersection, volume, normalFan, dim, etc
  • Polymake interface
  • gfanInterface2: Merge Andrew's changes with version of Josephine and Anders -- Done
  • gfanInterface2: Make use of the new PolyhedralObject type from PolyhedralObjects package -- Done, except the "toPolymakeFormat" method needs some work. The main changes are:
    • needsPackage PolyhedralObjects package (instead of Polyhedra/Polymake/etc.)
    • The polyhedral ouput of Gfan are returned as PolyhedralObjects (in particular, Fan or Cone).
    • The keys in the PolyhedralObjects conform M2 conventions rather than Polymake conventions, e.g. AmbientDim instead of AMBIENT_DIM or AMBIENTDIM as before.
    • The key "GfanFileName" keeps the name of the output file containing polyhedral information, if the option "keepfile"=>true is set in configuration.
    • The keys "rawstring", "rawblocks", and "header" are renamed as "GfanFileRawString", "GfanFileRawBlocks", and "GfanFileHeader". They are kept only if the new configuration option cachePolyhedralOutput is set to true.

Wish List (we probably won't get to these)

  • Use gfan interface to build polytope from its tropical hypersurface
  • Toric Vector Bundles -- translate between different presentations

Running the Polymake interface on Mac

The current Polymake interface assumes that you can run the command

polymake [script_file]

in the terminal to run a polymake script. However, this does not work on some Mac machines. If you have this problem, maybe you can try the following:

1. Duplicate the file /Applications/polymake.app/Contents/MacOS/polymake.start into /Applications/polymake.app/Contents/MacOS/polymake.start2.

2. Open the new file polymake.start2 with a text editor. Add "$@" (without quotation marks) to the end of the last line of the file. So the last line is now "$ResourcesDir/polymake/bin/polymake $@" (without quotation marks).

3. Create a new file named polymake in the directory /usr/local/bin/, type the following:

/Applications/polymake.app/Contents/MacOS/polymake.start2 $@

4. Open a terminal and type the following:

chmod +x /usr/local/bin/polymake

I hope it helps.

Notes on Polyhedra2

Polyhedra2.m2 has been checked into svn. This should evenutally replace Polyhedra

  • Currently has types Cone and Polyhedron, both implemented as mutable hash tables
    • New types are now in separate package PolyhedralObjects: Fan, Cone, Polyhedron, PolyhedralObject, and PolyhedralComplex
  • Keys in has tables have names derived from Polymake. E.g. INPUT_RAYS -> InputRays
    • Values are exactly in the formula used by Polymake (not formerly used by Polyhedra)
    • Values are calculated on demand and then stored
  • Caveats:
    • The type Polyhedron has keys InputLineality and LinealitySpace, which are used in Polymake only for cones (is this true?)
    • Certain key pairs must occur together
  • Currently works:
    • convexHull, vertices, rays, linSpace, hyperplanes, halfspaces, intersection, posHull, ambDim, ==, dim, dualCone, emptyPolyhedron, isEmpty, minkowskiSum, directProduct, coneToPolyhedron, hilbertBasis
  • To Do:
    • types Fan and PolyhedralComplex
    • Outsourcing to Polymake: start with computeRays and computeHalfspaces
    • Add further old Polyhedra commands

Polymake Interface (Proposal)

Basic Methods

  • method runPolymake(String)
    • Run a polymake script. This is the most basic thing for an interface, and is needed by everything else in the package.
    • Input: a Polymake Script
    • Output: whatever Polymake prints
    • Example:
      • runPolymake("print 1");

Interfacing methods

Important note: For all the following methods, part or all of the result may also be stored in the hash table of the input.

Important note: After running with Polymake, two new keys will appear in the input object: PolymakeFile (of type String) is the name of the Polymake temporary file, and AvailableProperties (of type List) is the list of all properties in the Polymake temporary file.

  • method runPolymake(PolyhedralObject,String)
    • Asks Polymake for a property of a polytope.
    • Input: a PolyhedralObject object containing known properties of a polytope, and the name of the property to ask for.
    • Output: the value of the property.
    • Example:
  • method runPolymake(PolyhedralObject,String,parseAllProperties=>true)
    • same as above, but parses all properties into the input object.

Cache Methods

  • method getProperty(PolyhedralObject,String)
    • gets the value of a property
    • Input: A PolyhedralObject object and a property name
    • Output: the value of the property
    • Example:
      • facets = getProperty(P,"Facets");
  • method parseAllProperties(PolyhedralObject)
    • parses all available properties (all that are in the Polymake temporary file)
    • Output: no output
Clone this wiki locally