StaticPersistence class

class StaticPersistence

Initializes StaticPersistence with the given Filtration. This operation effectively computes the boundary matrix of the complex captured by the filtration with rows and columns sorted with respect to the filtration ordering.


Pairs simplices using the [ELZ02] algorithm. store_negative indicates whether to store the negative simplices in the cycles.


Given an SPNode in the internal representation, the method returns its integer offset from the beginning of the filtration. This is useful to lookup the actual name of the simplex in the complex.


Creates an auxilliary PersistenceSimplexMap used to lookup the actual simplices from the persistence indices. For example, the following snippet prints out all the unpaired simplices:

smap = persistence.make_simplex_map(filtration)
for i in persistence:
    if i.unpaired(): print smap[i]

Iterator over the nodes (representing individual simplices). See SPNode.


Returns the number of nodes (i.e. the number of simplices).

class SPNode

The class represents nodes stored in StaticPersistence. These nodes are aware of their sign() and pair (and cycle() if negative after StaticPersistence.pair_simplices() has run).


Returns the sign of the simplex: True for positive, False for negative.


Simplex’s pair. The pair is set to self if the siplex is unpaired.


If the simplex is negative, its cycle (that it kills) is non-empty, and can be accessed using this method. The cycle itself is an iterable container of SPNode. For example, one can print the basis for the (bounding) cycles:

smap = persistence.make_simplex_map(filtration)
for i in persistence:
    for ii in i.cycle: print smap[ii]

Indicates whether the simplex is unpaired.

class SPersistenceSimplexMap

Given a persistence index, i.e. an SPNode, returns the Simplex it represents.

DynamicPersistenceChains class

class DynamicPersistenceChains

This class works exactly like StaticPersistence, providing all the same methods. The only difference is that when iterating over it, the elements are of type DPCNode, described below.

class DPCNode

This class works just like SPNode, except it has an additional attribute chain.


It allows one to retrieve the “chain” associated with the simplex. (In terms of the R = DV decomposition, it gives access to the columns of the matrix V.) In case of the positive simplex, this is a cycle created by the addition of this simplex. This access is particularly useful for the unpaired positive simplices, allowing one to recover the cycles they create. In case of the negative simplex, this chain’s boundary is exactly what’s stored in the cycle attribute.

For example, to print out all the essential cycles of the complex, one can run the following loop:

smap = persistence.make_simplex_map(filtration)
for i in persistence:
    if i.unpaired()
        for ii in i.chain: print smap[ii]