The TOPology Application Zoo deals with abstract simplicial complexes. A complex is given as a list of facets. You can ask for its global properties (manifold recognition, homology groups, etc.), explore the local vertex environment (stars, links, etc.), and make a lot of constructions. The visualization means are constrained, as they are mostly based on the GRAPH
(1-skeleton) of a complex.
imports from:
uses:
GeometricSimplicialComplex
:
A geometric simplicial complex, i.e., a simplicial complex with a geometric realization. Scalar is the numeric data type used for the coordinates.
HyperbolicSurface
:
A hyperbolic surface (noncompact, finite area) is given by a triangulation DCEL_DATA
(the topological data) and PENNER_COORDINATES
(the metric data).
MorseMatching
:
A Morse matching is a reorientation of the arcs in the Hasse diagram of a simplicial complex such that at most one arc incident to each face is reoriented (matching condition) and the resulting orientation is acyclic (acyclicity condition). Morse matchings capture the main structure of discrete Morse functions, see
> Robin Forman: Morse Theory for Cell-Complexes,
> Advances in Math., 134 (1998), pp. 90-145. .. This property is computed by one of two heuristics. The default heuristic is a simple greedy algorithm ([[.:topaz:SimplicialComplex |greedy]]). The alternative is to use a canceling algorithm due to Forman ([[.:topaz:SimplicialComplex |cancel]]) or both ([[.:topaz:SimplicialComplex |both]]) together. Note that the computation of a Morse matching of largest size is NP-hard. See > Michael Joswig, Marc E. Pfetsch: Computing Optimal Morse Matchings > SIAM J. Discrete Math., 2006, to appear ** ''[[.:topaz:SimplicialComplex |SimplicialComplex]]'':\\ An abstract simplicial complex represented by its facets. ** ''[[.:topaz:Visual_SimplicialComplex |Visual::SimplicialComplex]]'':\\ Visualization of the simplicial complex. ** ''[[.:topaz:Visual_SimplicialComplexLattice |Visual::SimplicialComplexLattice]]'':\\ Visualization of the ''[[.:topaz:SimplicialComplex#HASSE_DIAGRAM |HASSE_DIAGRAM]]'' of a simplicial complex as a multi-layer graph.
Combinatorial functions.
n_poset_homomorphisms(Graph<Directed> P, Graph<Directed> Q)
Count all order preserving maps from one poset to another. They are in fact enumerated, but only the count is kept track of using constant memory.
These functions compare two SimplicialComplex
find_facet_vertex_permutations(SimplicialComplex complex1, SimplicialComplex complex2)
Find the permutations of facets and vertices which maps the first complex to the second one. The facet permutation is the first component of the return value.
SimplicialComplex
complex1
SimplicialComplex
complex2
isomorphic(SimplicialComplex complex1, SimplicialComplex complex2)
Determine whether two given complexes are combinatorially isomorphic. The problem is reduced to graph isomorphism of the vertex-facet incidence graphs.
SimplicialComplex
complex1
SimplicialComplex
complex2
pl_homeomorphic(SimplicialComplex complex1, SimplicialComplex complex2)
Tries to determine whether two complexes are pl-homeomorphic by using bistellar flips and a simulated annealing strategy. You may specify the maximal number of rounds, how often the system may relax before heating up and how much heat should be applied. The function stops computing, once the size of the triangulation has not decreased for rounds iterations. If the abs flag is set, the function stops after rounds iterations regardless of when the last improvement took place. Additionally, you may set the threshold min_n_facets for the number of facets when the simplification ought to stop. Default is d+2 in the CLOSED_PSEUDO_MANIFOLD
case and 1 otherwise. If you want to influence the distribution of the dimension of the moves when warming up you may do so by specifying a distribution. The number of values in distribution determines the dimensions used for heating up. The heating and relaxing parameters decrease dynamically unless the constant flag is set. The function prohibits to execute the reversed move of a move directly after the move itself unless the allow_rev_move flag is set. Setting the allow_rev_move flag might help solve a particular resilient problem. If you are interested in how the process is coming along, try the verbose option. It specifies after how many rounds the current best result is displayed. The obj determines the objective function used for the optimization. If obj is set to 0, the function searches for the triangulation with the lexicographically smallest f-vector, if obj is set to 1, the function searches for the triangulation with the reversed-lexicographically smallest f-vector and if obj is set to 2 the sum of the f-vector entries is used. The default is 1.
These functions construct a new SimplicialComplex
from other objects of the same type.
alexander_dual(SimplicialComplex complex)
Computes the Alexander dual complex, that is, the complements of all non-faces. The vertex labels are preserved unless the no_labels flag is specified.
SimplicialComplex
complex
Bool
no_labels
: Do not create VERTEX_LABELS
. default: 0
barycentric_subdivision(SimplicialComplex complex)
Computes the barycentric subdivision of complex.
SimplicialComplex
complex
String
pin_hasse_section
: default: HASSE_DIAGRAM
String
label_section
: default: VERTEX_LABELS
String
coord_section
: default: VERTICES
Bool
geometric_realization
: set to 1 to obtain a GeometricSimplicialComplex
, default: 0
To subdivide a triangle into six new triangles, do this:
> $b = barycentric_subdivision(simplex(2));
bistellar_simplification(SimplicialComplex complex)
Heuristic for simplifying the triangulation of the given manifold without changing its PL-type. The function uses bistellar flips and a simulated annealing strategy. You may specify the maximal number of rounds, how often the system may relax before heating up and how much heat should be applied. The function stops computing, once the size of the triangulation has not decreased for rounds iterations. If the abs flag is set, the function stops after rounds iterations regardless of when the last improvement took place. Additionally, you may set the threshold min_n_facets for the number of facets when the simplification ought to stop. Default is d+2 in the CLOSED_PSEUDO_MANIFOLD
case and 1 otherwise. If you want to influence the distribution of the dimension of the moves when warming up you may do so by specifying a distribution. The number of values in distribution determines the dimensions used for heating up. The heating and relaxing parameters decrease dynamically unless the constant flag is set. The function prohibits to execute the reversed move of a move directly after the move itself unless the allow_rev_move flag is set. Setting the allow_rev_move flag might help solve a particular resilient problem. If you are interested in how the process is coming along, try the verbose option. It specifies after how many rounds the current best result is displayed. The obj determines the objective function used for the optimization. If obj is set to 0, the function searches for the triangulation with the lexicographically smallest f-vector, if obj is set to any other value the sum of the f-vector entries is used. The default is 1.
bs2quotient(Polytope P, SimplicialComplex complex)
Create a simplicial complex from a simplicial subdivision of a given complex by identifying vertices on the boundary of the original complex according to a group that acts on vertices.
Polytope
P
: the underlying polytope
SimplicialComplex
complex
: a sufficiently fine subdivision of P, for example the second barycentric subdivision
colored_ball_from_colored_sphere(SimplicialComplex complex)
Extends the triangulation and coloring of a k-colored (d-1)-sphere to a max{k,d+1}-colored triangulation of a d-ball. The colors are integer numbers. The old vertex labels are preserved unless the no_labels flag is specified. The new vertices get labeled new_i
(i=0, 1, 2, …). If a new label is not unique, _j
is added for the smallest integer j which makes the label unique.
SimplicialComplex
complex
Bool
no_lables
cone(SimplicialComplex complex, Int k)
Produce the k-cone over a given simplicial complex.
SimplicialComplex
complex
Int
k
: default is 1
Bool
no_labels
: Do not create VERTEX_LABELS
. default: 0
The following creates the cone with two apices over the triangle, with custom apex labels. The resulting complex is the 4-simplex.
> $c = cone(simplex(2),2,apex_labels=>['foo','bar']); > print $c->FACETS; {0 1 2 3 4}
> print $c->VERTEX_LABELS; 0 1 2 foo bar
connected_sum(SimplicialComplex complex1, SimplicialComplex complex2, Int f1, Int f2)
Compute the connected sum of two complexes. Parameters f_1 and f_2 specify which facet of the first and second complex correspondingly are glued together. Default is the 0-th facet of both. The vertices in the selected facets are identified with each other according to their order in the facet (that is, in icreasing index order). The glueing facet iteself is not included in the connected sum. The option permutation allows to get an alternative identification. It should specify a permutation of the vertices of the second facet. The vertices of the new complex get the original labels with _1
or _2
appended, according to the input complex they came from. If you set the no_labels flag, the label generation will be omitted.
SimplicialComplex
complex1
SimplicialComplex
complex2
Int
f1
: default: 0
Int
f2
: default: 0
Bool
no_labels
Glueing together two tori to make a genus 2 double torus, rotating the second one clockwise:
> $cs = connected_sum(torus(),torus(),permutation=>[1,2,0]); > print $cs->SURFACE.','.$cs->GENUS; 1,2
covering_relations(Graph<Directed> P)
Construct the covering relations of a poset
deletion(SimplicialComplex complex, Set<Int> face)
Remove the given face and all the faces containing it.
SimplicialComplex
complex
Set<Int>
face
: specified by vertex indices. Please use labeled_vertices
if you want to specify the face by vertex labels.
Bool
no_labels
: Do not create VERTEX_LABELS
. default: 0
disjoint_union(SimplicialComplex complex1, SimplicialComplex complex2)
Produce the disjoint union of the two given complexes.
SimplicialComplex
complex1
SimplicialComplex
complex2
Bool
no_labels
: Do not create VERTEX_LABELS
. default: 0 The vertex labels are built from the original labels with a suffix _1
or _2
appended.
edge_contraction(SimplicialComplex complex)
Heuristic for simplifying the triangulation of the given manifold without changing its PL-type. Choosing a random order of the vertices, the function tries to contract all incident edges.
SimplicialComplex
complex
Int
seed
foldable_prism(GeometricSimplicialComplex complex)
Produce a prism over a given SimplicialComplex
.
GeometricSimplicialComplex
complex
Bool
geometric_realization
h_induced_quotient(SimplicialComplex C, Set<Int> vertices)
Let C be the given simplicial and A the subcomplex induced by the given vertices. Then this function produces a simplicial complex homotopy equivalent to C mod A by adding the cone over A with apex a to C. The label of the apex my be specified via the option apex.
Bool
no_labels
: Do not create VERTEX_LABELS
. default: 0
String
apex
hom_poset(Graph<Directed> P, Graph<Directed> Q)
Construct the poset of order preserving maps from one poset to another
hom_poset(Array<Array<Int>> homs, Graph<Directed> Q)
Construct the poset of order preserving maps from one poset to another
induced_subcomplex(SimplicialComplex complex, Set<Int> vertices)
Produce the subcomplex consisting of all faces which are contained in the given set of vertices.
SimplicialComplex
complex
Bool
no_labels
: Do not create VERTEX_LABELS
. default: 0
Bool
geom_real
: tells the client to inherit the COORDINATES
.
iterated_barycentric_subdivision(SimplicialComplex complex, Int k)
Computes the k-th barycentric subdivision of complex by iteratively calling barycentric_subdivision
.
SimplicialComplex
complex
Int
k
String
pin_hasse_section
: default: HASSE_DIAGRAM
String
label_section
: default: VERTEX_LABELS
String
coord_section
: default: VERTICES
Bool
geometric_realization
: set to 1 to obtain a GeometricSimplicialComplex
, default: 0
join_complexes(SimplicialComplex complex1, SimplicialComplex complex2)
Creates the join of complex1 and complex2.
SimplicialComplex
complex1
SimplicialComplex
complex2
Bool
no_labels
: Do not create VERTEX_LABELS
. default: 0 The vertex labels are built from the original labels with a suffix _1
or _2
appended.
k_skeleton(SimplicialComplex complex, Int k)
Produce the k-skeleton.
SimplicialComplex
complex
Int
k
Bool
no_labels
: Do not create VERTEX_LABELS
. default: 0
k_skeleton(GeometricSimplicialComplex complex, Int k)
Produce the k-skeleton.
GeometricSimplicialComplex
complex
Int
k
Bool
no_labels
: Do not create VERTEX_LABELS
. default: 0
link_complex(SimplicialComplex complex, Set<Int> face)
Produce the link of a face of the complex
SimplicialComplex
complex
Bool
no_labels
: Do not create VERTEX_LABELS
. default: 0
poset_homomorphisms(Graph<Directed> P, Graph<Directed> Q)
Enumerate all order preserving maps from one poset to another
simplicial_product(SimplicialComplex complex1, SimplicialComplex complex2)
Computes the simplicial product of two complexes. Vertex orderings may be given as options.
SimplicialComplex
complex1
SimplicialComplex
complex2
Bool
geometric_realization
: default 0
Bool
color_cons
Bool
no_labels
: Do not create VERTEX_LABELS
. default: 0
simplicial_product<Scalar>(GeometricSimplicialComplex complex1, GeometricSimplicialComplex complex2)
Computes the simplicial product of two complexes. Vertex orderings may be given as options.
Scalar
GeometricSimplicialComplex
complex1
GeometricSimplicialComplex
complex2
Bool
geometric_realization
: default 1
Bool
color_cons
Bool
no_labels
: Do not create VERTEX_LABELS
. default: 0
GeometricSimplicialComplex<Scalar>
star(SimplicialComplex complex, Set<Int> face)
Produce the star of the face of the complex.
SimplicialComplex
complex
Bool
no_labels
: Do not create VERTEX_LABELS
. default: 0
star_deletion(SimplicialComplex complex, Set<Int> face)
Remove the star of a given face.
SimplicialComplex
complex
Set<Int>
face
: specified by vertex indices. Please use labeled_vertices
if you want to specify the face by vertex labels.
Bool
no_labels
: Do not create VERTEX_LABELS
. default: 0
stellar_subdivision(SimplicialComplex complex, Array<Set<Int>> faces)
Computes the complex obtained by stellar subdivision of the given faces of the complex.
SimplicialComplex
complex
Bool
no_labels
: Do not create VERTEX_LABELS
. default: 0
Bool
geometric_realization
: default 0
stellar_subdivision(SimplicialComplex complex, Set<Int> face)
Computes the complex obtained by stellar subdivision of the given face of the complex.
SimplicialComplex
complex
Bool
no_labels
: Do not create VERTEX_LABELS
. default: 0
Bool
geometric_realization
: default 0
sum_triangulation(GeometricSimplicialComplex P, GeometricSimplicialComplex Q, IncidenceMatrix WebOfStars)
Produce a specific sum-triangulation of two given triangulations. and a WebOfStars. There are P-sum-triangulations and Q-sum-triangulations. If the image of the star of the origin of P is empty then we have a Q-sum-triangulation; otherwise it is a P-sum-triangulation. For details see Assarf, Joswig & Pfeifle: Webs of stars or how to triangulate sums of polytopes, to appear
GeometricSimplicialComplex
P
: first complex
GeometricSimplicialComplex
Q
: second complex
IncidenceMatrix
WebOfStars
: Every row corresponds to a full dimensional simplex in P and every column to a full dimensional simplex in Q.
Bool
origin_first
: decides if the origin should be the first point in the resulting complex. Default=0
suspension(SimplicialComplex complex, Int k)
Produce the k-suspension over a given simplicial complex.
SimplicialComplex
complex
Int
k
: default value is 1
Bool
no_labels
: Do not create VERTEX_LABELS
. default: 0
triang_neighborhood(SimplicialComplex complex, Rational width)
Create a triangulated tubular neighborhood of a pure 2-complex. If the complex is a link with the property that each vertex and its two neighbours are in general position after projection to the x,y-plane, then one might specify a rational number width to tell the client to compute COORDINATES
of the triangulated tubular neighborhood. If the width/ is chosen too large, the computed realization will be self intersecting. If each connected component of the link has an even number of facets, then the following holds: An edge of the resulting complex is contained in an odd number of facets iff it corresponds to one of the edges of the link.
SimplicialComplex
complex
Rational
width
: default: 0
union(SimplicialComplex complex1, SimplicialComplex complex2)
Produce the union of the two given complexes, identifying vertices with equal labels.
SimplicialComplex
complex1
SimplicialComplex
complex2
Bool
no_labels
: Do not create VERTEX_LABELS
. default: 0
web_of_stars(Array<Int> poset_hom, Array<Set<Set<Int>>> star_shaped_balls, Array<Set<Int>> triang)
Produce a web of stars from two given triangulations and a map between them.
These functions construct a new SimplicialComplex
from other objects.
clique_complex(Graph graph)
Produce the clique complex of a given graph, that is, the simplicial complex that has an n-dimensional facet for each n+1-clique. If no_labels is set to 1, the labels are not copied.
Graph
graph
Bool
no_labels
: Do not create VERTEX_LABELS
. default: 0
Create the clique complex of a simple graph with one 3-clique and one 2-clique, not creating labels.
> $g = graph_from_edges([[0,1],[0,2],[1,2],[2,3]]); > $c = clique_complex($g,no_labels=>1); > print $c->FACETS; {0 1 2} {2 3}
independence_complex(Matroid matroid)
Produce the independence complex of a given matroid. If no_labels is set to 1, the labels are not copied.
Matroid
matroid
Bool
no_labels
: Do not create VERTEX_LABELS
. default: 0
vietoris_rips_complex(Matrix D, Rational delta)
Computes the Vietoris Rips complex of a point set. The set is passed as its so-called “distance matrix”, whose (i,j)-entry is the distance between point i and j. This matrix can e.g. be computed using the distance_matrix function. The points corresponding to vertices of a common simplex will all have a distance less than delta from each other.
With these clients you can create special examples of simplicial complexes and complexes belonging to parameterized families.
ball(Int d)
A d-dimensional ball, realized as the d-simplex.
complex_projective_plane()
The complex projective plane with the vertex-minimal triangulation by Kühnel and Brehm.
Construct the complex projective plane, store it in the variable $p2c, and print its homology group.
> $p2c = complex_projective_plane(); > print $p2c->HOMOLOGY; ({} 0) ({} 0) ({} 1) ({} 0) ({} 1)
cube_complex(Array<Int> x)
Produces a triangulated pile of hypercubes, arranged in a d-dimensional array. Each cube is split into d! tetrahedra, and the tetrahedra are all grouped around one of the diagonal axes of the cube.
Arrange four triangulated 3-cubes to form a big 2 by 2 cube:
> $cc = cube_complex([2,2,2]); > print $cc->description; 2x2x2 Pile of 3-dimensional triangulated cubes.
klein_bottle()
The Klein bottle.
multi_associahedron_sphere(Int n, Int k)
Produce the simplicial sphere Δ(n,k) of (k+1)-crossing free multitriangulations of an n-gon P, along with the group action on the diagonals induced from D_{2n}. Δ(n,k) is the simplicial complex on the set of relevant diagonals of P whose faces are those sets of diagonals such that no k+1 of them mutually cross. A diagonal is relevant if it leaves k or more vertices of P on both sides. (Any diagonal having less than k vertices on one side trivially cannot participate in a (k+1)-crossing, so is irrelevant. The corresponding complex on all diagonals is therefore the simplicial join of this one with the simplex of irrelevant diagonals.)
> Jakob Jonsson, “Generalized triangulations and diagonal-free subsets of stack polyominoes”,
> J. Combin. Theory Ser. A, 112(1):117–142, 2005 .. //Δ(n,k)// is known to be a //k//-neighborly vertex-decomposable sphere of dimension //k//ν-1, where the parameter ν=//n//-2//k//-1 measures the complexity of this construction. For ν=0, the complex is a point; for ν=1 a //k//-simplex; for ν=2 the boundary of a cyclic polytope. Setting //k//=1 yields the boundary of the simplicial associahedron. The list of (//k//+1)-crossings in the //n//-gon is included as the attachment K_PLUS_1_CROSSINGS. It can also be obtained as the property MINIMAL_NON_FACES, but this requires the HASSE_DIAGRAM to be computed. ? Parameters: :: ''[[.:common#Int |Int]]'' ''n'': the number of vertices of the polygon :: ''[[.:common#Int |Int]]'' ''k'': the number of diagonals that are allowed to mutually cross ? Options: : :: ''[[.:common#Bool |Bool]]'' ''no_facets'': don't calculate the facets (for large examples)? Default 0 :: ''[[.:common#Bool |Bool]]'' ''no_crossings'': don't calculate the crossings? Default 0 ? Returns: :''[[.:topaz:SimplicialComplex |SimplicialComplex]]'' ? Example: :: The f-vector of Δ(9,3) is that of a neighborly polytope, since ν=2: :: <code perl> > print multi_associahedron_sphere(9,3)->F_VECTOR;
9 36 84 117 90 30 </code>
The option no_facets⇒1 still leaves useful information:
> $s = multi_associahedron_sphere(8,2, no_facets=>1); > print $s->VERTEX_LABELS; (0 3) (1 4) (2 5) (3 6) (4 7) (0 5) (1 6) (2 7) (0 4) (1 5) (2 6) (3 7)
> print $s->GROUP->PERMUTATION_ACTION->GENERATORS; 7 0 1 2 3 4 5 6 11 8 9 10 4 3 2 1 0 7 6 5 11 10 9 8
> print $s->get_attachment("K_PLUS_1_CROSSINGS")->size(); 28
rand_knot(Int n_edges)
Produce a random knot (or link) as a polygonal closed curve in 3-space. The knot (or each connected component of the link) has n_edges edges. The vertices are uniformly distributed in [-1,1]3, unless the on_sphere option is set. In the latter case the vertices are uniformly distributed on the 3-sphere. Alternatively the brownian option produces a knot by connecting the ends of a simulated brownian motion.
real_projective_plane()
The real projective plane with its unique minimal triangulation on six vertices.
sphere(Int d)
The d-dimensional sphere, realized as the boundary of the (d+1)-simplex.
Int
d
: dimension
surface(Int g)
Produce a surface of genus g. For g >= 0 the client produces an orientable surface, otherwise it produces a non-orientable one.
Int
g
: genus
torus()
The Császár Torus. Geometric realization by Frank Lutz, Electronic Geometry Model No. 2001.02.069
unknot(Int m, Int n)
Produces a triangulated 3-sphere with the particularly NASTY embedding of the unknot in its 1-skeleton. The parameters m >= 2 and n >= 1 determine how entangled the unknot is. eps determines the COORDINATES
.
Functions producing big objects which are not contained in application topaz.
secondary_polyhedron(HyperbolicSurface s, Int depth)
Computes the secondary polyhedron of a hyperbolic surface up to a given depth of the spanning tree of the covering triangluation of the hypoerbolic plane.
Int
depth
The following functions compute topological invariants.
betti_numbers<Coeff>(ChainComplex C)
Calculate the betti numbers of a general chain complex over a field.
Coeff
: The coefficient field type for homology computation. Defaults to Rational
The following constructs a simple chain complex with only one non-empty differential:
> $cc = new ChainComplex(new Array<SparseMatrix<Integer>>([[[2,0]]]));
You can print its betti numbers like this:
> print betti_numbers($cc); 1 0
betti_numbers<Coeff>(SimplicialComplex S)
Calculate the reduced betti numbers of a simplicial complex over a field.
Coeff
: The coefficient field type for homology computation. Defaults to Rational
To print the betti numbers for the torus, do this:
> $t = torus(); > print betti_numbers($t); 0 2 1
cap_product(CycleGroup<E> cocycles, CycleGroup<E> cycles)
Compute all cap products of cohomology and homology cycles in two given groups.
CycleGroup<E>
cocycles
CycleGroup<E>
cycles
The following stores all cap products of the cocycles and cycles of the homology group of the oriented surface of genus 1 in the variable $cp.
> $s = surface(1); > $cp = cap_product($s->COCYCLES->[1],$s->CYCLES->[1]);
homology(Array<Set<Int>> complex, Bool co)
Calculate the reduced (co-)homology groups of a simplicial complex.
homology(ChainComplex CC, Bool co)
Calculate the (co-)homology groups of a chain complex.
ChainComplex
CC
: The chain complex for which to compute homology.
Bool
co
: set to true for cohomology
Int
dim_low
: narrows the dimension range of interest, with negative values being treated as co-dimensions
Int
dim_high
: see dim_low
To construct a small chain complex with only one non-zero differential:
> $cc = new ChainComplex(new Array<SparseMatrix<Integer>>([[[2,0]]]));
This prints its homology groups.
> print homology($cc,0); ({(2 1)} 1) ({} 0)
The output means that the zeroth homology group has 2-torsion with multiplicity one, and betti number one. The first homology group is empty.
homology_and_cycles(Array<Set<Int>> complex, Bool co)
Calculate the reduced (co-)homology groups and cycle representatives of a simplicial complex.
homology_and_cycles(ChainComplex<SparseMatrix<Integer>> CC, Bool co)
Calculate the (co-)homology groups and cycle coefficient matrices of a chain complex.
ChainComplex<SparseMatrix<Integer>>
CC
: The chain complex for which to compute homology.
Bool
co
: set to true for cohomology
Int
dim_low
: narrows the dimension range of interest, with negative values being treated as co-dimensions
Int
dim_high
: see dim_low
To construct a small chain complex with only one non-zero differential:
> $cc = new ChainComplex(new Array<SparseMatrix<Integer>>([[[2,0]]]));
This prints its homology groups and corresponding generators.
> print homology_and_cycles($cc,0); (({(2 1)} 1) <1 0 0 1 > ) (({} 0) <> )
The output means that the zeroth homology group has 2-torsion with multiplicity one generated by the first elemen of the chain group, and free part of rank one generated by the second element. The first homology group is empty.
Special purpose functions.
dualOutitudes(Array<Array<Int>> dcel_data)
Given a triangulation of a punctured surface this calculates all the outitude polynomials of the dual structure. The first e = {oriented edges} monomials correspond to A-coordinates of the oriented edges of the primal structure , labeled as in the input. The last t = {triangles} monomials correspond to A-coordinates of the triangles of the primal structure.
is_generalized_shelling(Array<Set> FaceList)
Check if a given sequence of faces of a simplicial complex is a generalized shelling.
Bool
verbose
is_vertex_decomposition(SimplicialComplex complex, Array<Int> vertices)
Check whether a given ordered subset of the vertex set is a vertex decomposition. Works for 1-, 2- and 3-manifolds only!
SimplicialComplex
complex
Bool
verbose
mixed_graph(SimplicialComplex complex)
Produces the mixed graph of a complex.
SimplicialComplex
complex
Float
edge_weight
outitudes(Array<Array<Int>> dcel_data)
Given a triangulation of a punctured surface this calculates all the outitude polynomials. The first e = {oriented edges} monomials correspond to A-coordinates of the oriented edges, labeled as in the input. The last t = {triangles} monomials correspond to A-coordinates of the triangles.
We may calculate the outitude polynomials of a once punctured torus by typing:
> $T1 = new Array<Array<Int>>([[0,0,2,3],[0,0,4,5],[0,0,0,1]]); > print outitudes($T1); - x_0*x_1*x_6 - x_0*x_1*x_7 + x_0*x_2*x_7 + x_0*x_4*x_6 + x_1*x_3*x_6 + x_1*x_5*x_7 x_0*x_2*x_6 + x_1*x_3*x_7 - x_2*x_3*x_6 - x_2*x_3*x_7 + x_2*x_4*x_7 + x_3*x_5*x_6 x_0*x_4*x_7 + x_1*x_5*x_6 + x_2*x_4*x_6 + x_3*x_5*x_7 - x_4*x_5*x_6 - x_4*x_5*x_7
outitudes(String surface)
Given a punctured surface by a string from the list below, this calculates all the outitude polynomials. Choose among: S3, S4 (ipunctured spheres) and T1, T2, T3 (punctured tori) and D1 (punctured double torus). A triangulation of the surface will be chosen for you. The first e = {oriented edges} monomials correspond to A-coordinates of the oriented edges. The last t = {triangles} monomials correspond to A-coordinates of the triangles.
String
surface
: the surface name.
persistent_homology(Filtration<Matrix<Scalar>> F, Int i, Int p, Int k)
Given a Filtration and three indices i,p and k, this computes the p-persistent k-th homology group of the i-th frame of the filtration for coefficients from any PID. Returns a basis for the free part and a list of torsion coefficients with bases.
Filtration<Matrix<Scalar>>
F
Int
i
: the filtration frame
Int
p
: the number of frames to consider
Int
k
: the dimension in which to compute
Pair<SparseMatrix<Scalar>,List<Pair<Scalar,SparseMatrix<Scalar>>>>
persistent_homology(Filtration F)
Given a Filtration, this computes its persistence barcodes in all dimension, using the algorithm described in the 2005 paper 'Computing Persistent Homology' by Afra Zomorodian and Gunnar Carlsson. It only works for field coefficients.
poset_by_inclusion(Array<T> P)
Construct the inclusion poset from a given container. The elements of the container are interpreted as sets. They define a poset by inclusion. The function returns this poset encoded as a directed graph. The direction is towards to larger sets. All relations are encoded, not only the covering relations. For details see Assarf, Joswig & Pfeifle: Webs of stars or how to triangulate sums of polytopes, to appear
Array<T>
P
random_discrete_morse(SimplicialComplex complex)
Implementation of random discrete Morse algorithms by Lutz and Benedetti Returns a map of the number of occurrences of different reduction results indexed by the corresponding discrete Morse vectors (containing the number of critical cells per dimension)
SimplicialComplex
complex
Int
rounds
: Run for r rounds
Int
seed
: Set seed number for random number generator
Int
strategy
: Set strategy⇒0 (default) for random-random: uniformly random selecting of a face to collapse or as critical face Set strategy⇒1 for random-lex-first: uniformly random relabeling of vertices, then selecting lexicographically first face for collapse or as a critical face Set strategy⇒2 for random-lex-last: uniformly random relabeling of vertices, then selecting lexicographically last face for collapse or as a critical face
Int
verbose
: v Prints message after running every v rounds
String
save_collapsed
: Save all facets that remain after initial collapse to an XML file of a Simplicial Complex. Rounds that have Morse vector [1,0,…,0] or [1,0,…,0,1] will save nothing. Filename must have quotation marks: save_collapsed⇒“path/to/filename”. The XML files are saved as “path/to/filename_currentround.top”.
stabbing_order(GeometricSimplicialComplex P)
Determine the stabbing partial order of a simplicial ball with respect to the origin. The origin may be a vertex or not. For details see Assarf, Joswig & Pfeifle: Webs of stars or how to triangulate sums of polytopes, to appear
stanley_reisner(SimplicialComplex complex)
Creates the Stanley-Reisner ideal of a simplicial complex.
SimplicialComplex
complex
star_of_zero(GeometricSimplicialComplex C)
Find the facets of the star of the origin in the simplicial complex. The origin may be a vertex or not. For details see Assarf, Joswig & Pfeifle: Webs of stars or how to triangulate sums of polytopes, to appear
star_shaped_balls(GeometricSimplicialComplex P)
Enumerate all balls formed by the simplices of a geometric simplicial complex that are strictly star-shaped with respect to the origin. The origin may be a vertex or not. For details see Assarf, Joswig & Pfeifle: Webs of stars or how to triangulate sums of polytopes, to appear
stiefel_whitney(Array<Set<Int>> facets)
Computes Stiefel-Whitney classes of mod 2 Euler space (in particular, closed manifold). Use option verbose to show regular pairs and cycles. A narrower dimension range of interest can be specified. Negative values are treated as co-dimension - 1
vietoris_rips_filtration<Coeff>(Matrix D, Array<Int> deg, Float step_size, Int k)
Constructs the k-skeleton of the Vietrois Rips filtration of a point set. The set is passed as its so-called “distance matrix”, whose (i,j)-entry is the distance between point i and j. This matrix can e.g. be computed using the distance_matrix function. The other inputs are an integer array containing the degree of each point, the desired distance step size between frames, and the dimension up to which to compute the skeleton. Redundant points will appear as seperate vertices of the complex. Setting k to |S| will compute the entire VR-Complex for each frame.
Coeff
: desired coefficient type of the filtration
Matrix
D
: the “distance matrix” of the point set (can be upper triangular)
Float
step_size
Int
k
: dimension of the resulting filtration
Filtration<SparseMatrix<Coeff,NonSymmetric>>
The following property_types are topological invariants.
Cell
ChainComplex<MatrixType>
A finite chain complex, represented as its boundary matrices. Check out the tutorial on the polymake homepage for examples on constructing ChainComplexes and computing their homology.
MatrixType
: The type of the differential matrices. default: SparseMatrix<Integer>
You can create a new ChainComplex by passing the Array of differential matrices (as maps via _left_ multiplication):
> $cc = new ChainComplex(new Array<SparseMatrix<Integer>>([[[2,0]]]));
Note that this creates a ChainComplex consisting three differential matrices – the trivial zeroth and last ones are omitted in the constructor. You can look at the boundary matrices:
> print $cc->boundary_matrix(1); 2 0
The functions homology
, homology_and_cycles
and betti_numbers
can be used to analyse your complex.
> print homology($cc,0); ({(2 1)} 1) ({} 0)
CycleGroup<Scalar>
A group is encoded as a pair of an integer matrix and a vector of faces. The elements of the group can be obtained by symbolic multiplication of both.
Scalar
: integer type of matrix elements
coeff()
the integer matrix
SparseMatrix<Scalar>
faces()
the faces
Filtration<MatrixType>
A filtration of chain complexes.
MatrixType
boundary_matrix(Int d, Int t)
Returns the d-boundary matrix of the t-th frame of the filtration.
cells()
Returns the cells of the filtration, given as array of 3-tuples containing degree, dimension and boundary matrix row number of the cell.
dim()
Returns the dimension of the maximal cells in the last frame of the filtration.
n_cells()
Returns the number of cells in the last frame of the filtration.
n_frames()
Returns the number of frames in of the filtration.
HomologyGroup<Scalar>
A group is encoded as a sequence ( { (t1 m1) … (tn mn) } f) of non-negative integers, with t1 > t2 > … > tn > 1, plus an extra non-negative integer f. The group is isomorphic to (Z/t1)m1 × … × (Z/tn)mn × Zf, where Z0 is the trivial group.
Scalar
: integer type of torsion coefficients
betti_number()
the number f
torsion()
list of Z-groups
IntersectionForm
Parity and signature of the intersection form of a closed oriented 4k-manifold. See INTERSECTION_FORM
.