phlite for Python

Persistent homology from Rust, in three Python packages:

Package

Computes

Reference

phlite

persistence of any filtered chain complex you build: from integer columns, CSC arrays, or your own Python objects as cells

phlite

phlite_rips

Vietoris–Rips persistence of a distance matrix

phlite_rips

phlite_grpph

grounded persistent path homology of a weighted digraph

phlite_grpph

All three return barcodes with optional representative cycles, compute by cohomology (default) or homology, release the GIL while they work, and share one Algorithm class for choosing how the reduction is done.

import phlite

chain = phlite.ChainComplex.from_pairs([(0, []), (0, []), (1, [0, 1])])
barcode = chain.filtration([0.0, 1.0, 2.0]).persistence(representatives=True)
barcode.pairings      # [(1, 2)]
barcode.diagram(0)    # array([[0., inf], [1., 2.]])

These pages are the API reference, generated from the packages’ docstrings. For guides, worked examples (with notebooks) and how everything works inside, see the phlite book.