HarmonicChainBarcode
The harmonic chain barcode of a filtered complex (Hou, Parsa and Wang, "Tracking the persistence of harmonic chains", SoCG 2025): the barcode that follows the harmonic chains H_p(K_t) = ker ∂_p ∩ ker ∂_{p+1}^T (cycles orthogonal to all boundaries, the kernel of the Hodge Laplacian) along the filtration. Each bar is a harmonic cycle that stays harmonic for the bar's whole life, so it needs no choice of representative, and the representative the bar carries is that one cycle.
val rips = VietorisRips(points, maxDimension = 1)
val diagram = HarmonicChainBarcode(rips, maxDimension = 1)
diagram.bars.head.representative // a chain that is a cycle and a cocycle at every value of its bar
It is NOT the ordinary barcode. When a cell enters, the harmonic chains of the complex change by a whole class at a time, and a cycle stops being harmonic as soon as it is no longer orthogonal to the boundaries, which happens before it becomes a boundary: a filtration in which the ordinary barcode has the bars [4, 9), [5, 10), [7, 8) can have the harmonic bars [4, 8), [5, 9), [7, 10) (the example of the paper, a spec of this library). The number of bars alive at each value is the Betti number there, as for the ordinary barcode. A bar [b, d) is born when the cell that creates its cycle enters (at b) and ends when the cell enters that makes the cycle non-orthogonal to a boundary (at d); the two cells are the bar's PersistenceBar.birthCell and PersistenceBar.deathCell.
The barcode is defined for a simplex-wise filtration, one cell entering at a time, and the harmonic chains of the complexes in between depend on the order in which cells of equal filtration value enter. HarmonicChainBarcode(stream) takes them in the order value, then dimension (so a face comes before its cofaces), then the stream's own order within a dimension (insertionOrder), as the paper fixes an order too; ofOrder takes any order. A bar born and gone at one value is left out unless includeZeroLength = true.
The representative of a bar (Algorithm 1 of the paper): when a cell creates a cycle, the harmonic chain that is new is the one orthogonal to every earlier cycle (the Gram-Schmidt step; the paper's coboundary basis finds the same chain), and when a cell closes a class, the oldest harmonic chain that is no longer orthogonal to its boundary ends the bar, and the other chains that are not orthogonal have a multiple of it subtracted. It is the bar's chain at the moment the bar ends, and it was harmonic from the moment the bar began.
In a Vietoris-Rips filtration a triangle enters at the value of its longest edge: if that edge starts a new loop, the triangle ends the oldest loop it is not orthogonal to, so a long ordinary bar is cut there and appears as consecutive bars. For the ordinary bars with harmonic representatives use HarmonicRepresentatives. The births and deaths are always those of the ordinary barcode, paired differently.
Harmonic means an inner product, so the coefficients are the real numbers (Coefficients(0), the default; a tolerance decides which entries are zero) or the exact rationals (Coefficients.Rationals, no tolerance: the numbers can grow), and a finite field is refused: the dot product is not positive definite there, so a chain can be orthogonal to itself and the algorithm divides by its length. The result is an ordinary PersistenceDiagram whose bars carry their cells, so every tool for diagrams applies; its representatives are chains that are both cycles and cocycles. The cost is O(m^3) for m cells in the worst case (the paper's bound) and the chains are kept sparse.
Attributes
- Experimental
- true
- Source
- HarmonicChainBarcode.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
HarmonicChainBarcode.type