multidim.SimplicialComplex

class multidim.SimplicialComplex(stratum=None)[source]

A class for abstract weighted simplicial complexes. A SimplicialComplex is built from 0-cells (vertices), 1-cells (edges), 2-cells (faces), and so on.

Each cell knows its boundary. A 0-cell has no boundary. A 1-cell has two 0-cells as its boundary. A 2-cell has three 1-cells as its boundary, and so on.

Each cell must height value, called height. These heights are used in several topological algorithms that depend on filtering.

Each cell may have a mass value, called mass. These masses are used in some data-analysis methods that involve weighted averaging or probability.

Each cell can A SimplicialComplex has no notion of coordinates or embedding. For that, use the PointCloud class, which inherits all methods from SimplicialComplex but also adds coordinate-dependent methods.

Parameters:
stratum : dict

Dictionary of pandas.DataFrame objects holding vertices, edges, faces, and so on. See examples below.

Notes

One can reference the Simplex objects that are separated by dimension into SimplexStratum objects.

Each Simplex object has a height, so these are filtered simplicial complexes.

Each Simplex object may have a mass, so these can be are weighted simplicial complexes.

The rep and pos attributes are used when computing various homologies, such as the Rips or Cech complexes.

Whenever possible, computations are done on numpy.ndarray arrays in compiled code, so they are usually quite fast.

Examples

For example, a formal triangle could be built this way:

>>> vertices = pd.DataFrame({'height':[ 0.0, 0.0, 0.0],
...                          'mass': [1.0, 1.0, 1.0],
...                          'pos': [True, True, True],
...                          'rep' : [0, 1, 2]})
>>> edges = pd.DataFrame({'height':[ 0.0, 0.0, 0.0],
...                       'pos': [True, True, True],
...                       'rep' : [0, 1, 2],
...                       'bdy0': [0, 1, 2],
...                       'bdy1': [1, 2, 0]})
>>> faces = pd.DataFrame({'height': [0.0],
...                       'pos': [True],
...                       'rep': [0],
...                       'bdy0': [0],
...                       'bdy1': [1],
...                       'bdy2': [2]})
>>> T = SimplicialComplex(stratum = {0: vertices, 1: edges, 2: faces})
>>> print(T)
A SimplicialComplex with 3 points, 3 edges, and 1 faces.
SimplicialComplex.cells(dim) iterate over all Simplex objects of dimension dim.
SimplicialComplex.check() Run consistency checks on all simplices in all dimensions.
SimplicialComplex.from_distances(dists[, …]) Construct a SimplicialComplex from a symmetric matrix of distances.
SimplicialComplex.make_pers0([cutoff]) Run the UnionFind algorithm to mark connected components of the SimplicialComplex.
SimplicialComplex.make_pers1_rca1([cutoff]) Run RCA1 and make a 1-dimensional homology.PersDiag for the edge-pairings for cycle generators.
SimplicialComplex.reset() delete persistence diagrams, and forget all representative and positivity information.