Public API

Ripserer

Ripserer.ripsererFunction
ripserer(dists::AbstractMatrix; kwargs...)
ripserer(points; metric=Distances.Euclidean(), births, kwargs...)
ripserer(filtration::AbstractFiltration; kwargs...)

Compute the persistent homology of metric space represented by dists, points and metric or a Ripserer.AbstractFiltration.

If using points, points must be an array of bitstypes, such as NTuples or SVectors.

Keyoword Arguments

  • dim_max: compute persistent homology up to this dimension. Defaults to 1.
  • modulus: compute persistent homology with coefficients in the prime field of integers mod modulus. Defaults to 2.
  • field_type: use this type of field of coefficients. Defaults to Ripserer.Mod{modulus}.
  • threshold: compute persistent homology up to diameter smaller than threshold. For non-sparse Rips filtrations, it defaults to radius of input space.
  • cutoff: only keep intervals with persistence(interval) > cutoff. Defaults to 0.
  • reps: if true, return representative cocycles along with persistence intervals. Defaults to false.
  • progress: If true, show a progress bar. Defaults to false.
  • metric: when calculating persistent homology from points, any metric from Distances.jl can be used. Defaults to Distances.Euclidean().
  • cohomology: if set to false, compute persistent homology instead of cohomology. This is much slower and gives the same result, but may give more informative representatives when reps is set to true. Currently unable to compute infinite intervals in dimensions higher than 0. Defaults to false.
source
Ripserer.RipsType
Rips{I, T} <: AbstractRipsFiltration{T, Simplex}

This type represents a filtration of Vietoris-Rips complexes. Diagonal items are treated as vertex birth times.

Constructors

  • Rips(distance_matrix; threshold=default_rips_threshold(dist))
  • Rips(points; metric=Euclidean(), threshold=default_rips_threshold(dist))
  • Rips{I}(args...): I sets the size of integer used to represent simplices.
source
Ripserer.SparseRipsType
SparseRips{I, T} <: AbstractRipsFiltration{T, Simplex}

This type represents a filtration of Vietoris-Rips complexes. The distance matrix will be converted to a sparse matrix with all values greater than threshold deleted. Off-diagonal zeros in the matrix are treated as missing. Diagonal items are treated as vertex birth times.

Constructor

  • SparseRips{I}(distance_matrix; threshold=nothing)
  • SparseRips(distance_matrix; threshold=nothing): I sets the integer size used to represent simplices.
source
Ripserer.CubicalType
Cubical{T, N} <: AbstractFiltration{T, <:Cubelet{0, T}}

Cubical is used to compute sublevel persistent homology on N-dimensional images, which are of type AbstractArray{T, N}.

Constructor

Cubical(::AbstractArray{T, N})
source
Ripserer.ModType
Mod{M} <: Integer

Representation of finite field $\mathbb{Z}_M$, integers modulo small, prime M. Supports integer arithmetic and can be converted to integer with Int.

source

Simplices

Ripserer.SimplexType
Simplex{D, T, I} <: IndexedSimplex{D, T, I}

The vanilla simplex type represented by dimension D and index of type I and a diameter of type T.

Constructor

Simplex{D[, T, I]}(::I, ::T)

Examples

Simplex{2}(2, 1)

# output

2-dim Simplex{2}(2, 1):
  +[4, 2, 1]
Simplex{10}(Int128(-10), 1.0)

# output

4-dim Simplex{3}(1.0, 10, 2):
  -Int128[12, 11, 10, 9, 8, 7, 6, 5, 4, 2, 1]
source
Ripserer.CubeletType
Cubelet{D, T, I} <: IndexedSimplex{D, T, I}

A Cubelet is similar to a Simplex, but it has 2^D vertices instead of D+1. Like in Simplex, the vertices are encoded from an index and dimension. Because a cubelet knows nothing about the image it came from, it returns linear indices from vertices.

The vertices should be neighboring indices, but this fact is not checked anywhere.

source
Ripserer.verticesFunction
vertices(simplex::AbstractSimplex{dim})

Get the vertices of simplex. Returns NTuple{dim+1, Int}. In the algorithm, only the method for 2-simplices is actually used.

vertices(Simplex{2}((3, 2, 1), 3.2))

# output

3-element StaticArrays.SArray{Tuple{3},Int64,1,3} with indices SOneTo(3):
 3
 2
 1
source
vertices(index::I, ::Val{N})

Get the vertices of simplex represented by index. Returns NTuple{N, I}. For regular simplices, N should be equal to dim+1!

source
Ripserer.dimFunction
dim(::AbstractSimplex)
dim(::Type{<:AbstractSimplex})

Get the dimension of simplex i.e. the value of D.

dim(Simplex{2}((3, 2, 1), 3.2))

# output

2
source

Persistence Diagrams

See also: PersistenceDiagrams.jl API. Ripserer reexports the following:

PersistenceDiagrams.birth
PersistenceDiagrams.death
PersistenceDiagrams.persistence
PersistenceDiagrams.representative
PersistenceDiagrams.birth_simplex
PersistenceDiagrams.death_simplex
PersistenceDiagrams.barcode