Basics

PersistenceDiagrams.PersistenceIntervalType
PersistenceInterval

Type for representing persistence intervals. It behaves exactly like a Tuple{Float64, Float64}, but can have meta data attached to it. The metadata is accessible with getproperty or the dot syntax.

Example

julia> interval = PersistenceInterval(1, Inf; meta1=:a, meta2=:b)
[1.0, ∞) with:
 meta1: Symbol
 meta2: Symbol

julia> birth(interval), death(interval), persistence(interval)
(1.0, Inf, Inf)

julia> isfinite(interval)
false

julia> propertynames(interval)
(:birth, :death, :meta1, :meta2)

julia> interval.meta1
:a
source
PersistenceDiagrams.death_simplexFunction
death_simplex(interval::PersistenceInterval)

Get the critical death simplex of interval, if it has one.

Note

An infinite interval's death simplex is nothing.

source
PersistenceDiagrams.PersistenceDiagramType
PersistenceDiagram <: AbstractVector{PersistenceInterval}

Type for representing persistence diagrams. Behaves exactly like a vector of PersistenceIntervals, but can have additional metadata attached to it. It supports pretty printing and plotting.

Can be used as a table with any function that uses the Tables.jl interface. Note that using it as a table will only keep interval endpoints and the dim and threshold attributes.

Example

julia> diagram = PersistenceDiagram([(1, 3), (3, 4), (1, Inf)]; dim=1, custom_metadata=:a)
3-element 1-dimensional PersistenceDiagram:
 [1.0, 3.0)
 [3.0, 4.0)
 [1.0, ∞)

julia> diagram[1]
[1.0, 3.0)

julia> sort(diagram; by=persistence, rev=true)
3-element 1-dimensional PersistenceDiagram:
 [1.0, ∞)
 [1.0, 3.0)
 [3.0, 4.0)

julia> propertynames(diagram)
(:intervals, :dim, :custom_metadata)

julia> dim(diagram)
1

julia> diagram.custom_metadata
:a
source
PersistenceDiagrams.barcodeMethod
barcode(diagram)

Plot the barcode plot of persistence diagram or multiple diagrams in a collection. The infinity keyword argument determines where the infinity line is placed. If unset, the function tries to use threshold(diagram), or guess a good position to place the line at.

source