====== BigObject PolyhedralFan ====== //from application [[..:fan|fan]]//\\ \\ A 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 ''[[..:fan:PolyhedralFan#INPUT_RAYS |INPUT_RAYS]]'' and ''[[..:fan:PolyhedralFan#INPUT_CONES |INPUT_CONES]]'' each input cone must list all the input rays incident. Once non-trivial linealities are allowed the following will apply: The ''[[..:fan:PolyhedralFan#RAYS |RAYS]]'' always lie in a linear subspace which is complementary to the ''[[..:fan:PolyhedralFan#LINEALITY_SPACE |LINEALITY_SPACE]]''. ? Type Parameters: :: ''Scalar'': numeric data type used for the coordinates, must be an ordered field. Default is ''[[..:common#Rational |Rational]]''. ? Specializations: :: ''PolyhedralFan'': Unnamed full specialization of PolyhedralFan ? 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 ? Permutations: : ? ConesPerm: :: permuting the ''[[..:fan:PolyhedralFan#MAXIMAL_CONES |MAXIMAL_CONES]]'' ? RaysPerm: :: permuting the ''[[..:fan:PolyhedralFan#RAYS |RAYS]]'' ===== Properties ===== ==== Input property ==== These properties are for input only. They allow redundant information. ---- {{anchor:input_cones:}} ? **''INPUT_CONES''** :: Maybe redundant list of not necessarily maximal cones. Indices refer to ''[[..:fan:PolyhedralFan#INPUT_RAYS |INPUT_RAYS]]''. Each cone must list all rays of ''[[..:fan:PolyhedralFan#INPUT_RAYS |INPUT_RAYS]]'' it contains. Any incident cones will automatically be added. 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 ''[[..:fan:PolyhedralFan#MAXIMAL_CONES |MAXIMAL_CONES]]'' if you want to know the maximal cones (indexed by ''[[..:fan:PolyhedralFan#RAYS |RAYS]]''). ? Type: :''[[..:common#IncidenceMatrix |IncidenceMatrix]]<[[..:common#NonSymmetric |NonSymmetric]]>'' ? Example: :: In 3-space, we construct the fan containing the closure of the all-positive octant and the (x<=0, y>=0, z=0) quadrant with the following input (note that we do not have to state the combinatorics for cones contained in a given cone of higher dimension, e.g. the the (x>=0, z>=0) quadrant in the y=0 plane): :: > $f = new PolyhedralFan(INPUT_RAYS=>[[1,0,0],[0,1,0],[0,0,1],[-1,0,0]],INPUT_CONES=>[[0,1,2],[1,3]]); > print rows_labeled($f->RAYS); 0:1 0 0 1:0 1 0 2:0 0 1 3:-1 0 0 :: > print $f->CONES; <{1} {3} {2} {0} > <{1 3} {1 2} {0 2} {0 1} > <{0 1 2} > ---- {{anchor:input_cones_reps:}} ? **''INPUT_CONES_REPS''** :: Maybe redundant list of not necessarily maximal cones, one from each orbit. All vectors in the input must be non-zero. Indices refer to ''[[..:fan:PolyhedralFan#INPUT_RAYS |INPUT_RAYS]]''. ? Type: :''[[..:common#IncidenceMatrix |IncidenceMatrix]]<[[..:common#NonSymmetric |NonSymmetric]]>'' ---- {{anchor:input_lineality:}} ? **''INPUT_LINEALITY''** :: Vectors whose linear span defines a subset of the lineality space of the fan; redundancies are allowed. Input section only. Ask for ''[[..:fan:PolyhedralFan#LINEALITY_SPACE |LINEALITY_SPACE]]'' if you want to know the lineality space. ? Type: :''[[..:common#Matrix |Matrix]]'' ? Example: :: In 3-space, we can "stretch" the (x>=0, y>=0) quadrant in the z=0 hyperplane to obtain the joint of the two octants where x and y are non-negative by adding linearity in z-direction: :: > $f = new PolyhedralFan(INPUT_RAYS=>[[1,0,0],[0,1,0]],INPUT_CONES=>[[0,1]],INPUT_LINEALITY=>[[0,0,1]]); ---- {{anchor:input_rays:}} ? **''INPUT_RAYS''** :: Rays from which the cones are formed. May be redundant. All vectors in the input must be non-zero. You also need to provide ''[[..:fan:PolyhedralFan#INPUT_CONES |INPUT_CONES]]'' to define a fan completely. Input section only. Ask for ''[[..:fan:PolyhedralFan#RAYS |RAYS]]'' if you want a list of non-redundant rays. ? Type: :''[[..:common#Matrix |Matrix]]'' ? Example: :: When constructing the fan which displays the division of the plane into quadrants, we can use redundant rays such that the indices given in ''[[..:fan:PolyhedralFan#INPUT_CONES |INPUT_CONES]]'' suggest that two rays form the border of our fan, but due to our choice in ''[[..:fan:PolyhedralFan#INPUT_RAYS |INPUT_RAYS]]'', they actually are the same ray adjacent to two distinct 2-dimensional cones: :: > $f = new PolyhedralFan(INPUT_RAYS=>[[1,0],[0,1],[-1,0],[0,-1],[2,0]],INPUT_CONES=>[[0,1],[1,2],[2,3],[3,4]]); > print rows_labeled($f->RAYS); 0:1 0 1:0 1 2:-1 0 3:0 -1 :: > print $f->CONES; <{0} {1} {2} {3} > <{0 1} {1 2} {2 3} {0 3} > ---- {{anchor:input_rays_reps:}} ? **''INPUT_RAYS_REPS''** :: One Ray from each orbit. May be redundant. ? Type: :''[[..:common#Matrix |Matrix]]'' ---- ==== Combinatorics ==== These properties capture combinatorial information of the object. Combinatorial properties only depend on combinatorial data of the object like, e.g., the face lattice. ---- {{anchor:combinatorial_dim:}} ? **''COMBINATORIAL_DIM''** :: Combinatorial dimension of the fan. ? Type: :''[[..:common#Int |Int]]'' ? Example: :: The [[..:fan#normal_fan |normal fan]] of the 6-cube has combinatorial dimension 5: :: > print normal_fan(cube(6))->COMBINATORIAL_DIM; 5 ---- {{anchor:complete:}} ? **''COMPLETE''** :: The polyhedral fan is __complete__ if its suport is the whole space. Due to undecidability issues this is checked heuristically only. See the remarks on [[..:topaz:SimplicialComplex#SPHERE |SPHERE]] for details. Note that in the case of a polyhedral complex, this refers to the underlying fan, so should always be false. ? Type: :''[[..:common#Bool |Bool]]'' ? Example: :: The [[..:fan#normal_fan |normal fan]] of a polytope always is complete; here we see this for the 8-cube: :: > print normal_fan(cube(8))->COMPLETE; true ---- {{anchor:cones:}} ? **''CONES''** :: List of all cones of the fan of each dimension. Indices refer to ''[[..:fan:PolyhedralFan#RAYS |RAYS]]''. ? Type: :''[[..:common#Array |Array]]<[[..:common#IncidenceMatrix |IncidenceMatrix]]<[[..:common#NonSymmetric |NonSymmetric]]%%>>%%'' ? Example: :: A fan constructed with a 2-dimensional cone in ''[[..:fan:PolyhedralFan#INPUT_CONES |INPUT_CONES]]'' also contains the incident 1-dimensional cones. :: > $f = new PolyhedralFan(INPUT_RAYS=>[[1,0],[0,1]],INPUT_CONES=>[[0,1]]); > print $f->CONES; <{0} {1} > <{0 1} > ---- {{anchor:cones_combinatorial_dims:}} ? **''CONES_COMBINATORIAL_DIMS''** :: The combinatorial dimensions of the [[..:fan:PolyhedralFan#CONES |cones]]. ? Type: :''[[..:common#Array |Array]]<[[..:common#Int |Int]]>'' ---- {{anchor:dual_graph:}} ? **''DUAL_GRAPH''** :: The graph whose nodes are the maximal cones which are connected if they share a common facet. Only defined if ''[[..:fan:PolyhedralFan#PURE |PURE]]''. ? Type: :''[[..:graph:Graph |Graph]]<[[..:common#Undirected |Undirected]]>'' ? Example: :: The dual graph of a [[..:fan#face_fan |face fan]] of the 3-cube is isomorphic to the vertex-edge graph of the 3-dimensional cross polytope. :: > $c = cross(3); > $f = face_fan(cube(3)); > $g1 = $f->DUAL_GRAPH; > $g2 = $c->GRAPH; > print isomorphic($g1->ADJACENCY,$g2->ADJACENCY); true ---- {{anchor:f2_vector:}} ? **''F2_VECTOR''** :: fik is the number of incident pairs of i-dimensional cones and k-dimensional cones; the main diagonal contains the ''[[..:fan:PolyhedralFan#F_VECTOR |F_VECTOR]]''. ? Type: :''[[..:common#Matrix |Matrix]]<[[..:common#Integer |Integer]],[[..:common#NonSymmetric |NonSymmetric]]>'' ---- {{anchor:f_vector:}} ? **''F_VECTOR''** :: fk is the number of k-dimensional cones starting from dimension k=1. The f-vector of a polytope and the f-vector of any of its [[..:fan#face_fan |face fans]] coincide; for the 3-cube: > print face_fan(cube(3))->F_VECTOR; | 8 12 6 ? Type: :''[[..:common#Vector |Vector]]<[[..:common#Integer |Integer]]>'' ---- {{anchor:graph:}} ? **''GRAPH''** :: 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. ? Type: :''[[..:graph:Graph |Graph]]<[[..:common#Undirected |Undirected]]>'' ? Example: :: The graph of a [[..:fan#face_fan |face fan]] of a polytope is isomorphic to the vertex-edge graph of the polytope. Here we see this for the 3-cube: :: > $c = cube(3); > $f = face_fan($c); > $g1 = $f->GRAPH; > $g2 = $c->GRAPH; > print isomorphic($g1->ADJACENCY,$g2->ADJACENCY); true ---- {{anchor:hasse_diagram:}} ? **''HASSE_DIAGRAM''** :: ? Type: :''[[..:graph:Lattice |Lattice]]<[[..:graph#BasicDecoration |BasicDecoration]],[[..:graph#Nonsequential |Nonsequential]]>'' ? Example: :: To compute the Hasse diagram of the [[..:fan#normal_fan |normal fan]] of the 2-cube and display its decoration, we can do the following. Note the artificial node on top and the empty node at the bottom. The latter represents the trivial cone consisting only of the origin. :: > $h = normal_fan(cube(2))->HASSE_DIAGRAM; :: print $h->DECORATION; ? Methods of HASSE_DIAGRAM: : ? **''dim()''** :: ? Returns: :''[[..:common#Int |Int]]'' ? **''nodes_of_dim([[..:common#Int |Int]] d)''** :: ? Parameters: :: ''[[..:common#Int |Int]]'' ''d'': dimension ? Returns: :''[[..:common#Set |Set]]<[[..:common#Int |Int]]>'' ? **''nodes_of_dim_range([[..:common#Int |Int]] d1, [[..:common#Int |Int]] d1)''** :: ? Parameters: :: ''[[..:common#Int |Int]]'' ''d1'': lower dimension :: ''[[..:common#Int |Int]]'' ''d1'': upper dimension ? Returns: :''[[..:common#Set |Set]]<[[..:common#Int |Int]]>'' ---- {{anchor:maximal_cones:}} ? **''MAXIMAL_CONES''** :: Non redundant list of maximal cones. Indices refer to ''[[..:fan:PolyhedralFan#RAYS |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. ? Type: :''[[..:common#IncidenceMatrix |IncidenceMatrix]]<[[..:common#NonSymmetric |NonSymmetric]]>'' ? Example: :: The maximal cones of the normal fan of the 3-cube describe which faces share a common vertex: :: > print normal_fan(cube(3))->MAXIMAL_CONES; {0 2 4} {1 2 4} {0 3 4} {1 3 4} {0 2 5} {1 2 5} {0 3 5} {1 3 5} ---- {{anchor:maximal_cones_combinatorial_dims:}} ? **''MAXIMAL_CONES_COMBINATORIAL_DIMS''** :: The combinatorial dimensions of the [[..:fan:PolyhedralFan#MAXIMAL_CONES |maximal cones]]. ? Type: :''[[..:common#Array |Array]]<[[..:common#Int |Int]]>'' ? Example: :: Here we construct a fan with a 3-dimensional and a 2-dimensional maximal cone, of which the latter contains lineality, and then display the corresponding combinatorial dimensions: :: > $f = new PolyhedralFan(INPUT_RAYS=>[[1,0,0],[0,1,0],[0,0,1],[-1,0,0],[0,-1,0]],INPUT_CONES=>[[0,1,2],[1,3,4]]); > print $f->MAXIMAL_CONES; {0 1 2} {3} :: > print $f->MAXIMAL_CONES_COMBINATORIAL_DIMS; 2 0 ---- {{anchor:maximal_cones_incidences:}} ? **''MAXIMAL_CONES_INCIDENCES''** :: Array of incidence matrices of all [[..:fan:PolyhedralFan#MAXIMAL_CONES |maximal cones]]. Indices refer to ''[[..:fan:PolyhedralFan#RAYS |RAYS]]''. ? Type: :''[[..:common#Array |Array]]<[[..:common#IncidenceMatrix |IncidenceMatrix]]<[[..:common#NonSymmetric |NonSymmetric]]%%>>%%'' ? Example: :: Here we construct a fan with a 3-dimensional and a 2-dimensional maximal cone and then display the incident cones: :: > $f = new PolyhedralFan(INPUT_RAYS=>[[1,0,0],[0,1,0],[0,0,1],[-1,0,0]],INPUT_CONES=>[[0,1,2],[1,3]]); > print $f->MAXIMAL_CONES; {0 1 2} {1 3} :: > print $f->MAXIMAL_CONES_INCIDENCES; <{1 2} {0 2} {0 1} > <{1} {3} > ---- {{anchor:maximal_cones_thru_rays:}} ? **''MAXIMAL_CONES_THRU_RAYS''** :: Transposed to ''[[..:fan:PolyhedralFan#MAXIMAL_CONES |MAXIMAL_CONES]]''. Notice that this is a temporary property; it will not be stored in any file. ? Type: :''[[..:common#IncidenceMatrix |IncidenceMatrix]]<[[..:common#NonSymmetric |NonSymmetric]]>'' ---- {{anchor:n_cones:}} ? **''N_CONES''** :: Number of ''[[..:fan:PolyhedralFan#CONES |CONES]]''. ? Type: :''[[..:common#Int |Int]]'' ---- {{anchor:n_maximal_cones:}} ? **''N_MAXIMAL_CONES''** :: Number of ''[[..:fan:PolyhedralFan#MAXIMAL_CONES |MAXIMAL_CONES]]''. ? Type: :''[[..:common#Int |Int]]'' ? Example: :: The number of facets of a polytope is the same as the number of maximal cones of its face fan; here we can see this for the 3-cube: :: > print face_fan(cube(3))->N_MAXIMAL_CONES; 6 ---- {{anchor:pure:}} ? **''PURE''** :: The polyhedral fan is __pure__ if all [[..:fan:PolyhedralFan#MAXIMAL_CONES |maximal cones]] are of the same dimension. ? Type: :''[[..:common#Bool |Bool]]'' ? Example: :: Generating a fan from two distinct 2-dimensional cones gives a pure fan: :: > $f = new PolyhedralFan(INPUT_RAYS=>[[1,0],[0,1],[-1,0],[0,-1]],INPUT_CONES=>[[0,1],[2,3]]); > print $f->PURE; true ? Example: :: Gnerating a fan from a 2-dimensional and a 1-dimensional cone results in the fan not being pure if the latter is a ray not contained in the former: :: > $f = new PolyhedralFan(INPUT_RAYS=>[[1,1],[-1,1],[0,-1]],INPUT_CONES=>[[0,1],[2]]); > print $f->PURE; false ---- {{anchor:simplicial:}} ? **''SIMPLICIAL''** :: The polyhedral fan is __simplicial__ if all [[..:fan:PolyhedralFan#MAXIMAL_CONES |maximal cones]] are [[..:polytope:Cone#SIMPLICIAL |simplicial]]. ? Type: :''[[..:common#Bool |Bool]]'' ? Example: :: The [[..:fan#normal_fan |normal fan]] of a d-cube is __simplicial__; here we see this for the 3-cube: :: > print normal_fan(cube(3))->SIMPLICIAL; true ---- ==== Geometry ==== These properties capture geometric information of the object. Geometric properties depend on geometric information of the object, like, e.g., vertices or facets. ---- {{anchor:facet_normals:}} ? **''FACET_NORMALS''** :: The possible facet normals of all maximal cones. ? Type: :''[[..:common#Matrix |Matrix]]'' ? Example: :: The two facet normals of the complete fan dividing the plane into the four quadrants (which can be obtained by computing the [[..:fan#normal_fan |normal fan]] of the 2-cube) point in x- and in y-direction, respectively: :: > print normal_fan(cube(2))->FACET_NORMALS; 1 0 0 1 ---- {{anchor:fan_ambient_dim:}} ? **''FAN_AMBIENT_DIM''** :: Dimension of the space which contains the polyhedral fan. Note: To avoid confusion in context of (in-)homogenuous coordinates it is generally advised to use the method ''[[..:fan:PolyhedralFan#AMBIENT_DIM |AMBIENT_DIM]]''. ? Type: :''[[..:common#Int |Int]]'' ? Example: :: The fan living in the plane containing only the cone which consists of the ray pointing in positive x-direction is by definition embedded in the plane: :: > $f = new PolyhedralFan(INPUT_RAYS=>[[1,0]],INPUT_CONES=>[[0]]); > print $f->FAN_AMBIENT_DIM; 2 ---- {{anchor:fan_dim:}} ? **''FAN_DIM''** :: Dimension of the polyhedral fan. # Note: To avoid confusion in context of (in-)homogenuous coordinates it is generally advised to use the method ''[[..:fan:PolyhedralFan#DIM |DIM]]''. ? Type: :''[[..:common#Int |Int]]'' ? Example: :: The fan living in the plane containing only the cone which consists of the ray pointing in positive x-direction is 1-dimensional: :: > $f = new PolyhedralFan(INPUT_RAYS=>[[1,0]],INPUT_CONES=>[[0]]); > print $f->FAN_DIM; 1 ---- {{anchor:full_dim:}} ? **''FULL_DIM''** :: A fan is __full-dimensional__ if its [[..:fan:PolyhedralFan#FAN_DIM |dimension]] and [[..:fan:PolyhedralFan#FAN_AMBIENT_DIM |ambient dimension]] coincide. ? Type: :''[[..:common#Bool |Bool]]'' ? Example: :: The [[..:fan#normal_fan |normal fan]] of a polytope is always full-dimensional, which we see here for the 5-dimensional [[..:polytope#cross |cross polytope]]: :: > $nf = normal_fan(cross(5)); > print $nf->FULL_DIM; true ---- {{anchor:lineality_dim:}} ? **''LINEALITY_DIM''** :: Dimension of the [[..:fan:PolyhedralFan#LINEALITY_SPACE |lineality space]]. ? Type: :''[[..:common#Int |Int]]'' ? Example: :: A [[..:fan:PolyhedralFan#POINTED |pointed]] fan has no lineality, thus the dimension of its lineality space is 0. The most simple example is a fan only consisting of one ray, here in the plane: :: > $f = new PolyhedralFan(INPUT_RAYS=>[[1,0]],INPUT_CONES=>[[0]]); > print $f->LINEALITY_DIM; 0 ---- {{anchor:lineality_space:}} ? **''LINEALITY_SPACE''** :: Since we do not require our cones to be [[..:fan:PolyhedralFan#POINTED |pointed]]: a basis of the lineality space of the fan. Co-exists with ''[[..:fan:PolyhedralFan#RAYS |RAYS]]''. ? Type: :''[[..:common#Matrix |Matrix]]'' ? Example: :: We can create a fan in 3-space from the two 2-dimensional cones which are the (x,y)- and (x,z)-halfspaces where y and z are non-negative, respectively. Both cones and thus the fan contain lineality in x-direction: :: > $f = new PolyhedralFan(INPUT_RAYS=>[[1,0,0],[0,1,0],[0,0,1],[-1,0,0]],INPUT_CONES=>[[0,1,3],[0,2,3]]); > print $f->LINEALITY_SPACE; 1 0 0 ---- {{anchor:linear_span_normals:}} ? **''LINEAR_SPAN_NORMALS''** :: The possible linear span normals of all maximal cones. Empty if ''[[..:fan:PolyhedralFan#PURE |PURE]]'' and ''[[..:fan:PolyhedralFan#FULL_DIM |FULL_DIM]]'', i.e. each maximal cone has the same dimension as the ambient space. ? Type: :''[[..:common#Matrix |Matrix]]'' ? Example: :: We construct a fan in 3-space with two 2-dimensional maximal cones and a 1-dimensional maximal cone. Note that there are two possible normals for the latter, but one of these also is a normal for one of the 2-dimensional cones; thus we receive three normals: :: > $f = new PolyhedralFan(INPUT_RAYS=>[[1,0,0],[0,1,0],[-1,0,1],[-1,-1,0]],INPUT_CONES=>[[0,1],[1,2],[3]]); > print $f->LINEAR_SPAN_NORMALS; 0 0 1 1 0 1 -1 1 0 ---- {{anchor:maximal_cones_facets:}} ? **''MAXIMAL_CONES_FACETS''** :: Tells for each maximal cone what are its facet normals, thus implying the facets. Each row corresponds to a maximal cone and each column to the row with the same index of ''[[..:fan:PolyhedralFan#FACET_NORMALS |FACET_NORMALS]]''. A negative number means that the corresponding row of ''[[..:fan:PolyhedralFan#FACET_NORMALS |FACET_NORMALS]]'' has to be negated. ? Type: :''[[..:common#SparseMatrix |SparseMatrix]]<[[..:common#Int |Int]],[[..:common#NonSymmetric |NonSymmetric]]>'' ? Example: :: The two facet normals of the complete fan dividing the plane into the four quadrants (which can be obtained by computing the [[..:fan#normal_fan |normal fan]] of the 2-cube) point in x- and in y-direction, respectively. Each quadrant has both of these as normals only differing by the combination of how they point in- or outside: :: > $f = normal_fan(cube(2)); > print $f->MAXIMAL_CONES; {0 2} {1 2} {0 3} {1 3} :: > print rows_numbered($f->FACET_NORMALS); 0:1 0 1:0 1 :: > print $f->MAXIMAL_CONES_FACETS; 1 1 -1 1 1 -1 -1 -1 ---- {{anchor:maximal_cones_linear_span_normals:}} ? **''MAXIMAL_CONES_LINEAR_SPAN_NORMALS''** :: Tells for each maximal cone what is its linear span by naming its normals. Indices refer to ''[[..:fan:PolyhedralFan#LINEAR_SPAN_NORMALS |LINEAR_SPAN_NORMALS]]''. Rows correspond to ''[[..:fan:PolyhedralFan#MAXIMAL_CONES |MAXIMAL_CONES]]''. An empty row corresponds to a full-dimensional cone. ? Type: :''[[..:common#IncidenceMatrix |IncidenceMatrix]]<[[..:common#NonSymmetric |NonSymmetric]]>'' ? Example: :: We construct a fan in 3-space with two 2-dimensional maximal cones and a 1-dimensional maximal cone. This way we receive two cones with one normal and one cone with two normals: :: > $f = new PolyhedralFan(INPUT_RAYS=>[[1,0,0],[0,1,0],[-1,0,1],[-1,-1,0]],INPUT_CONES=>[[0,1],[1,2],[3]]); > print $f->MAXIMAL_CONES; {0 1} {1 2} {3} :: > print rows_numbered($f->LINEAR_SPAN_NORMALS); 0:0 0 1 1:1 0 1 2:-1 1 0 :: > print $f->MAXIMAL_CONES_LINEAR_SPAN_NORMALS; {0} {1} {0 2} ---- {{anchor:n_facet_normals:}} ? **''N_FACET_NORMALS''** :: The number of possible facet normals of all maximal cones. ? Type: :''[[..:common#Int |Int]]'' ? Example: :: The facets of the [[..:fan#normal_fan |normal fan]] of the 3-cube are each spanned by a ray pointing in positive or negative direction of one axis and another ray pointing in positive or negative direction of another axis; thus, the third axis is normal to this facet. This leaves us with three possible facet normals: :: > print normal_fan(cube(3))->N_FACET_NORMALS; 3 ---- {{anchor:n_input_rays:}} ? **''N_INPUT_RAYS''** :: Number of ''[[..:fan:PolyhedralFan#INPUT_RAYS |INPUT_RAYS]]''. ? Type: :''[[..:common#Int |Int]]'' ? Example: :: To determine the combined amount of redundant and unused rays given by ''[[..:fan:PolyhedralFan#INPUT_RAYS |INPUT_RAYS]]'', we compare this number to ''[[..:fan:PolyhedralFan#N_RAYS |N_RAYS]]'': :: > $f = new PolyhedralFan(INPUT_RAYS=>[[1,0],[0,1],[-1,0],[0,-1],[2,0],[1,1]],INPUT_CONES=>[[0,1],[1,2],[2,3],[3,4]]); > print ($f->N_INPUT_RAYS-$f->N_RAYS); 2 ---- {{anchor:n_rays:}} ? **''N_RAYS''** :: Number of ''[[..:fan:PolyhedralFan#RAYS |RAYS]]''. ? Type: :''[[..:common#Int |Int]]'' ? Example: :: The number of facets of a polytope is the number of rays of the corresponding [[..:fan#normal_fan |normal fan]]. Here we see this for the 3-cube: :: > print normal_fan(cube(3))->N_RAYS; 6 ---- {{anchor:orth_lineality_space:}} ? **''ORTH_LINEALITY_SPACE''** :: A basis of the orthogonal complement to ''[[..:fan:PolyhedralFan#LINEALITY_SPACE |LINEALITY_SPACE]]''. ? Type: :''[[..:common#Matrix |Matrix]]'' ? Example: :: In 3-space, we build a fan containing only the ray pointing in positive x-direction, together with lineality in y-direction. The definition of the cones yields no additional lineality, thus the orthogonal complement to the lineality space is spanned by (1,0,0) and (0,0,1): :: > $f = new PolyhedralFan(INPUT_RAYS=>[[1,0,0]],INPUT_CONES=>[[0]],INPUT_LINEALITY=>[[0,1,0]]); > print $f->ORTH_LINEALITY_SPACE; 1 0 0 0 0 1 ---- {{anchor:pointed:}} ? **''POINTED''** :: A fan is __pointed__ if the [[..:fan:PolyhedralFan#LINEALITY_SPACE |lineality space]] is trivial. ? Type: :''[[..:common#Bool |Bool]]'' ? Example: :: The [[..:fan#normal_fan |normal fan]] of a polytope is pointed if and only if the polytope is full-dimensional. Here we confirm this for the normal fans of the 2-cube living in 2- and in 3-space, respectively: :: > $nf_full = normal_fan(cube(2)); > print $nf_full->POINTED; true :: > $nf_not_full = normal_fan(product(cube(2),new Polytope(POINTS=>[[1,0]]))); > print $nf_not_full->POINTED; false ---- {{anchor:pseudo_regular:}} ? **''PSEUDO_REGULAR''** :: True if the fan is a subfan of a ''[[..:fan:PolyhedralFan#REGULAR |REGULAR]]'' fan ? Type: :''[[..:common#Bool |Bool]]'' ? Example: :: Here we build a fan in the plane with the non-negative quadrant and the ray pointing in negative y-direction as its [[..:fan:PolyhedralFan#MAXIMAL_CONES |maximal cones]]. This is a subfan of the fan with all four quadrants as its maximal cones which is the [[..:fan#normal_fan |normal fan]] of the 2-cube; thus, our fan is pseudo regular: :: > $f = new PolyhedralFan(INPUT_RAYS=>[[1,0],[0,1],[-1,0]],INPUT_CONES=>[[0,1],[2]]); > print $f->PSEUDO_REGULAR; true ---- {{anchor:rays:}} ? **''RAYS''** :: Rays of the ''[[..:fan:PolyhedralFan |PolyhedralFan]]''. Non-redundant. Co-exists with ''[[..:fan:PolyhedralFan#LINEALITY_SPACE |LINEALITY_SPACE]]''. ? Type: :''[[..:common#Matrix |Matrix]]'' ? Example: :: The rays of the [[..:fan#face_fan |face fan]] of a 3-dimensioanl cube. This fan has one ray in the direcction of each vertex of the cube. :: > print face_fan(cube(3))->RAYS; -1 -1 -1 1 -1 -1 -1 1 -1 1 1 -1 -1 -1 1 1 -1 1 -1 1 1 1 1 1 ---- {{anchor:regular:}} ? **''REGULAR''** :: True if the fan is the [[..:fan#normal_fan |normal fan]] of a [[..:polytope:Polytope#BOUNDED |bounded]] polytope. ? Type: :''[[..:common#Bool |Bool]]'' ? Example: :: The [[..:fan#face_fan |face fan]] of the centered d-dimensional cross polytope w.r.t. the origin is the [[..:fan#normal_fan |normal fan]] of the d-cube; here we confirm the regularity of the face fan for d=7: :: > print face_fan(cross(7))->REGULAR; true ? Example: :: A [[..:fan#normal_fan |normal fan]] always is complete; thus a fan which is not complete can not be regular: :: > $f = new PolyhedralFan(INPUT_RAYS=>[[1,0],[0,1]],INPUT_CONES=>[[0,1]]); > print $f->REGULAR; false ---- ==== Symmetry ==== These properties capture information of the object that is concerned with the action of permutation groups. ---- {{anchor:cones_orbit_sizes:}} ? **''CONES_ORBIT_SIZES''** :: Number of ''[[..:fan:PolyhedralFan#CONES_REPS |CONES_REPS]]'' in each orbit. ? Type: :''[[..:common#Array |Array]]<[[..:common#Array |Array]]<[[..:common#Int |Int]]%%>>%%'' ---- {{anchor:cones_reps:}} ? **''CONES_REPS''** :: List of all cones of all dimensions of the fan, one from each orbit. Indices refer to ''[[..:fan:PolyhedralFan#RAYS |RAYS]]''. ? Type: :''[[..:common#Array |Array]]<[[..:common#Array |Array]]<[[..:common#Set |Set]]<[[..:common#Int |Int]]%%>>%%>'' ---- {{anchor:group:}} ? **''GROUP''** :: ? Type: :''[[..:group:Group |Group]]'' ? Methods of GROUP: : ? **''REPRESENTATIVE_INPUT_CONES''** :: explicit representatives of equivalence classes of ''[[..:fan:PolyhedralFan#INPUT_CONES |INPUT_CONES]]'' under a group action ? **''REPRESENTATIVE_INPUT_RAYS''** :: explicit representatives of equivalence classes of ''[[..:fan:PolyhedralFan#INPUT_RAYS |INPUT_RAYS]]'' under a group action ? Properties of GROUP: : ? **''MATRIX_ACTION''** :: ? Type: :''[[..:group:MatrixActionOnVectors |MatrixActionOnVectors]]'' ? **''MAXIMAL_CONES_ACTION''** :: ? derived from: : ''[[..:group:PermutationAction |PermutationAction]]'' ? Type: :''[[..:group:PermutationAction |PermutationAction]]<[[..:common#Int |Int]],[[..:common#Rational |Rational]]>'' ? Properties of MAXIMAL_CONES_ACTION: : ? **''REPRESENTATIVE_COMBINATORIAL_DIMS''** :: dimensions of representatives of maximal cones ? Type: :''[[..:common#Array |Array]]<[[..:common#Int |Int]]>'' ? **''REPRESENTATIVE_F_VECTOR''** :: counts how many representatives of maximal cones there are in each dimension ? Type: :''[[..:common#Array |Array]]<[[..:common#Int |Int]]>'' ? **''REPRESENTATIVE_CONES''** :: ? Type: :''[[..:common#IncidenceMatrix |IncidenceMatrix]]<[[..:common#NonSymmetric |NonSymmetric]]>'' ? **''REPRESENTATIVE_MAXIMAL_CONES''** :: ? Type: :''[[..:common#IncidenceMatrix |IncidenceMatrix]]<[[..:common#NonSymmetric |NonSymmetric]]>'' ? **''REPRESENTATIVE_RAYS''** :: ? Type: :''[[..:common#Matrix |Matrix]]'' ---- {{anchor:maximal_cones_in_orbits:}} ? **''MAXIMAL_CONES_IN_ORBITS''** :: Tells which maximal cone is in the orbit of which representative, indices refers to rows of ''[[..:fan:PolyhedralFan#MAXIMAL_CONES |MAXIMAL_CONES]]''. ? Type: :''[[..:common#Array |Array]]<[[..:common#Set |Set]]<[[..:common#Int |Int]]%%>>%%'' ---- {{anchor:maximal_cones_orbit_sizes:}} ? **''MAXIMAL_CONES_ORBIT_SIZES''** :: Number of ''[[..:fan:PolyhedralFan#MAXIMAL_CONES_REPS |MAXIMAL_CONES_REPS]]'' in each orbit. ? Type: :''[[..:common#Array |Array]]<[[..:common#Int |Int]]>'' ---- {{anchor:maximal_cones_reps:}} ? **''MAXIMAL_CONES_REPS''** :: Non redundant list of maximal cones, one from each orbit. Indices refer to ''[[..:fan:PolyhedralFan#RAYS |RAYS]]''. ? Type: :''[[..:common#Array |Array]]<[[..:common#Set |Set]]<[[..:common#Int |Int]]%%>>%%'' ---- {{anchor:maximal_cones_reps_dims:}} ? **''MAXIMAL_CONES_REPS_DIMS''** :: The dimensions of ''[[..:fan:PolyhedralFan#MAXIMAL_CONES_REPS |MAXIMAL_CONES_REPS]]''. ? Type: :''[[..:common#Array |Array]]<[[..:common#Int |Int]]>'' ---- {{anchor:maximal_cones_reps_facets:}} ? **''MAXIMAL_CONES_REPS_FACETS''** :: Tells for each maximal cone representative what are its facets. A negative number means that the corresponding row of ''[[..:fan:PolyhedralFan#REPS_FACET_NORMALS |REPS_FACET_NORMALS]]'' has to be negated. ? Type: :''[[..:common#SparseMatrix |SparseMatrix]]<[[..:common#Int |Int]],[[..:common#NonSymmetric |NonSymmetric]]>'' ---- {{anchor:maximal_cones_reps_linear_span_normals:}} ? **''MAXIMAL_CONES_REPS_LINEAR_SPAN_NORMALS''** :: Tells for each maximal cone representative what is its linear span. Indices refer to ''[[..:fan:PolyhedralFan#REPS_LINEAR_SPAN_NORMALS |REPS_LINEAR_SPAN_NORMALS]]''. Rows correspond to ''[[..:fan:PolyhedralFan#MAXIMAL_CONES_REPS_FACETS |MAXIMAL_CONES_REPS_FACETS]]'' ? Type: :''[[..:common#IncidenceMatrix |IncidenceMatrix]]<[[..:common#NonSymmetric |NonSymmetric]]>'' ---- {{anchor:n_maximal_cone_orbits:}} ? **''N_MAXIMAL_CONE_ORBITS''** :: Number of orbits of ''[[..:fan:PolyhedralFan#MAXIMAL_CONES |MAXIMAL_CONES]]''. ? Type: :''[[..:common#Int |Int]]'' ---- {{anchor:n_ray_orbits:}} ? **''N_RAY_ORBITS''** :: Number of orbits of ''[[..:fan:PolyhedralFan#RAYS |RAYS]]''. ? Type: :''[[..:common#Int |Int]]'' ---- {{anchor:n_symmetries:}} ? **''N_SYMMETRIES''** :: Number of elements of the symmetry group. ? Type: :''[[..:common#Int |Int]]'' ---- {{anchor:orbits_f_vector:}} ? **''ORBITS_F_VECTOR''** :: fk is the number of k-dimensional cones up to symmetry. ? Type: :''[[..:common#Vector |Vector]]<[[..:common#Integer |Integer]]>'' ---- {{anchor:rays_images:}} ? **''RAYS_IMAGES''** :: Each row contains the image of all ''[[..:fan:PolyhedralFan#RAYS |RAYS]]'' under one element of the symmetry group. ? Type: :''[[..:common#Array |Array]]<[[..:common#Array |Array]]<[[..:common#Int |Int]]%%>>%%'' ---- {{anchor:rays_in_orbits:}} ? **''RAYS_IN_ORBITS''** :: Tells which ray is in the orbit of which representative, indices refers to rows of ''[[..:fan:PolyhedralFan#RAYS |RAYS]]''. ? Type: :''[[..:common#Array |Array]]<[[..:common#Set |Set]]<[[..:common#Int |Int]]%%>>%%'' ---- {{anchor:rays_orbit_sizes:}} ? **''RAYS_ORBIT_SIZES''** :: Number of elements of each orbit of ''[[..:fan:PolyhedralFan#RAYS |RAYS]]''. ? Type: :''[[..:common#Array |Array]]<[[..:common#Int |Int]]>'' ---- {{anchor:rays_reps:}} ? **''RAYS_REPS''** :: One ray from each orbit. Non-redundant. ? Type: :''[[..:common#Matrix |Matrix]]'' ---- {{anchor:rays_reps_labels:}} ? **''RAYS_REPS_LABELS''** :: Unique names assigned to the ''[[..:fan:PolyhedralFan#RAYS_REPS |RAYS_REPS]]''. ? Type: :''[[..:common#Array |Array]]<[[..:common#String |String]]>'' ---- {{anchor:reps_facet_normals:}} ? **''REPS_FACET_NORMALS''** :: The possible facet normals of all maximal cone representatives. ? Type: :''[[..:common#Matrix |Matrix]]'' ---- {{anchor:reps_linear_span_normals:}} ? **''REPS_LINEAR_SPAN_NORMALS''** :: The possible linear span normals of all maximal cone representatives. ? Type: :''[[..:common#Matrix |Matrix]]'' ---- {{anchor:symmetry_generators:}} ? **''SYMMETRY_GENERATORS''** :: 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. ? Type: :''[[..:common#Array |Array]]<[[..:common#Array |Array]]<[[..:common#Int |Int]]%%>>%%'' ---- {{anchor:symmetry_group:}} ? **''SYMMETRY_GROUP''** :: Each element of the array is an element of the symmetry group. ? Type: :''[[..:common#Array |Array]]<[[..:common#Array |Array]]<[[..:common#Int |Int]]%%>>%%'' ---- ==== Topology ==== The following properties are topological invariants. ---- {{anchor:homology:}} ? **''HOMOLOGY''** :: The homology of the intersection of the fan with the unit sphere. # @example When intersecting, the [[..:fan#normal_fan |normal fan]] of the 3-cube gives us a simplicial complex which is a topological 2-sphere: > print normal_fan(cube(3))->HOMOLOGY; | ({} 0) | ({} 0) | ({} 1) ? Type: :''[[..:common#Array |Array]]<[[..:topaz#HomologyGroup |HomologyGroup]]<[[..:common#Integer |Integer]]%%>>%%'' ---- {{anchor:intersection_complex:}} ? **''INTERSECTION_COMPLEX''** :: If the fan is ''[[..:fan:PolyhedralFan#SIMPLICIAL |SIMPLICIAL]]'' the simplicial complex obtained by intersecting the fan with the unit sphere. If the fan is not ''[[..:fan:PolyhedralFan#SIMPLICIAL |SIMPLICIAL]]'' the crosscut complex of the intersection. ? Type: :''[[..:topaz:SimplicialComplex |SimplicialComplex]]'' ? Example: :: When intersecting, the [[..:fan#normal_fan |normal fan]] of the 3-cube gives us a simplicial complex which is a topological 2-sphere: :: > $ic = normal_fan(cube(3))->INTERSECTION_COMPLEX; :: print $ic->SPHERE; ---- ==== Toric Varieties ==== Properties coming from associated toric varieties ---- {{anchor:gorenstein:}} ? **''GORENSTEIN''** :: A fan is __Gorenstein__ if it is ''[[..:fan:PolyhedralFan#Q_GORENSTEIN |Q_GORENSTEIN]]'' with ''[[..:fan:PolyhedralFan#Q_GORENSTEIN_INDEX |Q_GORENSTEIN_INDEX]]'' equal to one. ? Type: :''[[..:common#Bool |Bool]]'' ---- {{anchor:q_gorenstein:}} ? **''Q_GORENSTEIN''** :: A fan is __Q-GORENSTEIN__ if each maximal cone is [[..:polytope:Cone#Q_GORENSTEIN_CONE |Q_Gorenstein]]. ? Type: :''[[..:common#Bool |Bool]]'' ---- {{anchor:q_gorenstein_index:}} ? **''Q_GORENSTEIN_INDEX''** :: If a fan is ''[[..:fan:PolyhedralFan#Q_GORENSTEIN |Q_GORENSTEIN]]'', then its __Q-Gorenstein index__ is the least common multiple of the [[..:polytope:Cone#Q_GORENSTEIN_CONE_INDEX |Q-Gorenstein indices]] of its maximal cones. Otherwise Q_GORENSTEIN_INDEX is undefined. ? Type: :''[[..:common#Int |Int]]'' ---- {{anchor:smooth_fan:}} ? **''SMOOTH_FAN''** :: A fan is __smooth__ if all cones of the fan are [[..:polytope:Cone#SMOOTH_CONE |smooth]]. ? Type: :''[[..:common#Bool |Bool]]'' ---- ==== Visualization ==== These properties are for visualization. ---- {{anchor:input_ray_labels:}} ? **''INPUT_RAY_LABELS''** :: Unique names assigned to the ''[[..:fan:PolyhedralFan#INPUT_RAYS |INPUT_RAYS]]''. Similar to ''[[..:fan:PolyhedralFan#RAY_LABELS |RAY_LABELS]]'' for ''[[..:fan:PolyhedralFan#RAYS |RAYS]]''. ? Type: :''[[..:common#Array |Array]]<[[..:common#String |String]]>'' ---- {{anchor:maximal_cone_labels:}} ? **''MAXIMAL_CONE_LABELS''** :: Unique names assigned to the ''[[..:fan:PolyhedralFan#MAXIMAL_CONES |MAXIMAL_CONES]]''. Similar to ''[[..:fan:PolyhedralFan#RAY_LABELS |RAY_LABELS]]'' for ''[[..:fan:PolyhedralFan#RAYS |RAYS]]''. ? Type: :''[[..:common#Array |Array]]<[[..:common#String |String]]>'' ---- {{anchor:ray_labels:}} ? **''RAY_LABELS''** :: Unique names assigned to the ''[[..:fan:PolyhedralFan#RAYS |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. ? Type: :''[[..:common#Array |Array]]<[[..:common#String |String]]>'' ? Example: :: The [[..:fan#normal_fan |normal fan]] of the 2-cube has 4 rays; to assign the labels 'a', 'b' and 'any label' to the first three entries of ''[[..:fan:PolyhedralFan#RAYS |RAYS]]'', do this (note that the unspecified label of the last ray is blank when visualizing, and that, depending on your visualization settings, not the whole string of the third label might be displayed): :: > $f = normal_fan(cube(2)); > $f->RAY_LABELS=['a','b','any label']; ---- ===== Methods ===== ==== Combinatorics ==== These methods capture combinatorial information of the object. Combinatorial properties only depend on combinatorial data of the object like, e.g., the face lattice. ---- {{anchor:cones_dims:}} ? **''CONES_DIMS()''** :: The dimensions of the [[..:fan:PolyhedralFan#CONES |cones]]. ? Returns: :''[[..:common#Array |Array]]<[[..:common#Int |Int]]>'' ---- {{anchor:cone:}} ? **''cone([[..:common#Int |Int]] i)''** :: Returns the //i//-th [[..:fan:PolyhedralFan#MAXIMAL_CONES |maximal cone]]. ? Parameters: :: ''[[..:common#Int |Int]]'' ''i'' ? Returns: :''[[..:polytope:Cone |Cone]]'' ? Example: :: To obtain the cone generated by the x-, y- and z-axis, we can take the first cone of the [[..:fan#normal_fan |normal fan]] of the 3-cube: :: > $c = normal_fan(cube(3))->cone(0); > print $c->RAYS; 1 0 0 0 1 0 0 0 1 ---- ==== Geometry ==== These methods capture geometric information of the object. Geometric properties depend on geometric information of the object, like, e.g., vertices or facets. ---- {{anchor:ambient_dim:}} ? **''AMBIENT_DIM()''** :: Returns the dimension of the ambient space. ? Returns: :''[[..:common#Int |Int]]'' ? Example: :: The fan living in the plane containing only the cone which consists of the ray pointing in positive x-direction is by definition embedded in the plane: :: > $f = new PolyhedralFan(INPUT_RAYS=>[[1,0]],INPUT_CONES=>[[0]]); > print $f->AMBIENT_DIM; 2 ---- {{anchor:dim:}} ? **''DIM()''** :: Returns the dimension of the linear space spanned by the fan. ? Returns: :''[[..:common#Int |Int]]'' ? Example: :: The fan living in the plane containing only the cone which consists of the ray pointing in positive x-direction is 1-dimensional: :: > $f = new PolyhedralFan(INPUT_RAYS=>[[1,0]],INPUT_CONES=>[[0]]); > print $f->DIM; 1 ---- ==== Symmetry ==== These methods capture information of the object that is concerned with the action of permutation groups. ---- {{anchor:cone_representative:}} ? **''cone_representative([[..:common#Int |Int]] i)''** :: Returns the //i//-th maximal cone representative. ? Parameters: :: ''[[..:common#Int |Int]]'' ''i'' ? Returns: :''[[..:polytope:Cone |Cone]]'' ---- ==== Visualization ==== These methods are for visualization. ---- {{anchor:visual:}} ? **''VISUAL()''** :: Visualizes the fan, intersected with the unit ball. ? Options: : option list ''[[..:common#geometric_options_linear |geometric_options_linear]]'' ? Returns: :''[[..:fan:Visual_PolyhedralFan |Visual::PolyhedralFan]]'' ----