# application: fan

This application deals with polyhedral fans. You can define a fan, e.g. via its RAYS and MAXIMAL_CONES and compute several properties like HASSE_DIAGRAM and F_VECTOR.

**imports from:**common, graph, polytope

**uses:**group, ideal, topaz

**Objects**

**Category:**GeometryA special big object class devoted to planar unfoldings of 3-polytopes. Its main functionality is the visualization.

**Example:**- To visualize a planar net of some Johnson solid (with flaps, such that you can print, cut and glue):
`> planar_net(polytope::johnson_solid(52))->VISUAL->FLAPS;`

**derived from:**PolyhedralComplex<Float>#### Properties of PlanarNet

These properties capture combinatorial information of the object. Combinatorial properties only depend on combinatorial data of the object like, e.g., the face lattice.

**DUAL_TREE**: common::Array<Pair<Int, Int>>The spanning tree in the Polytope::DUAL_GRAPH which defines the layout. Endoded as a list of edges, directed away from the root facet. Indices correspond to MAXIMAL_POLYTOPES as well as Polytope::FACETS.

**FLAPS**: common::Array<Pair<Int, Int>>List of directed edges in the primal graph Polytope::GRAPH which need flaps for gluing. Indices correspond to VERTICES. The orientation is chosen such that the facet in the layout is always on the left. In fact, the flaps define a spanning tree of Polytope::GRAPH.

**VF_MAP**: common::Map<Pair<Int, Int>, Int>Map which tells which vertex/facet pair of the 3-polytope is mapped to which vertex of the planar net. The dependence on the facets comes from the fact that most Polytope::VERTICES occur more than once in the planar net. The inverse is VF_MAP_INV.

**VF_MAP_INV**: common::Array<Int>Map which tells how the VERTICES of the planar net are mapped to the Polytope::VERTICES of the 3-polytope. Inverse of VF_MAP.

**VIF_CYCLIC_NORMAL**: common::Array<Array<Int>>Counter clockwise ordering of the VERTICES in each MAXIMAL_POLYTOPES. This is a copy of the property Polytope::VIF_CYCLIC_NORMAL of POLYTOPE.

These properties capture geometric information of the object. Geometric properties depend on geometric information of the object, like, e.g., vertices or facets.

#### User Methods of PlanarNet

**Category:**GeometryA polyhedral complex. The derivation from PolyhedralFan works like the derivation of Polytope from Cone.

**Example:**- The following defines a subdivision of a square in the plane into two triangles.
`> $c=new PolyhedralComplex(VERTICES=>[[1,0,0],[1,1,0],[1,0,1],[1,1,1]],MAXIMAL_POLYTOPES=>[[0,1,2],[1,2,3]]);`

**derived from:**PolyhedralFan#### Properties of PolyhedralComplex

These properties capture combinatorial information of the object. Combinatorial properties only depend on combinatorial data of the object like, e.g., the face lattice.

**MAXIMAL_POLYTOPES**: common::IncidenceMatrix<NonSymmetric>Alias for property PolyhedralFan::MAXIMAL_CONES.

**MAXIMAL_POLYTOPES_INCIDENCES**: common::Array<IncidenceMatrix<NonSymmetric>>Array of incidence matrices of all maximal polytopes. Alias for property PolyhedralFan::MAXIMAL_CONES_INCIDENCES.

**N_MAXIMAL_POLYTOPES**: common::IntNumber of MAXIMAL_POLYTOPES. Alias for property PolyhedralFan::N_MAXIMAL_CONES.

These properties capture geometric information of the object. Geometric properties depend on geometric information of the object, like, e.g., vertices or facets.

These properties are for input only. They allow redundant information.

**INPUT_POLYTOPES**: common::IncidenceMatrix<NonSymmetric>Alias for property PolyhedralFan::INPUT_CONES.

These properties capture information of the object that is concerned with the action of permutation groups.

