Programming Interface

The main class of the package is the BaseComplex class. It is a wrapper around the GUDHI library. It is recommended to read the GUDHI documentation to understand the parameters of the BaseComplex class.

BaseComplex

class galaxywitness.base_complex.BaseComplex(points=None)[source]

Base class for any type of complexes

abstract animate_simplex_tree(path_to_save)[source]

Draw animation of filtrated simplicial complex (powered by matplotlib)

Parameters:

path_to_save (str) – place, where we are saving files

abstract animate_simplex_tree_plotly(path_to_save)[source]

Draw animation of filtrated simplicial complex (powered by plotly)

Parameters:

path_to_save (str) – place, where we are saving files

draw_simplicial_complex(num, filtration_val, backend, path_to_save=None)[source]

Draw simplicial complex with filtration value filtration_val

Parameters:
  • num (int) – number of step

  • filtration_val (float) – filtration value

  • backend (str) – backend for drawing

  • path_to_save (str) – place, where we are saving files

external_simplex_tree(simplex_tree)[source]

Load external filtered simplicial complex (as simplex tree) to DescendantComplex instance

Parameters:

simplex_tree (gudhi.SimplexTree) – external simplex tree

get_adjacency_list(max_fil_val)[source]

Get adjacency list for vertices in 1-skeleton of filtrated simplicial complex

get_barcode(show=False, path_to_save=None)[source]

Draw barcode

Parameters:
  • show (bool) – show barcode? (Optional)

  • path_to_save (str) – place, where we are saving files

get_diagram(show=False, path_to_save=None)[source]

Draw persistent diagram

Parameters:
  • show (bool) – show diagram? (Optional)

  • path_to_save (str) – place, where we are saving files

get_persistence_betti(dim, magnitudes)[source]

Computation of persistence betti numbers

Parameters:
  • dim (int) – max dimension of betti numbers

  • magnitudes – levels of significance

Returns:

list of persistence betti numbers for dimensions 0…dim

Return type:

np.array

tomato(max_fil_val=7.5)[source]

ToMATo clustering with automatic choice of number of clusters. Hence, clustering depends on filtered complex construction and max value of filtration.

RipsComplex

class galaxywitness.rips_complex.RipsComplex(points, max_edge_length, sparse=None)[source]

Main class for handling data about the point cloud and the simplex tree of filtered Rips complex

Parameters:

points (np.array size of n_landmarks x 3) – set of landmarks in \(\mathbb{R}^d\).

animate_simplex_tree(path_to_save)[source]

Draw animation of filtration (powered by matplotlib)

Parameters:

path_to_save (str) – place, where we are saving files

animate_simplex_tree_plotly(path_to_save)[source]

Draw animation of filtration (powered by plotly)

Parameters:

path_to_save (str) – place, where we are saving files

compute_simplicial_complex(d_max, r_max, **kwargs)[source]

Compute custom filtered simplicial complex

Parameters:

r_max (float) – max filtration value

AlphaComplex

class galaxywitness.alpha_complex.AlphaComplex(points)[source]

Main class for handling data about the point cloud and the simplex tree of filtered alpha complex

Parameters:

points (np.array size of n_landmarks x 3) – set of landmarks in \(\mathbb{R}^d\).

animate_simplex_tree(path_to_save)[source]

Draw animation of filtration (powered by matplotlib)

Parameters:

path_to_save (str) – place, where we are saving files

animate_simplex_tree_plotly(path_to_save)[source]

Draw animation of filtration (powered by plotly)

Parameters:

path_to_save (str) – place, where we are saving files

compute_simplicial_complex(r_max, **kwargs)[source]

Compute custom filtered simplicial complex

Parameters:

r_max (float) – max filtration value

WitnessComplex

class galaxywitness.witness_complex.WitnessComplex(landmarks, witnesses, landmarks_idxs, n_jobs=-1, isomap_eps=0)[source]

Main class for handling data about the point cloud and the simlex tree of filtered witness complex

Parameters:
  • landmarks (np.array size of n_landmarks x 3) – set of landmarks in \(\mathbb{R}^d\).

  • witnesses (np.array size of n_witnesses x 3) – set of witnesses in \(\mathbb{R}^d\).

  • landmarks_idxs (np.array[int]) – indices of landmarks in witnesses array

animate_simplex_tree(path_to_save)[source]

Draw animation of filtration (powered by matplotlib)

Parameters:

path_to_save (str) – place, where we are saving files

animate_simplex_tree_plotly(path_to_save)[source]

Draw animation of filtration (powered by plotly)

Parameters:

path_to_save (str) – place, where we are saving files

compute_simplicial_complex(d_max, r_max=None, n_jobs=1, custom=False)[source]

Compute custom filtered simplicial complex

Parameters:
  • d_max (int) – max dimension of simplicies in the simplex tree

  • r_max (float) – max filtration value

  • n_jobs (int) – number of threads