FilteredComplex#
Overview#
- class FilteredComplex(n, k)#
Class representing a filtered simplicial complex.
Methods#
Construct a discrete filtered simplicial complex with default filtration time of 0.
Add a simplex to a filtered simplicial complex.
Returns the dictionary key of a simplex with respect to its vertex labels sorted in ascending order, counting all possible sorted subsequences of \((0, ..., N-1)\) of length \(k\), where \(N\) is the number of vertices in the complex.
Check for membership of a simplex in the complex.
Function to make sure that simplex colours are consistent with the colours of their vertices.
Propagate filtration values upwards or downwards to ensure that every simplex appears after its faces.
Serialised representation of the simplicial complex in a format suitable for persistent homology computations.
Properties#
- property max_dimension: int#
Maximum dimension of simplex that this complex can store. Set during initialisation.
- property num_vertices: int#
Number of vertices in the simplicial complex. Set during initialisation.
- property simplices: list[dict[int, Simplex]]#
A list such that
simplices[k]
is a dictionary of handles to the \(k\)-simplices in the complex. The key of a \(k\)-simplex insimplices[k]
is the lexicographic index of that simplex with respect to its vertex labels sorted in ascending order, counting all possible sorted subsequences of \((0, ..., N-1)\) of length \(k\).
Details#
- class FilteredComplex
- __init__(n, k)#
Construct a discrete filtered simplicial complex with default filtration time of 0.
- add_simplex(vertices, filt_value)#
Add a simplex to a filtered simplicial complex.
- Parameters:
- Return type:
Note
Faces of the added simplex that are already present in the simplicial complex will have their filtration values reduced if necessary.
- get_label_from_vertex_labels(vertices)#
Returns the dictionary key of a simplex with respect to its vertex labels sorted in ascending order, counting all possible sorted subsequences of \((0, ..., N-1)\) of length \(k\), where \(N\) is the number of vertices in the complex. The simplex need not be present in the simplicial complex.
- has_simplex(vertices)#
Check for membership of a simplex in the complex.
- propagate_colours()#
Function to make sure that simplex colours are consistent with the colours of their vertices. You should call this whenever you change the colour of any vertices.
- propagate_filt_values(start_dim, upwards=True)#
Propagate filtration values upwards or downwards to ensure that every simplex appears after its faces. For example, setting the filtration values in dimension 1 and propagating upwards is akin to the Rips filtration.
- serialised()#
Serialised representation of the simplicial complex in a format suitable for persistent homology computations.
- Returns:
A list x of simplices in the simplicial complex ordered by dimension followed by filtration time. Each simplex \(\sigma\) is represented by a tuple containing the following items.
A list containing the indices in x of the facets of \(\sigma\), sorted in ascending order.
The lexicographic key of \(\sigma\) in the simplicial complex.
The filtration time of \(\sigma\).
The colour bitmask of \(\sigma\).
- Return type: