Polymake.jl
Polymake.jl is a Julia package for using polymake, a software for research in polyhedral geometry from Julia. This package is developed as part of the OSCAR project.
The current version of Polymake.jl relies on polymake version 4.0 or later.
Current state of the polymake wrapper
Data structures
- Big objects, e.g., Polytopes, can be handled in Julia.
- Several small objects (data types) from
polymakeare available inPolymake.jl:- Integers (
Polymake.Integer <: Integer) - Rationals (
Polymake.Rational <: Real) - Vectors (
Polymake.Vector <: AbstractVector) ofInt64s,Float64s,Polymake.Integers andPolymake.Rationals - Matrices (
Polymake.Matrix <: AbstractMatrix) ofInt64s,Float64s,Polymake.Integers andPolymake.Rationals - Sets (
Polymake.Set <: AbstractSet) ofInt64s - Arrays (
Polymake.Array <: AbstractVector, asPolymake.Arraysare one-dimensional) ofInt64s andPolymake.Integers - some combinations thereof, e.g.,
Polymake.Arrays ofPolymake.SetsofInt32s.
- Integers (
These data types can be converted to appropriate Julia types, but are also subtypes of the corresponding Julia abstract types (as indicated above), and so should be accepted by all methods that apply to the abstract types.
Note: If the returned small object has not been wrapped in Polymake.jl yet, you will not be able to access its content or in general use it from Julia, however you can always pass it back as an argument to a polymake function. Moreover you may try to convert to Julia understandable type via macro @convert_to SomeType{Template, Names} obj.
Functions
- All user functions from
polymakeare available in the appropriate modules, e.g.homologyfunction fromtopazcan be called astopaz.homology(...)in julia. We pull the docstrings for functions frompolymakeas well, so?topaz.homology(in Julia's REPL) returns thepolymakedocstring. Note: the syntax presented in the docstring is apolymakesyntax, notPolymake.jlone. - Most of the user functions from
polymakeare available asappname.funcname(...)inPolymake.jl. Moreover, any function frompolymakeC++library can be called via macro call@pm appname.funcname{C++{template, names}}(...). - All big objects of
polymakecan be constructed either via call to constructor, i.e.
obj = appname.BigObject(args)One can specify some templates here as well: polytope.Polytope{Float64}(...) is a valid call, but the list of supported types is rather limited. Please consider filing a bug if a valid call results in polymake error. For more advanced use see section on @pm macro.
- Properties of big objects are accessible by
bigobject.propertysyntax (as opposed to$bigobject->propertyinpolymake). If there is a missing property please check if it can be accessed byappname.property(object). For examplepolytope.Polytopedoes not haveDIMproperty inPolymake.jlsincDIMis exposed aspolytope.dim(...)function. - Methods are available as functions in the appropriate modules, with the first argument as the object, i.e.
$bigobj->methodname(...)can be called viaappname.methodname(bigobj, ...) - A function in
Polymake.jlcallingpolymakemay return a big or small object, and the generic return (PropertyValue) is transparently converted to one of the known data types. This conversion can be deactivated by addingkeep_PropertyValue=truekeyword argument to function/method call.
User Guide
Funding
The development of this Julia package is supported by the Deutsche Forschungsgemeinschaft DFG within the Collaborative Research Center TRR 195.