**GROUP**: Group as PolyhedralComplex::GROUPAugmented subobject [[PolyhedralFan::GROUP

#### Properties of GROUP

These properties capture information of the object that is concerned with the action of permutation groups.

**COORDINATE_ACTION**: PermutationAction<Int, Rational> as PolyhedralComplex::GROUP::COORDINATE_ACTIONAlias for property group::Group::HOMOGENEOUS_COORDINATE_ACTION.

#### Properties of COORDINATE_ACTION

These properties capture information of the object that is concerned with the action of permutation groups.

**VERTICES_GENERATORS**: common::Matrix<Rational, NonSymmetric>Alias for property group::Action::RAYS_GENERATORS.

**MATRIX_ACTION_ON_COMPLEX**: MatrixActionOnVectors as PolyhedralComplex::GROUP::MATRIX_ACTION_ON_COMPLEXAlias for property PolyhedralFan::GROUP.MATRIX_ACTION.

#### Properties of MATRIX_ACTION_ON_COMPLEX

**MAXIMAL_POLYTOPES_ACTION**: PermutationAction<Int, Rational> as PolyhedralComplex::GROUP::MAXIMAL_POLYTOPES_ACTIONAlias for property group::Group::MAXIMAL_CONES_ACTION.

#### Properties of MAXIMAL_POLYTOPES_ACTION

**VERTICES_GENERATORS**: common::Matrix<Rational, NonSymmetric>Alias for property group::Action::RAYS_GENERATORS.

**POINTS_ACTION**: group::PermutationAction<Int, Rational>Alias for property group::Group::INPUT_RAYS_ACTION.

**REPRESENTATIVE_VERTICES**: common::MatrixAlias for property PolyhedralFan::GROUP.REPRESENTATIVE_RAYS.

**VERTICES_ACTION**: group::PermutationAction<Int, Rational>Alias for property group::Group::RAYS_ACTION.

**MAXIMAL_POLYTOPES_ORBIT_SIZES**: common::Array<Int>Alias for property PolyhedralFan::MAXIMAL_CONES_ORBIT_SIZES.

**MAXIMAL_POLYTOPES_REPS**: common::Array<Set<Int>>Alias for property PolyhedralFan::MAXIMAL_CONES_REPS.

**MAXIMAL_POLYTOPES_REPS_DIMS**: common::Array<Int>Alias for property PolyhedralFan::MAXIMAL_CONES_REPS_DIMS.

**POLYTOPES_ORBIT_SIZES**: common::Array<Array<Int>>Alias for property PolyhedralFan::CONES_ORBIT_SIZES.

**REPS_AFFINE_SPAN_NORMALS**: common::MatrixAlias for property PolyhedralFan::REPS_LINEAR_SPAN_NORMALS.

These properties are for visualization.

#### User Methods of PolyhedralComplex

These methods capture geometric information of the object. Geometric properties depend on geometric information of the object, like, e.g., vertices or facets.

**AMBIENT_DIM**() → Int

These methods are for visualization.

**VISUAL**() → Visual::PolyhedralFanVisualizes the polyhedral complex.

##### Options

option list: Visual::Polygons::decorations option list: geometric_options ##### Returns

Visual::PolyhedralFan **VISUAL_METRIC_TIGHT_SPAN**() → Visual::GraphThis is a variation of Polytope::VISUAL_BOUNDED_GRAPH for the special case of a tight span. The vertices are embedded according to the metric, the others are hung in between. This only produces meaningful results for extended tight spans produced from metrics, e.g. through metric_extended_tight_span.

##### Options

Array<String> Taxa Labels for the taxa of the metric.Int seed random seed value for the string embedderString norm which norm to use when calculating the distances between metric vectors ("max" or "square")##### Returns

Visual::Graph **VISUAL_ORBIT_COLORED_GRAPH**() → Visual::PolytopeGraphVisualizes the graph of a symmetric cone: All nodes belonging to one orbit get the same color.

**Category:**GeometryA polyhedral fan. The current restriction is that each cone in the fan has to be pointed. This will be relaxed later. If a fan is specified via INPUT_RAYS and INPUT_CONES each input cone must list all the input rays incident.

Once non-trivial linealities are allowed the following will apply: The RAYS always lie in a linear subspace which is complementary to the LINEALITY_SPACE.

**Example:**- A typical example is the normal fan of a convex polytope.
`> $f=normal_fan(polytope::cube(3));`

`> print $f->F_VECTOR;`

`6 12 8`

#### Specializations of PolyhedralFan

**PolyhedralFan<Rational>**Unnamed full specialization of PolyhedralFan

#### Properties of PolyhedralFan

These properties capture combinatorial information of the object. Combinatorial properties only depend on combinatorial data of the object like, e.g., the face lattice.

**COMPLETE**: common::BoolThe polyhedral fan is

*complete*if its suport is the whole space.Due to undecidability issues this is checked heuristically only. See the remarks on SPHERE for details. Note that in the case of a polyhedral complex, this refers to the underlying fan, so should always be false.

**CONES**: common::Array<IncidenceMatrix<NonSymmetric>>List of all cones of the fan of each dimension. Indices refer to RAYS.

**DUAL_GRAPH**: graph::Graph<Undirected>The graph whose nodes are the maximal cones which are connected if they share a common facet. Only defined if PURE

**F2_VECTOR**: common::Matrix<Integer, NonSymmetric>f

_{ik}is the number of incident pairs of i-dimensional cones and k-dimensional cones; the main diagonal contains the F_VECTOR.**F_VECTOR**: common::Vector<Integer>f

_{k}is the number of k-dimensional cones starting from dimension k=1.**GRAPH**: graph::Graph<Undirected>The graph of the fan intersected with a sphere, that is, the vertices are the rays which are connected if they are contained in a common two-dimensional cone.

**HASSE_DIAGRAM**: Lattice<BasicDecoration, Nonsequential> as PolyhedralFan::HASSE_DIAGRAMThe poset of subcones of the polyhedral fan organized as a directed graph. Each node corresponds to some proper subcone of the fan. The nodes corresponding to the maximal cones appear in the same order as the elements of MAXIMAL_CONES.

One special node represents the origin and one special node represents the full fan (even if the fan only has one maximal cone).

**MAXIMAL_CONES**: common::IncidenceMatrix<NonSymmetric>Non redundant list of maximal cones. Indices refer to RAYS. Cones which do not have any rays correspond to the trivial cone (contains only the origin). An empty fan does not have any cones.

**MAXIMAL_CONES_COMBINATORIAL_DIMS**: common::Array<Int>The combinatorial dimensions of the maximal cones.

**MAXIMAL_CONES_INCIDENCES**: common::Array<IncidenceMatrix<NonSymmetric>>Array of incidence matrices of all maximal cones.

**MAXIMAL_CONES_THRU_RAYS**: common::IncidenceMatrix<NonSymmetric>Transposed to MAXIMAL_CONES. Notice that this is a temporary property; it will not be stored in any file.

These properties capture geometric information of the object. Geometric properties depend on geometric information of the object, like, e.g., vertices or facets.

**LINEALITY_SPACE**: common::MatrixSince we do not require our cones to be pointed: a basis of the lineality space of the fan. Co-exists with RAYS.

**MAXIMAL_CONES_FACETS**: common::SparseMatrix<Int, NonSymmetric>Tells for each maximal cone what are its facets. A negative number means that the corresponding row of FACET_NORMALS has to be negated.

**MAXIMAL_CONES_LINEAR_SPAN_NORMALS**: common::IncidenceMatrix<NonSymmetric>Tells for each maximal cone what is its linear span. Indices refer to LINEAR_SPAN_NORMALS. Rows correspond to MAXIMAL_CONES_FACETS.

**RAYS**: common::MatrixRays from which the cones are formed. Non-redundant. Co-exists with LINEALITY_SPACE.

These properties are for input only. They allow redundant information.

**INPUT_CONES**: common::IncidenceMatrix<NonSymmetric>Maybe redundant list of not necessarily maximal cones. Indices refer to INPUT_RAYS. Each cone must list all rays of INPUT_RAYS it contains. The cones are allowed to contain lineality. Cones which do not have any rays correspond to the trivial cone (contains only the origin). An empty fan does not have any cones.

Input section only. Ask for MAXIMAL_CONES if you want to know the maximal cones (indexed by RAYS).

**INPUT_CONES_REPS**: common::IncidenceMatrix<NonSymmetric>Maybe redundant list of not necessarily maximal cones, one from each orbit. All vectors in the input must be non-zero. Indices refer to INPUT_RAYS.

**INPUT_LINEALITY**: common::MatrixVectors whose linear span defines a subset of the lineality space of the fan; redundancies are allowed.

Input section only. Ask for LINEALITY_SPACE if you want to know the lineality space.

**INPUT_RAYS**: common::MatrixRays from which the cones are formed. May be redundant. All vectors in the input must be non-zero. You also need to provide INPUT_CONES to define a fan completely.

Input section only. Ask for RAYS if you want a list of non-redundant rays.

**CONES_REPS**: common::Array<Array<Set<Int>>>List of all cones of all dimensions of the fan, one from each orbit. Indices refer to RAYS.

**GROUP**: Group as PolyhedralFan::GROUPUNDOCUMENTED#### Properties of GROUP

**MAXIMAL_CONES_ACTION**: PermutationAction<Int, Rational> as PolyhedralFan::GROUP::MAXIMAL_CONES_ACTIONAugmented subobject [[group::Group::MAXIMAL_CONES_ACTION

#### Properties of MAXIMAL_CONES_ACTION

**REPRESENTATIVE_COMBINATORIAL_DIMS**: common::Array<Int>dimensions of representatives of maximal cones

**REPRESENTATIVE_F_VECTOR**: common::Array<Int>counts how many representatives of maximal cones there are in each dimension

**MAXIMAL_CONES_IN_ORBITS**: common::Array<Set<Int>>Tells which maximal cone is in the orbit of which representative, indices refers to rows of MAXIMAL_CONES.

**MAXIMAL_CONES_REPS**: common::Array<Set<Int>>Non redundant list of maximal cones, one from each orbit. Indices refer to RAYS.

**MAXIMAL_CONES_REPS_FACETS**: common::SparseMatrix<Int, NonSymmetric>Tells for each maximal cone representative what are its facets. A negative number means that the corresponding row of REPS_FACET_NORMALS has to be negated.

**MAXIMAL_CONES_REPS_LINEAR_SPAN_NORMALS**: common::IncidenceMatrix<NonSymmetric>Tells for each maximal cone representative what is its linear span. Indices refer to REPS_LINEAR_SPAN_NORMALS. Rows correspond to MAXIMAL_CONES_REPS_FACETS

**RAYS_IMAGES**: common::Array<Array<Int>>Each row contains the image of all RAYS under one element of the symmetry group.

**RAYS_IN_ORBITS**: common::Array<Set<Int>>Tells which ray is in the orbit of which representative, indices refers to rows of RAYS.

**REPS_LINEAR_SPAN_NORMALS**: common::MatrixThe possible linear span normals of all maximal cone representatives.

**SYMMETRY_GENERATORS**: common::Array<Array<Int>>Each element of the array is a generator of the subgroup of the symmetric group acting on the coordinates. Each generator is represented by an Array whose i-th entry is the image of the i-th coordinate.

**SYMMETRY_GROUP**: common::Array<Array<Int>>Each element of the array is an element of the symmetry group.

The following properties are topological invariants.

**HOMOLOGY**: common::Array<HomologyGroup<Integer>>The homology of the intersection of the fan with the unit sphere.

**INTERSECTION_COMPLEX**: topaz::SimplicialComplexIf the fan is SIMPLICIAL the simplicial complex obtained by intersection the fan with the unit sphere. If the fan is not SIMPLICIAL the crosscut complex of the intersection.

Properties coming from associated toric varieties

**GORENSTEIN**: common::Bool**Only defined for PolyhedralFan<Rational>**A fan is

*Gorenstein*if it is Q_GORENSTEIN with Q_GORENSTEIN_INDEX equal to one.**Q_GORENSTEIN**: common::Bool**Only defined for PolyhedralFan<Rational>**A fan is

*Q-GORENSTEIN*if each maximal cone is Q_Gorenstein.**Q_GORENSTEIN_INDEX**: common::Int**Only defined for PolyhedralFan<Rational>**If a fan is Q_GORENSTEIN, then its

*Q-Gorenstein index*is the least common multiple of the Q-Gorenstein indices of its maximal cones. Otherwise Q_GORENSTEIN_INDEX is undefined.**SMOOTH_FAN**: common::Bool**Only defined for PolyhedralFan<Rational>**A fan is

*smooth*if all cones of the fan are smooth.

These properties are for visualization.

**INPUT_RAY_LABELS**: common::Array<String>Unique names assigned to the INPUT_RAYS. Similar to RAY_LABELS for RAYS.

**MAXIMAL_CONE_LABELS**: common::Array<String>Unique names assigned to the MAXIMAL_CONES. Similar to RAY_LABELS for RAYS.

**RAY_LABELS**: common::Array<String>Unique names assigned to the RAYS. If specified, they are shown by visualization tools instead of vertex indices.

For a polyhedral fan built from scratch, you should create this property by yourself, either manually in a text editor, or with a client program.

#### User Methods of PolyhedralFan

These methods capture combinatorial information of the object. Combinatorial properties only depend on combinatorial data of the object like, e.g., the face lattice.

**CONES_DIMS**() → Array<Int>

These methods capture geometric information of the object. Geometric properties depend on geometric information of the object, like, e.g., vertices or facets.

**AMBIENT_DIM**() → Int

These methods capture information of the object that is concerned with the action of permutation groups.

**cone_representative**(i) → Cone

These methods are for visualization.

**VISUAL**() → Visual::PolyhedralFanVisualizes the fan, intersected with the unit ball.

#### Permutations of PolyhedralFan

**ConesPerm**permuting the MAXIMAL_CONES

**Category:**GeometryThe inhomogeneous variant of SubdivisionOfVectors, similar to the derivation of PointConfiguration from VectorConfiguration.

**Example:**- To produce a regular subdivision of the vertices of a square:
`> $c=new SubdivisionOfPoints(POINTS=>polytope::cube(2)->VERTICES,WEIGHTS=>[0,0,0,1]);`

`> print $c->MAXIMAL_CELLS;`

`{0 1 2}`

`{1 2 3}`

**derived from:**SubdivisionOfVectors##### Type Parameters

Scalar default: Rational#### Properties of SubdivisionOfPoints

**N_POINTS**: common::IntThe number of POINTS in the configuration. Alias for property SubdivisionOfVectors::N_VECTORS.

**POINTS**: common::MatrixThe points of the configuration. Multiples allowed. Alias for property SubdivisionOfVectors::VECTORS.

**POLYHEDRAL_COMPLEX**: PolyhedralComplexThe polyhedral complex induced by the cells of the subdivision.

These properties are for visualization.

**POINT_LABELS**: common::Array<String>Unique names assigned to the POINTS. If specified, they are shown by visualization tools instead of point indices. Alias for property SubdivisionOfVectors::LABELS.

#### User Methods of SubdivisionOfPoints

These methods capture geometric information of the object. Geometric properties depend on geometric information of the object, like, e.g., vertices or facets.

**AMBIENT_DIM**()Ambient dimension of the point configuration (without the homogenization coordinate). Similar to PointConfiguration::AMBIENT_DIM.

**cell**(i) → PointConfiguration**DIM**()Affine dimension of the point configuration. Similar to PointConfiguration::DIM.

These methods are for visualization.

**VISUAL**() → Visual::PolyhedralFanVisualizes the SubdivisionOfPoints.

**Category:**GeometryA subdivision of vectors, in contrast to PolyhedralFan this allows cells with interior points. Similar to the distinction between Cone and VectorConfiguration.

##### Type Parameters

Scalar default: Rational#### Properties of SubdivisionOfVectors

**MAXIMAL_CELLS**: common::IncidenceMatrix<NonSymmetric>Maximal cells of the polyhedral complex. Indices refer to VECTORS. Points do not have to be vertices of the cells.

These properties are for visualization.

**LABELS**: common::Array<String>Unique names assigned to the VECTORS. If specified, they are shown by visualization tools instead of point indices.

#### User Methods of SubdivisionOfVectors

**cell**(i) → VectorConfigurationReturns the

*i*-th cell of the complex as a VectorConfiguration**secondary_cone**() → Cone<Scalar>The secondary cone is the polyhedral cone of all lifting functions on the VECTORS which induce the subdivision given by the MAXIMAL_CELLS. If the subdivision is not regular, the cone will be the secondary cone of the finest regular coarsening.

#### Permutations of SubdivisionOfVectors

**CellPerm**permuting MAXIMAL_CELLS

**VectorPerm**permuting VECTORS

**Category:**VisualizationVisualization of a 3-polytope as a planar net.

**derived from:**Visual::Container#### User Methods of Visual::PlanarNet

**FLAPS**() → Visual::PlanarNetAdd flaps for gluing.

## User Functions

These clients provide consistency checks, e.g. whether a given list of rays and cones defines a polyhedral fan.

**check_fan**(rays, cones) → PolyhedralFanChecks whether a given set of

*rays*together with a list*cones*defines a polyhedral fan. If this is the case, the ouput is the PolyhedralFan defined by*rays*as INPUT_RAYS,*cones*as INPUT_CONES,*lineality_space*as LINEALITY_SPACE if this option is given.##### Parameters

Matrix rays IncidenceMatrix cones ##### Options

Matrix lineality_space Common lineality space for the cones.Bool verbose prints information about the check.##### Returns

PolyhedralFan **check_fan_objects**<Coord> (cones) → PolyhedralFanChecks whether the polytope::Cone objects form a polyhedral fan. If this is the case, returns that PolyhedralFan.

##### Type Parameters

Coord ##### Parameters

Array<Cone> cones ##### Options

Bool verbose prints information about the check.##### Returns

PolyhedralFan

All around Tight spans of finite metric spaces and their conections to polyhedral geometry

**max_metric**(n) → MatrixCompute a metric such that the f-vector of its tight span is maximal among all metrics with

*n*points.See Herrmann and Joswig: Bounds on the f-vectors of tight spans, Contrib. Discrete Math., Vol.2, (2007)**Example:**- To compute the max-metric of five points and display the f-vector of its tight span, do this:
`> $M = max_metric(5);`

`> $PC = metric_tight_span($M,extended=>1);`

`> print $PC->POLYTOPAL_SUBDIVISION->TIGHT_SPAN->F_VECTOR;`

`16 20 5`

**metric_extended_tight_span**(M) → PolyhedralComplexComputes a extended tight span which is a PolyhedralComplex with induced from a mertic.

**Example:**- To compute the thrackle-metric of five points and display the f-vector of its tight span, do this:
`> $M = thrackle_metric(5);`

`> $PC = metric_extended_tight_span($M);`

`> print $PC->F_VECTOR;`

`16 20 5`

**metric_tight_span**(M) → SubdivisionOfPointsComputes a SubdivisionOfPoints with a weight function which is induced from a mertic.

##### Parameters

Matrix<Rational> M a metric##### Options

Bool extended If true, the extended tight span is computed.##### Returns

SubdivisionOfPoints **Example:**- To compute the thrackle-metric of five points and display the f-vector of its tight span, do this:
`> $M = thrackle_metric(5);`

`> $PC = metric_tight_span($M,extended=>1);`

`> print $PC->POLYTOPAL_SUBDIVISION->TIGHT_SPAN->F_VECTOR;`

`16 20 5`

**min_metric**(n) → MatrixCompute a metric such that the f-vector of its tight span is minimal among all metrics with

*n*points.See Herrmann and Joswig: Bounds on the f-vectors of tight spans, Contrib. Discrete Math., Vol.2, (2007)**Example:**- To compute the min-metric of five points and display the f-vector of its tight span, do this:
`> $M = min_metric(5);`

`> $PC = metric_tight_span($M,extended=>1);`

`> print $PC->POLYTOPAL_SUBDIVISION->TIGHT_SPAN->F_VECTOR;`

`16 20 5`

**thrackle_metric**(n) → MatrixCompute a thrackle metric on

*n*points. This metric can be interpreted as a lifting function for the thrackle triangulation.See De Loera, Sturmfels and Thomas: Gröbner bases and triangulations of the second hypersimplex, Combinatorica 15 (1995)**Example:**- To compute the thrackle-metric of five points and display the f-vector of its tight span, do this:
`> $M = thrackle_metric(5);`

`> $PC = metric_extended_tight_span($M);`

`> print $PC->F_VECTOR;`

`16 20 5`

**tight_span_max_metric**(n) → SubdivisionOfPointsCompute a SubdivisionOfPoints with a tight span of a metric such that the f-vector is maximal among all metrics with

*n*points.See Herrmann and Joswig: Bounds on the f-vectors of tight spans, Contrib. Discrete Math., Vol.2, (2007)**Example:**- To compute the f-vector of the tight span with maximal f-vector, do this:
`> print tight_span_max_metric(5)->POLYTOPAL_SUBDIVISION->TIGHT_SPAN->F_VECTOR;`

`11 15 5`

**tight_span_min_metric**(n) → SubdivisionOfPointsCompute a SubdivisionOfPoints with a tight span of a metric such that the f-vector is minimal among all metrics with

*n*points.**Example:**- To compute the f-vector of the tight span with minimal f-vector, do this:
`> print tight_span_min_metric(5)->POLYTOPAL_SUBDIVISION->TIGHT_SPAN->F_VECTOR;`

`11 15 5`

**tight_span_thrackle_metric**(n) → SubdivisionOfPointsCompute SubdivisionOfPoints with a tight span of th thrackle metric on

*n*points. This metric can be interpreted as a lifting function which induces the thrackle triangulation of the second hypersimplex.See De Loera, Sturmfels and Thomas: Gröbner bases and triangulations of the second hypersimplex, Combinatorica 15 (1995)**Example:**- To compute the $f$-vector, do this:
`> print tight_span_min_metric(5)->POLYTOPAL_SUBDIVISION->TIGHT_SPAN->F_VECTOR;`

`11 15 5`

These functions capture geometric information of the object. Geometric properties depend on geometric information of the object, like, e.g., vertices or facets.

**generating_polyhedron_facets**(P) → Matrix<Scalar>The facets of a polyhedron that has the fan

*P*as its normal fan, or the empty matrix if no such polyhedron exists.

Special purpose functions.

**building_set**(generators, n) → PowerSetProduce a building set from a family of sets.

##### Parameters

Array<Set> generators the generators of the building setInt n the size of the ground set##### Returns

PowerSet the induced building set**cone_of_tubing**(G, T) → Cone**is_building_set**(check_me, n) → Bool**is_B_nested**(check_me, B) → Bool**tubes_of_graph**(G) → Set<Set>**tubes_of_tubing**(G, T) → Set<Set>**tubing_of_graph**(G) → Set<Set>

These clients provide standard constructions for PolyhedralFan objects, e.g. from polytopes (face_fan or normal_fan) or from other fans (via projection, refinement or product).

**common_refinement**(f1, f2) → PolyhedralFanComputes the common refinement of two fans.

**face_fan**<Coord> (p, v) → PolyhedralFanComputes the face fan of

*p*.##### Type Parameters

Coord ##### Parameters

Polytope p Vector v a relative interior point of the polytope##### Returns

PolyhedralFan **face_fan**<Coord> (p) → PolyhedralFanComputes the face fan of

*p*. the polytope has to be*CENTERED***graph_associahedron_fan**(G) → PolyhedralFan**groebner_fan**(I) → PolyhedralFanCall wiki:external_software#gfan to compute the greobner fan of an ideal.

**hyperplane_arrangement**(H) → PolyhedralFan**k_skeleton**<Coord> (F, k) → PolyhedralFanComputes the

*k*-skeleton of the polyhedral fan*F*, i.e. the subfan of*F*consisting of all cones of dimension <=*k*.**normal_fan**<Coord> (p) → PolyhedralFan**planar_net**(p) → PlanarNet**product**(F1, F2) → PolyhedralFanConstruct a new polyhedral fan as the

*product*of two given polyhedral fans*F1*and*F2*.##### Parameters

PolyhedralFan F1 PolyhedralFan F2 ##### Options

Bool no_coordinates only combinatorial information is handled##### Returns

PolyhedralFan **projection**(P, indices) → PolyhedralFanOrthogonally project a pointed fan to a coordinate subspace.

The subspace the fan

*P*is projected on is given by indices in the set*indices*. The option*revert*inverts the coordinate list.##### Parameters

PolyhedralFan P Array<Int> indices ##### Options

Bool revert inverts the coordinate list##### Returns

PolyhedralFan **project_full**(P) → PolyhedralFanOrthogonally project a fan to a coordinate subspace such that redundant columns are omitted, i.e., the projection becomes full-dimensional without changing the combinatorial type.

##### Parameters

PolyhedralFan P ##### Options

Bool no_labels VERTEX_LABELS]] to the projection. default: 0##### Returns

PolyhedralFan **secondary_fan**(M) → PolyhedralFanCall wiki:external_software#gfan to compute the secondary fan of a point configuration.

**secondary_fan**(P) → PolyhedralFanCall wiki:external_software#gfan to compute the secondary fan of a point configuration.

These clients provide constructions for PolyhedralComplex objects.

**mixed_subdivision**(P_0, P_1, VIF, t_0, t_1) → PolyhedralComplexCreate a weighted mixed subdivision of the Minkowski sum of two polytopes, using the Cayley trick. The polytopes must have the same dimension, at least one of them must be pointed. The vertices of the first polytope

*P_0*are weighted with*t_0*, and the vertices of the second polytope*P_1*with*t_1*.Default values are

*t_0*=*t_1*=1.##### Parameters

Polytope P_0 the first polytopePolytope P_1 the second polytopeArray<Set> VIF the indices of the vertices of the mixed cellsScalar t_0 the weight for the vertices of*P_0*; default 1Scalar t_1 the weight for the vertices of*P_1*; default 1##### Options

Bool no_labels Do not copy VERTEX_LABELS from the original polytopes. default: 0##### Returns

PolyhedralComplex **mixed_subdivision**(m, C, a) → PolyhedralComplexCreate a weighted mixed subdivision of a Cayley embedding of a sequence of polytopes. Each vertex

*v*of the*i*-th polytope is weighted with*t_i*, the*i*-th entry of the optional array*t*.##### Parameters

Int m the number of polytopes giving rise to the Cayley embeddingPolytope C the Cayley embedding of the input polytopesArray<Set> a triangulation of C##### Options

Vector<Scalar> t scaling for the Cayley embedding; defaults to the all-1 vectorBool no_labels Do not copy VERTEX_LABELS from the original polytopes. default: 0##### Returns

PolyhedralComplex **mixed_subdivision**(A) → PolyhedralComplexCreate a weighted mixed subdivision of a sequence (P1,...,Pm) of polytopes, using the Cayley trick. All polytopes must have the same dimension, at least one of them must be pointed. Each vertex

*v*of the*i*-th polytope is weighted with*t_i*, the*i*-th entry of the optional array*t*.##### Parameters

Array<Polytope> A the input polytopes##### Options

Vector<Scalar> t scaling for the Cayley embedding; defaults to the all-1 vectorBool no_labels Do not copy VERTEX_LABELS from the original polytopes. default: 0##### Returns

PolyhedralComplex **tiling_quotient**<Coord> (P, Q) → PolyhedralComplexCalculates the quotient of

*P*by*Q*+L, where*Q*+L is a lattice tiling. The result is a polytopal complex inside*Q*.##### Type Parameters

Coord ##### Parameters

Polytope P a polytopePolytope Q a polytope that tiles space##### Returns

PolyhedralComplex

These functions capture information of the object that is concerned with the action of permutation groups.

**combinatorial_symmetries**(f) → group::PermutationActionCompute the combinatorial symmetries (i.e., automorphisms of the face lattice) of a given fan

*f*. They are stored in terms of a GROUP.RAYS_ACTION and a GROUP.MAXIMAL_CONES_ACTION property in*f*, and the GROUP.MAXIMAL_CONES_ACTION is also returned.##### Parameters

PolyhedralFan f ##### Returns

group::PermutationAction the action of the combinatorial symmetry group on the rays**Example:**- To get the ray symmetry group of the square and print its generators, type the following:
`> print combinatorial_symmetries(normal_fan(polytope::cube(2)))->GENERATORS;`

`2 3 0 1`

`1 0 3 2`

`0 2 1 3`

`> $f = normal_fan(polytope::cube(2)); combinatorial_symmetries($f);`

`> print $f->GROUP->RAYS_ACTION->GENERATORS;`

`0 1 3 2`

`1 0 2 3`

`2 3 0 1`

`> print $f->GROUP->MAXIMAL_CONES_ACTION->GENERATORS;`

`2 3 0 1`

`1 0 3 2`

`0 2 1 3`

**cones_action**(f, k) → group::PermutationActionReturns the permutation action induced by the symmetry group of the fan

*f*on the set of*k*-dimensional cones. This action is not stored as a property of*f*, because polymake doesn't support dynamic names of properties. Be aware that the set of*k*-dimensional cones itself is $f->CONES->[$k-1].##### Parameters

fan::PolyhedralFan f the input fanInt k the dimension of the cones to induce the action on##### Returns

group::PermutationAction a the action induced by*Aut*(*f*) on the set of*k*-dimensional cones**Example:**- Consider a 3-cube
*c*. To calculate the induced action of*Aut*(*c*) on the set of 2-dimensional cones of the normal fan, type`> $f = fan::normal_fan(polytope::cube(3, group=>1));`

`> print fan::cones_action($f,2)->properties();`

`name: CONES_ACTION(2)`

`type: PermutationAction<Int, Rational>`

`description: action induced on 2-dimensional cones`

`GENERATORS`

`0 3 4 1 2 5 7 6 8 10 9 11`

`1 0 2 5 6 3 4 7 9 8 11 10`

`0 2 1 4 3 8 9 10 5 6 7 11`

`> print $f->CONES->[1];`

`{2 4}`

`{0 4}`

`{0 2}`

`{1 4}`

`{1 2}`

`{3 4}`

`{0 3}`

`{1 3}`

`{2 5}`

`{0 5}`

`{1 5}`

`{3 5}`

**orbit_complex**(input_complex, gens) → fan::PolyhedralComplexConstructs the orbit complex of a given polyhedral complex

*input_complex*with respect to a given set of generators*gens*.##### Parameters

fan::PolyhedralComplex input_complex the generating complex of the orbit complexArray<Array<Int>> gens the generators of a permutation group that acts on the coordinates of the ambient space##### Returns

fan::PolyhedralComplex the orbit complex of*input_complex*w.r.t. the coordinate action generated by*gens***Example:**- To calculate an orbit complex with respect to a group of coordinate permutations, follow these steps: First specify a seed complex:
`> $f=new PolyhedralComplex(VERTICES=>[[1,1,1],[1,1,0],[1,-1,-1]], MAXIMAL_POLYTOPES=>[[0,1],[1,2]]);`

Then define the orbit complex by specifying a permutation action on coordinates:`> $oc = orbit_complex($f, [[1,0]]);`

The only properties of $oc defined so far reside in GROUP:`> print $oc->GROUP->properties();`

`type: Group as PolyhedralComplex<Rational>::GROUP`

`COORDINATE_ACTION`

`type: PermutationAction<Int, Rational> as PolyhedralComplex<Rational>::GROUP::COORDINATE_ACTION`

`MAXIMAL_POLYTOPES_ACTION`

`type: PermutationAction<Int, Rational> as PolyhedralComplex<Rational>::GROUP::MAXIMAL_POLYTOPES_ACTION`

Now you can calculate the VERTICES and MAXIMAL_POLYTOPES of the orbit fan. IMPORTANT: You must ask for $oc->VERTICES before $oc->MAXIMAL_POLYTOPES.`> print $oc->VERTICES;`

`1 1 1`

`1 1 0`

`1 -1 -1`

`1 0 1`

`> print $oc->N_MAXIMAL_POLYTOPES;`

`4`

**orbit_complex**(input_fan, a) → PolytopeConstructs the orbit fan of a given fan

*input_fan*with respect to a given group action*a*.##### Parameters

fan::PolyhedralFan input_fan the generating fan of the orbit fangroup::PermutationAction a the action of a permutation group on the coordinates of the ambient space##### Returns

Polytope the orbit fan of*input_fan*w.r.t. the action*a***Example:**- To calculate an orbit complex with respect to a group of coordinate permutations, follow these steps: First specify a seed complex:
`> $f=new PolyhedralComplex(VERTICES=>[[1,1,1],[1,1,0],[1,1/2,1/4]], MAXIMAL_POLYTOPES=>[[0,2],[1,2]]);`

Then define the orbit complex by specifying a matrix group action on the coordinates:`> $oc = orbit_complex($f, polytope::cube(2,group=>1)->GROUP->MATRIX_ACTION);`

The only properties of $oc defined so far reside in GROUP:`type: Group as PolyhedralComplex<Rational>::GROUP`

`MATRIX_ACTION_ON_COMPLEX`

`type: MatrixActionOnVectors<Rational> as PolyhedralComplex<Rational>::GROUP::MATRIX_ACTION_ON_COMPLEX`

`MAXIMAL_POLYTOPES_ACTION`

`type: PermutationAction<Int, Rational> as PolyhedralComplex<Rational>::GROUP::MAXIMAL_POLYTOPES_ACTION`

Now you can calculate the VERTICES and MAXIMAL_POLYTOPES of the orbit fan. IMPORTANT: You must ask for $oc->VERTICES before $oc->MAXIMAL_POLYTOPES.`> print $oc->VERTICES;`

`1 1 1`

`1 1 0`

`1 1/2 1/4`

`1 -1 -1`

`1 -1 1`

`1 1 -1`

`1 -1 0`

`1 0 -1`

`1 0 1`

`1 -1/2 -1/4`

`1 -1/2 1/4`

`1 -1/4 -1/2`

`1 -1/4 1/2`

`1 1/4 -1/2`

`1 1/4 1/2`

`1 1/2 -1/4`

`> print $oc->N_MAXIMAL_POLYTOPES;`

`16`

**orbit_fan**(input_fan, gens) → fan::PolyhedralFanConstructs the orbit fan of a given fan

*input_fan*with respect to a given set of generators*gens*.##### Parameters

fan::PolyhedralFan input_fan the generating fan of the orbit fanArray<Array<Int>> gens the generators of a permutation group that acts on the coordinates of the ambient space##### Returns

fan::PolyhedralFan the orbit fan of*input_fan*w.r.t. the coordinate action generated by*gens***Example:**- To calculate an orbit fan, follow these steps: First specify a seed fan:
`> $f=new PolyhedralFan(RAYS=>[[1,1],[1,0],[-1,-1]], MAXIMAL_CONES=>[[0,1],[1,2]]);`

Then define the orbit fan by specifying coordinate permutations:`> $of = orbit_fan($f,[[1,0]]);`

The only properties of $of defined so far reside in GROUP:`> print $of->GROUP->properties();`

`name: unnamed#0`

`type: Group as PolyhedralFan<Rational>::GROUP`

`HOMOGENEOUS_COORDINATE_ACTION`

`type: PermutationAction<Int, Rational>`

`MAXIMAL_CONES_ACTION`

`type: PermutationAction<Int, Rational> as PolyhedralFan<Rational>::GROUP::MAXIMAL_CONES_ACTION`

`> print $of->RAYS;`

`1 1`

`1 0`

`-1 -1`

`0 1`

`> print $of->N_MAXIMAL_CONES;`

`4`

**orbit_fan**<Scalar> (input_fan, gens) → fan::PolyhedralFanConstructs the orbit fan of a given fan

*input_fan*with respect to a given set of matrix group generators*gens*.##### Type Parameters

Scalar underlying number type##### Parameters

fan::PolyhedralFan input_fan the generating fan of the orbit fanArray<Matrix<Scalar>> gens the generators of a matrix group that acts on the ambient space##### Returns

fan::PolyhedralFan the orbit fan of*input_fan*w.r.t. the matrix action generated by*gens***Example:**- To calculate an orbit fan, follow these steps: First specify a seed fan:
`> $f=new PolyhedralFan(RAYS=>[[1,1,1],[1,1,0],[1,1/2,1/4]],MAXIMAL_CONES=>[[0,2],[1,2]]);`

Then define the orbit fan by specifying a matrix group action:`> $of = orbit_fan($f,polytope::cube(2,group=>1)->GROUP->MATRIX_ACTION);`

The only properties of $of defined so far reside in GROUP:`> print $of->GROUP->properties();`

`name: unnamed#0`

`type: Group as PolyhedralFan<Rational>::GROUP`

`MATRIX_ACTION`

`type: MatrixActionOnVectors<Rational>`

`MAXIMAL_CONES_ACTION`

`type: PermutationAction<Int, Rational> as PolyhedralFan<Rational>::GROUP::MAXIMAL_CONES_ACTION`

`> print $of->RAYS;`

`1 1 1`

`1 1 0`

`1 1/2 1/4`

`1 -1 -1`

`1 -1 1`

`1 1 -1`

`1 -1 0`

`1 0 -1`

`1 0 1`

`1 -1/2 -1/4`

`1 -1/2 1/4`

`1 -1/4 -1/2`

`1 -1/4 1/2`

`1 1/4 -1/2`

`1 1/4 1/2`

`1 1/2 -1/4`

`> print $of->N_MAXIMAL_CONES;`

`16`

These functions are for visualization.

**splitstree**(vis_obj ...)Call wiki:external_software#SplitsTree with the given visual objects.

##### Parameters

Visual::Object vis_obj ... objects to display##### Options

String File "filename" or "AUTO" Only create a NEXUS format file, don't start the GUI.The`.nex`

suffix is automatically added to the file name.Specify*AUTO*if you want the filename be automatically derived from the drawing title.You can also use any expression allowed for the`open`

function, including "-" for terminal output, "&HANDLE" for an already opened file handle, or "| program" for a pipe.**visual_splitstree**(M) → Visual::ObjectVisualize the splits of a finite metric space (that is, a planar image of a tight span). Calls SplitsTree.

##### Parameters

Matrix<Rational> M Matrix defining a metric##### Options

Array<String> taxa Labels for the taxaString name Name of the file##### Returns

Visual::Object

## Common Option Lists

These options capture geometric information of the object. Geometric properties depend on geometric information of the object, like, e.g., vertices or facets.

**secondary_cone_options**Parameters for user method secondary_cone.

##### Options

Matrix<Scalar> equations system of linear equation the cone is cut withSet<Int> lift_to_zero restrict lifting function to zero at points designatedBool lift_face_to_zero restrict lifting functions to zero at the entire face spanned by points designatedBool test_regularity throws an exception if subdivision is not regular

These options are for visualization.

**flap_options**Parameters to control the shapes of the flaps. The precise values are more or less randomly chosen. Should work fine for most polytopes whose edge lengths do not vary too much.

##### Options

Float WidthMinimum absolute minimum widthFloat WidthRelativeMinimum minimum relative width (w.r.t. length of first edge)Float Width absolute width, overrides the previousFloat FlapCutOff proportion by which outer edge of flap is shorter than the actual edge (on both sides)**Visual::Graph::TightSpanDecorations**UNDOCUMENTED**imports from:**Visual::Graph::decorations, Visual::Wire::decorations, Visual::PointSet::decorations##### Options

Array<String> Taxa Labels for the taxa of the metric.