API

The following classes and functions live in the dionysus module.

Filtration

class Simplex

an abstract simplex

__contains__(self: dionysus._dionysus.Simplex, v: SupportsInt | SupportsIndex) bool

test whether the simplex contains given vertex

__getitem__(self: dionysus._dionysus.Simplex, i: SupportsInt | SupportsIndex) int

access i-th vertex

__iter__(self: dionysus._dionysus.Simplex) collections.abc.Iterator[int]

iterator over the vertices

__len__(self: dionysus._dionysus.Simplex) int

simplex cardinality

boundary(self: dionysus._dionysus.Simplex) collections.abc.Iterator[dionysus._dionysus.Simplex]

returns iterator over the boundary of the simplex

property data

access the data associated to the simplex

dimension(self: dionysus._dionysus.Simplex) int

simplex dimension, one less than cardinality

join(self: dionysus._dionysus.Simplex, v: SupportsInt | SupportsIndex) dionysus._dionysus.Simplex

join a simplex and a vertex

class Filtration

store an ordered sequence of simplices, providing lookup

__contains__(self: dionysus._dionysus.Filtration, arg0: dionysus._dionysus.Simplex) bool

test whether filtration contains the simplex

__getitem__(self: dionysus._dionysus.Filtration, arg0: SupportsInt | SupportsIndex) dionysus._dionysus.Simplex

access the simplex at the given index

__iter__(self: dionysus._dionysus.Filtration) collections.abc.Iterator[dionysus._dionysus.Simplex]

iterate over the simplices in sorted order

__len__(self: dionysus._dionysus.Filtration) int

size of the filtration

append(self: dionysus._dionysus.Filtration, s: dionysus._dionysus.Simplex) None

append simplex to the filtration

index(*args, **kwargs)

Overloaded function.

  1. index(self: dionysus._dionysus.Filtration, s: dionysus._dionysus.Simplex) -> int

find an ordered index of a simplex s in the filtration

  1. index(self: dionysus._dionysus.Filtration, s: dionysus._dionysus.Simplex, i: typing.SupportsInt | typing.SupportsIndex) -> int

find the ordered index of a simplex s (no later than i) in the filtration

rearrange(self: dionysus._dionysus.Filtration, indices: collections.abc.Sequence[SupportsInt | SupportsIndex]) None

rearrange simplices into the given order

sort(*args, **kwargs)

Overloaded function.

  1. sort(self: dionysus._dionysus.Filtration, reverse: bool = False) -> None

sort the filtration with respect to data, breaking ties using dimension, and then lexicographically

  1. sort(self: dionysus._dionysus.Filtration, cmp: collections.abc.Callable[[dionysus._dionysus.Simplex, dionysus._dionysus.Simplex], int], reverse: bool = False) -> None

sort the filtration with respect to the given functor

  1. sort(self: dionysus._dionysus.Filtration, *, key: collections.abc.Callable[[dionysus._dionysus.Simplex], tuple], reverse: bool = False) -> None

sort the filtration with respect to the given key

fill_rips(data: numpy.ndarray, k: SupportsInt | SupportsIndex, r: SupportsFloat | SupportsIndex) dionysus._dionysus.Filtration

returns (sorted) filtration filled with the k-skeleton of the clique complex built on the points at distance at most r from each other

closure(simplices, k)

Compute the k-skeleton of the closure of the list of simplices.

fill_freudenthal(data: numpy.ndarray, reverse: bool = False) dionysus._dionysus.Filtration

returns (sorted) lower-star (or upper-star if reverse = True) filtration filled with the Freudenthal triangulation of the grid in the array data

fast_zigzag(f, times)

Build the cone to compute extended persistence equivalent to the given zigzag.

Persistence

homology_persistence(*args, **kwargs)

Overloaded function.

  1. homology_persistence(filtration: dionysus._dionysus.Filtration, prime: typing.SupportsInt | typing.SupportsIndex = 2, method: str = 'clearing', progress: bool = False) -> object

compute homology persistence of the filtration (pair simplices); method is one of clearing, row, column, column_no_negative, matrix_v, matrix_v_no_negative, matrix_u, or matrix_u_no_negative

  1. homology_persistence(filtration: dionysus::MatrixFiltration<dionysus::ReducedMatrix<dionysus::ZpField<long>, unsigned int, std::__1::less<unsigned int>>, float>, prime: typing.SupportsInt | typing.SupportsIndex = 2, method: str = ‘clearing’, progress: bool = False) -> object

compute homology persistence of the filtration (pair simplices); method is one of clearing, row, column, column_no_negative, matrix_v, matrix_v_no_negative, matrix_u, or matrix_u_no_negative

  1. homology_persistence(filtration: dionysus._dionysus.MultiFiltration, prime: typing.SupportsInt | typing.SupportsIndex = 2, method: str = 'clearing', progress: bool = False) -> object

compute homology persistence of the filtration (pair simplices); method is one of clearing, row, column, column_no_negative, matrix_v, matrix_v_no_negative, matrix_u, or matrix_u_no_negative

  1. homology_persistence(filtration: dionysus._dionysus.LinkedMultiFiltration, prime: typing.SupportsInt | typing.SupportsIndex = 2, method: str = 'clearing', progress: bool = False) -> object

compute homology persistence of the filtration (pair simplices); method is one of clearing, row, column, column_no_negative, matrix_v, matrix_v_no_negative, matrix_u, or matrix_u_no_negative

  1. homology_persistence(filtration: dionysus._dionysus.Filtration, relative: dionysus._dionysus.Filtration, prime: typing.SupportsInt | typing.SupportsIndex = 2, method: str = 'clearing', progress: bool = False) -> object

compute homology persistence of the filtration, relative to a subcomplex; method is one of clearing, row, column, column_no_negative, matrix_v, matrix_v_no_negative, matrix_u, or matrix_u_no_negative

cohomology_persistence(filtration: dionysus._dionysus.Filtration, prime: SupportsInt | SupportsIndex = 2, keep_cocycles: bool = False) dionysus::PairChainRecorder<dionysus::CohomologyPersistence<dionysus::ZpField<long>, unsigned int, std::__1::less<unsigned int>>>

compute cohomology persistence of the filtration

omnifield_homology_persistence(*args, **kwargs)

Overloaded function.

  1. omnifield_homology_persistence(filtration: dionysus._dionysus.Filtration) -> dionysus::OmniFieldPersistence<unsigned int, std::__1::less<unsigned int>, dionysus::Q<long>, dionysus::ZpField<long>>

compute homology persistence of the filtration (pair simplices) over all fields at once

  1. omnifield_homology_persistence(filtration: dionysus._dionysus.MatrixFiltration) -> dionysus::OmniFieldPersistence<unsigned int, std::__1::less<unsigned int>, dionysus::Q<long>, dionysus::ZpField<long>>

compute homology persistence of the matrix filtration over all fields at once

zigzag_homology_persistence(filtration: dionysus._dionysus.Filtration, times: collections.abc.Sequence[collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex]], prime: typing.SupportsInt | typing.SupportsIndex = 2, callback: collections.abc.Callable[[typing.SupportsInt | typing.SupportsIndex, typing.SupportsFloat | typing.SupportsIndex, bool, dionysus::ZigzagPersistence<dionysus::ZpField<long>, int, std::__1::less<int>>, PyTimeIndexMap], None] = <built-in method of pybind11_builtins.pybind11_detail_function_record_v1_system_libcpp_abi1 object at 0x10e60a910>, progress: bool = False) tuple[dionysus::ZigzagPersistence<dionysus::ZpField<long>, int, std::__1::less<int>>, list[dionysus::Diagram<float, unsigned int>], PyTimeIndexMap]

compute zigzag homology persistence of the filtration with respect to the given times

Parameters:
  • filtration – an instance of Filtration with the set of simplices used in the zigzag construction

  • times – a list of lists; the outer list runs parallel with the filtration; the inner list specifies for each simplex when it enters and leaves the zigzag (even entries, starting the indexing from 0, are interpreted as appearance times, odd entires as disappearance)

  • prime – prime modulo which to perform computation

  • callback – function to call after every step in the zigzag; it gets arguments (i,t,d,zz,cells), where i is the index of the simplex being added or removed, t is the time, d is the “direction” (True if the simplex is being added, False if it`s being removed), zz is the current state of the ZigzagPersistence, cells is the map from the internal indices of the zigzag representation to the filtration indices,

  • progress – show a progress bar.

Returns:

A triple. The first element is an instance of ZigzagPersistence, which offers access to the cycles alive at the end of the zigzag; the second is a list of persistence diagrams; the third is an instance of TimeIndexMap for translating cycles from the internal representation to filtration indices.

Diagrams

init_diagrams(*args, **kwargs)

Overloaded function.

  1. init_diagrams(m: dionysus._dionysus.ReducedMatrix, f: dionysus._dionysus.Filtration) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from reduced matrix and filtration

  1. init_diagrams(m: dionysus._dionysus.ReducedMatrix, f: dionysus::MatrixFiltration<dionysus::ReducedMatrix<dionysus::ZpField<long>, unsigned int, std::__1::less<unsigned int>>, float>) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from reduced matrix and filtration

  1. init_diagrams(m: dionysus._dionysus.ReducedMatrix, f: dionysus._dionysus.MultiFiltration) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from reduced matrix and filtration

  1. init_diagrams(m: dionysus._dionysus.ReducedMatrix, f: dionysus._dionysus.LinkedMultiFiltration) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from reduced matrix and filtration

  1. init_diagrams(m: dionysus._dionysus.ReducedMatrixNoNegative, f: dionysus._dionysus.Filtration) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from reduced matrix and filtration

  1. init_diagrams(m: dionysus._dionysus.ReducedMatrixNoNegative, f: dionysus::MatrixFiltration<dionysus::ReducedMatrix<dionysus::ZpField<long>, unsigned int, std::__1::less<unsigned int>>, float>) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from reduced matrix and filtration

  1. init_diagrams(m: dionysus._dionysus.ReducedMatrixNoNegative, f: dionysus._dionysus.MultiFiltration) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from reduced matrix and filtration

  1. init_diagrams(m: dionysus._dionysus.ReducedMatrixNoNegative, f: dionysus._dionysus.LinkedMultiFiltration) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from reduced matrix and filtration

  1. init_diagrams(m: dionysus._dionysus.ReducedMatrixWithV, f: dionysus._dionysus.Filtration) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from reduced matrix and filtration

  1. init_diagrams(m: dionysus._dionysus.ReducedMatrixWithV, f: dionysus::MatrixFiltration<dionysus::ReducedMatrix<dionysus::ZpField<long>, unsigned int, std::__1::less<unsigned int>>, float>) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from reduced matrix and filtration

  1. init_diagrams(m: dionysus._dionysus.ReducedMatrixWithV, f: dionysus._dionysus.MultiFiltration) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from reduced matrix and filtration

  1. init_diagrams(m: dionysus._dionysus.ReducedMatrixWithV, f: dionysus._dionysus.LinkedMultiFiltration) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from reduced matrix and filtration

  1. init_diagrams(m: dionysus._dionysus.ReducedMatrixNoNegativeWithV, f: dionysus._dionysus.Filtration) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from reduced matrix and filtration

  1. init_diagrams(m: dionysus._dionysus.ReducedMatrixNoNegativeWithV, f: dionysus::MatrixFiltration<dionysus::ReducedMatrix<dionysus::ZpField<long>, unsigned int, std::__1::less<unsigned int>>, float>) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from reduced matrix and filtration

  1. init_diagrams(m: dionysus._dionysus.ReducedMatrixNoNegativeWithV, f: dionysus._dionysus.MultiFiltration) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from reduced matrix and filtration

  1. init_diagrams(m: dionysus._dionysus.ReducedMatrixNoNegativeWithV, f: dionysus._dionysus.LinkedMultiFiltration) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from reduced matrix and filtration

  1. init_diagrams(m: dionysus._dionysus.ReducedMatrixWithU, f: dionysus._dionysus.Filtration) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from reduced matrix and filtration

  1. init_diagrams(m: dionysus._dionysus.ReducedMatrixWithU, f: dionysus::MatrixFiltration<dionysus::ReducedMatrix<dionysus::ZpField<long>, unsigned int, std::__1::less<unsigned int>>, float>) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from reduced matrix and filtration

  1. init_diagrams(m: dionysus._dionysus.ReducedMatrixWithU, f: dionysus._dionysus.MultiFiltration) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from reduced matrix and filtration

  1. init_diagrams(m: dionysus._dionysus.ReducedMatrixWithU, f: dionysus._dionysus.LinkedMultiFiltration) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from reduced matrix and filtration

  1. init_diagrams(m: dionysus._dionysus.ReducedMatrixNoNegativeWithU, f: dionysus._dionysus.Filtration) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from reduced matrix and filtration

  1. init_diagrams(m: dionysus._dionysus.ReducedMatrixNoNegativeWithU, f: dionysus::MatrixFiltration<dionysus::ReducedMatrix<dionysus::ZpField<long>, unsigned int, std::__1::less<unsigned int>>, float>) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from reduced matrix and filtration

  1. init_diagrams(m: dionysus._dionysus.ReducedMatrixNoNegativeWithU, f: dionysus._dionysus.MultiFiltration) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from reduced matrix and filtration

  1. init_diagrams(m: dionysus._dionysus.ReducedMatrixNoNegativeWithU, f: dionysus._dionysus.LinkedMultiFiltration) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from reduced matrix and filtration

  1. init_diagrams(m: dionysus::PairChainRecorder<dionysus::CohomologyPersistence<dionysus::ZpField<long>, unsigned int, std::__1::less<unsigned int>>>, f: dionysus._dionysus.Filtration) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams from cohomology persistence and filtration

  1. init_diagrams(ofp: dionysus::OmniFieldPersistence<unsigned int, std::__1::less<unsigned int>, dionysus::Q<long>, dionysus::ZpField<long>>, f: dionysus._dionysus.Filtration, p: typing.SupportsInt | typing.SupportsIndex) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams for a specific prime from omnifield persistence and filtration

  1. init_diagrams(ofp: dionysus::OmniFieldPersistence<unsigned int, std::__1::less<unsigned int>, dionysus::Q<long>, dionysus::ZpField<long>>, f: dionysus._dionysus.MatrixFiltration, p: typing.SupportsInt | typing.SupportsIndex) -> list[dionysus::Diagram<float, unsigned int>]

initialize diagrams for a specific prime from omnifield persistence and filtration

init_zigzag_diagrams(*args, **kwargs)

Overloaded function.

  1. init_zigzag_diagrams(r: dionysus._dionysus.ReducedMatrix, f: dionysus._dionysus.LinkedMultiFiltration, diagonal: bool = False) -> list[dict[str, dionysus::Diagram<float, unsigned int>]]

Given the cone f and its reduced matrix r, initialize zigzag diagrams.

  1. init_zigzag_diagrams(r: dionysus._dionysus.ReducedMatrixWithV, f: dionysus._dionysus.LinkedMultiFiltration, diagonal: bool = False) -> list[dict[str, dionysus::Diagram<float, unsigned int>]]

Given the cone f and its reduced matrix r, initialize zigzag diagrams.

  1. init_zigzag_diagrams(r: dionysus._dionysus.ReducedMatrixNoNegative, f: dionysus._dionysus.LinkedMultiFiltration, diagonal: bool = False) -> list[dict[str, dionysus::Diagram<float, unsigned int>]]

Given the cone f and its reduced matrix r, initialize zigzag diagrams.

  1. init_zigzag_diagrams(r: dionysus._dionysus.ReducedMatrixNoNegativeWithV, f: dionysus._dionysus.LinkedMultiFiltration, diagonal: bool = False) -> list[dict[str, dionysus::Diagram<float, unsigned int>]]

Given the cone f and its reduced matrix r, initialize zigzag diagrams.

class Diagram

persistence diagram

__iter__(self: dionysus._dionysus.Diagram) collections.abc.Iterator[dionysus::Diagram<float, unsigned int>::Point]

iterate over the points of the diagram

__len__(self: dionysus._dionysus.Diagram) int

size of the diagram

append(*args, **kwargs)

Overloaded function.

  1. append(self: dionysus._dionysus.Diagram, p: dionysus::Diagram<float, unsigned int>::Point) -> None

append point to the diagram

  1. append(self: dionysus._dionysus.Diagram, birth: typing.SupportsFloat | typing.SupportsIndex, death: typing.SupportsFloat | typing.SupportsIndex, data: typing.SupportsInt | typing.SupportsIndex = 0) -> None

append point to the diagram

class DiagramPoint

persistence diagram point

property birth

birth value

property data

auxiliary data associated to the point (e.g., birth index)

property death

death value

wasserstein_distance(dgm1: dionysus._dionysus.Diagram, dgm2: dionysus._dionysus.Diagram, q: SupportsInt | SupportsIndex = 2, delta: SupportsFloat | SupportsIndex = 0.01, internal_p: SupportsFloat | SupportsIndex = -1.0, initial_eps: SupportsFloat | SupportsIndex = 0.0, eps_factor: SupportsFloat | SupportsIndex = 0.0) float

compute Wasserstein distance between two persistence diagrams

bottleneck_distance(dgm1: dionysus._dionysus.Diagram, dgm2: dionysus._dionysus.Diagram, delta: SupportsFloat | SupportsIndex = 0.01) float

compute bottleneck distance between two persistence diagrams

Matrices

class Chain

chain of indices (formal sum with coefficients in Zp)

__eq__(self: dionysus._dionysus.Chain, arg0: dionysus._dionysus.Chain) bool

equality comparison

__getitem__(self: dionysus._dionysus.Chain, arg0: SupportsInt | SupportsIndex) dionysus::ChainEntry<dionysus::ZpField<long>, unsigned int>

access the entry at a given index

__iter__(self: dionysus._dionysus.Chain) collections.abc.Iterator[dionysus::ChainEntry<dionysus::ZpField<long>, unsigned int>]

iterate over the entries of the chain

__len__(self: dionysus._dionysus.Chain) int

size of the chain

__ne__(self: dionysus._dionysus.Chain, arg0: dionysus._dionysus.Chain) bool

nonequal comparison

class ChainEntry

(coefficient, index) entry in a chain)

property element

coefficient of the chain element

property index

index of the chain element

class ReducedMatrix

matrix, where each column has a lowest non-zero entry in a unique row; supports iteration and indexing

__getitem__(self: dionysus._dionysus.ReducedMatrix, arg0: SupportsInt | SupportsIndex) std::__1::vector<dionysus::ChainEntry<dionysus::ZpField<long>, unsigned int>, std::__1::allocator<dionysus::ChainEntry<dionysus::ZpField<long>, unsigned int>>>

access the column at a given index

__iter__(self: dionysus._dionysus.ReducedMatrix) collections.abc.Iterator[std::__1::vector<dionysus::ChainEntry<dionysus::ZpField<long>, unsigned int>, std::__1::allocator<dionysus::ChainEntry<dionysus::ZpField<long>, unsigned int>>>]

iterate over the columns of the matrix

__len__(self: dionysus._dionysus.ReducedMatrix) int

size of the matrix

field(self: dionysus._dionysus.ReducedMatrix) dionysus._dionysus.Zp

access the field used for the reduction

homologous(self: dionysus._dionysus.ReducedMatrix, arg0: std::__1::vector<dionysus::ChainEntry<dionysus::ZpField<long>, unsigned int>, std: :__1::allocator<dionysus::ChainEntry<dionysus::ZpField<long>, unsigned int>>>, arg1: std::__1::vector<dionysus::ChainEntry<dionysus::ZpField<long>, unsigned int>, std: :__1::allocator<dionysus::ChainEntry<dionysus::ZpField<long>, unsigned int>>>) bool

test if two cycles are homologous

pair(self: dionysus._dionysus.ReducedMatrix, arg0: SupportsInt | SupportsIndex) int

pair of the given index

resize(self: dionysus._dionysus.ReducedMatrix, arg0: SupportsInt | SupportsIndex) None

resize the number of columns

property unpaired

index representing lack of pair

class OmniFieldPersistence

compact composition of multiple reduced matrices

__len__(self: dionysus._dionysus.OmniFieldPersistence) int

size of the persistence object

column(*args, **kwargs)

Overloaded function.

  1. column(self: dionysus._dionysus.OmniFieldPersistence, arg0: typing.SupportsInt | typing.SupportsIndex, arg1: typing.SupportsInt | typing.SupportsIndex) -> dionysus._dionysus.Chain

get the column over a specific prime

  1. column(self: dionysus._dionysus.OmniFieldPersistence, arg0: typing.SupportsInt | typing.SupportsIndex) -> std::__1::vector<dionysus::ChainEntry<dionysus::Q<long>, unsigned int>, std::__1::allocator<dionysus::ChainEntry<dionysus::Q<long>, unsigned int>>>

get the column over rationals

primes(self: dionysus._dionysus.OmniFieldPersistence) list[int]

primes over which the matrix differs from the rest

special(self: dionysus._dionysus.OmniFieldPersistence, arg0: SupportsInt | SupportsIndex, arg1: SupportsInt | SupportsIndex) bool

test whether the column has a special value over the given prime

specials(self: dionysus._dionysus.OmniFieldPersistence) dict[int, list[int]]

get dictionary of special columns mapping to primes

class CoChain

chain of indices (formal sum with coefficients in Zp)

__eq__(self: dionysus._dionysus.CoChain, arg0: dionysus._dionysus.CoChain) bool

equality comparison

__getitem__(self: dionysus._dionysus.CoChain, arg0: SupportsInt | SupportsIndex) dionysus::CohomologyPersistence<dionysus::ZpField<long>, unsigned int, std::__1::less<unsigned int>>::Entry

access the entry at a given index

__iter__(self: dionysus._dionysus.CoChain) collections.abc.Iterator[dionysus::CohomologyPersistence<dionysus::ZpField<long>, unsigned int, std::__1::less<unsigned int>>::Entry]

iterate over the entries of the chain

__len__(self: dionysus._dionysus.CoChain) int

size of the chain

__ne__(self: dionysus._dionysus.CoChain, arg0: dionysus._dionysus.CoChain) bool

nonequal comparison

class CoChainEntry

(coefficient, index) entry in a chain)

property element

coefficient of the chain element

property index

index of the chain element

class CohomologyPersistenceColumnHead

Wrapper around columns in CohomologyPersistence.

property cocycle

still alive cocycle

property index

index when the column was added

class CohomologyPersistence

representation of pairs and alive cocycles

__iter__(self: dionysus._dionysus.CohomologyPersistence) collections.abc.Iterator[dionysus::CohomologyPersistence<dionysus::ZpField<long>, unsigned int, std::__1::less<unsigned int>>::ColumnHead]

iterate over the column heads of the matrix

__len__(self: dionysus._dionysus.CohomologyPersistence) int

size of the matrix

cocycle(self: dionysus._dionysus.CohomologyPersistence, arg0: SupportsInt | SupportsIndex) std::__1::vector<dionysus::CohomologyPersistence<dionysus::ZpField<long>, unsigned int, std::__1::less<unsigned int>>::Entry, std::__1::allocator<dionysus::CohomologyPersistence<dionysus::ZpField<long>, unsigned int, std::__1::less<unsigned int>>::Entry>>

cocycle that died with the addition of the cell at the given index

pair(self: dionysus._dionysus.CohomologyPersistence, arg0: SupportsInt | SupportsIndex) int

pair of the given index

property unpaired

index representing lack of pair

class ZigzagPersistence

representation of the current homology basis

__iter__(self: object) dionysus._dionysus.ZZAliveCycleIterator

iterator over the alive cycles

__len__(self: dionysus._dionysus.ZigzagPersistence) int

number of alive cycles

class Zp

arithmetic mod p

class ApexRepresentative(dir)

Apex representative

Vineyards

class VineyardMatrix

matrix storage for vineyard updates using stable cell ids

__getitem__(self: dionysus._dionysus.VineyardMatrix, column: SupportsInt | SupportsIndex) list[tuple[int, int]]

return a column as (coefficient, stable_row_id) entries

__len__(self: dionysus._dionysus.VineyardMatrix) int

number of cells

cell_at(self: dionysus._dionysus.VineyardMatrix, arg0: SupportsInt | SupportsIndex) int

cell id at a current filtration position

column(self: dionysus._dionysus.VineyardMatrix, column: SupportsInt | SupportsIndex) list[tuple[int, int]]

return a column as (coefficient, stable_row_id) entries

contains(self: dionysus._dionysus.VineyardMatrix, column: SupportsInt | SupportsIndex, row: SupportsInt | SupportsIndex) bool

test whether a stable-id-sorted column contains a row id

field(self: dionysus._dionysus.VineyardMatrix) dionysus._dionysus.Zp

field used for coefficients

low(self: dionysus._dionysus.VineyardMatrix, arg0: SupportsInt | SupportsIndex) int

cached low cell id of a column

pivot(self: dionysus._dionysus.VineyardMatrix, arg0: SupportsInt | SupportsIndex) int

column id with the given low cell id

position(self: dionysus._dionysus.VineyardMatrix, arg0: SupportsInt | SupportsIndex) int

current filtration position of a cell id

refresh_low(self: dionysus._dionysus.VineyardMatrix, column: SupportsInt | SupportsIndex) None

recompute the cached low for one column under the current order

set_column(self: dionysus._dionysus.VineyardMatrix, column: SupportsInt | SupportsIndex, entries: collections.abc.Sequence[tuple[SupportsInt | SupportsIndex, SupportsInt | SupportsIndex]]) None

set a column from (coefficient, stable_row_id) entries

set_low(self: dionysus._dionysus.VineyardMatrix, column: SupportsInt | SupportsIndex, low: SupportsInt | SupportsIndex) None

set the cached low for one column

transpose(self: dionysus._dionysus.VineyardMatrix, position: SupportsInt | SupportsIndex) tuple[int, int]

transpose adjacent filtration positions and return the swapped stable cell ids

property unpaired

index representing lack of pair

class VineyardV

matrix_v-based vineyard state for adjacent transpositions

__len__(self: dionysus._dionysus.VineyardV) int

number of cells

cell_at(self: dionysus._dionysus.VineyardV, arg0: SupportsInt | SupportsIndex) int

cell id at a current filtration position

chain(self: dionysus._dionysus.VineyardV, column: SupportsInt | SupportsIndex) list[tuple[int, int]]

return a V-matrix chain as (coefficient, stable_column_id) entries

field(self: dionysus._dionysus.VineyardV) dionysus._dionysus.Zp

field used for coefficients

low(self: dionysus._dionysus.VineyardV, arg0: SupportsInt | SupportsIndex) int

cached low cell id of a reduced column

pair(self: dionysus._dionysus.VineyardV, arg0: SupportsInt | SupportsIndex) int

persistence pair of the given cell id

pivot(self: dionysus._dionysus.VineyardV, arg0: SupportsInt | SupportsIndex) int

column id with the given low cell id

position(self: dionysus._dionysus.VineyardV, arg0: SupportsInt | SupportsIndex) int

current filtration position of a cell id

reduced_column(self: dionysus._dionysus.VineyardV, column: SupportsInt | SupportsIndex) list[tuple[int, int]]

return a reduced column as (coefficient, stable_row_id) entries

transpose(self: dionysus._dionysus.VineyardV, position: SupportsInt | SupportsIndex) tuple[int, int]

repair the vineyard state after transposing adjacent filtration positions

property unpaired

index representing lack of pair

class VineyardU

matrix_u-based vineyard state for adjacent transpositions

__len__(self: dionysus._dionysus.VineyardU) int

number of cells

cell_at(self: dionysus._dionysus.VineyardU, arg0: SupportsInt | SupportsIndex) int

cell id at a current filtration position

field(self: dionysus._dionysus.VineyardU) dionysus._dionysus.Zp

field used for coefficients

low(self: dionysus._dionysus.VineyardU, arg0: SupportsInt | SupportsIndex) int

cached low cell id of a reduced column

pair(self: dionysus._dionysus.VineyardU, arg0: SupportsInt | SupportsIndex) int

persistence pair of the given cell id

pivot(self: dionysus._dionysus.VineyardU, arg0: SupportsInt | SupportsIndex) int

column id with the given low cell id

position(self: dionysus._dionysus.VineyardU, arg0: SupportsInt | SupportsIndex) int

current filtration position of a cell id

reduced_column(self: dionysus._dionysus.VineyardU, column: SupportsInt | SupportsIndex) list[tuple[int, int]]

return a reduced column as (coefficient, stable_row_id) entries

trail(self: dionysus._dionysus.VineyardU, row: SupportsInt | SupportsIndex) list[tuple[int, int]]

return a U-matrix trail row as (coefficient, stable_column_id) entries

transpose(self: dionysus._dionysus.VineyardU, position: SupportsInt | SupportsIndex) tuple[int, int]

repair the vineyard state after transposing adjacent filtration positions

property unpaired

index representing lack of pair

Vineyard(*args, **kwargs)

Overloaded function.

  1. Vineyard(columns: collections.abc.Sequence[collections.abc.Sequence[tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex]]] = [], field: dionysus._dionysus.Zp = Z mod 2, method: str = 'matrix_v') -> object

construct a vineyard state using method=’matrix_v’ or method=’matrix_u’

  1. Vineyard(filtration: dionysus._dionysus.Filtration, field: dionysus._dionysus.Zp = Z mod 2, method: str = 'matrix_v') -> object

construct a vineyard state using method=’matrix_v’ or method=’matrix_u’

vineyard_linear_homotopy(filtration: dionysus._dionysus.Filtration, values0: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], values1: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], field: dionysus._dionysus.Zp = Z mod 2, method: str = 'matrix_v') dionysus._dionysus.VineyardLinearHomotopyResult

compute a vineyard linear homotopy between two filtration functions

class VineyardLinearHomotopyEvent

one adjacent transposition in a vineyard linear homotopy

class VineyardSegment

one linear segment of a persistence vine

class VineyardVine

piecewise-linear persistence vine

class VineyardLinearHomotopyResult

result of a vineyard linear homotopy

Plotting

The following functions live in dionysus.plot module.

plot_diagram(dgm, show=False, labels=False, ax=None, line_style=None, pt_style=None, limits=None)

Plot the persistence diagram.

Parameters:

dgm (Diagram) – See for example init_diagrams.

Keyword Arguments:
  • show (bool) – Display the plot. (Default: False)

  • labels (bool) – Set axis labels. (Default: False)

  • ax (AxesSubplot) – Axes that should be used for plotting (Default: None)

  • pt_style (dict) – argments passed to ax.scatter for style of points.

  • line_style (dict) – argments passed to ax.plot for style of diagonal line.

plot_bars(dgm, order='birth', show=False, ax=None, **bar_style)

Plot the barcode.

Parameters:

dgm (Diagram) – See for example init_diagrams.

Keyword Arguments:
  • order (str) – How to sort the bars, either ‘death’ or ‘birth’ (Default: ‘birth’)

  • show (bool) – Display the plot. (Default: False)

  • ax (AxesSubplot) – Axes that should be used for plotting (Default: None)

  • **bar_style – Arguments passed to ax.plot for style of the bars. (Defaults: color=’b’)

plot_diagram_density(dgm, lognorm=True, diagonal=True, show=False, labels=False, ax=None, **hist_style)

Plot the histogram of point density.

Parameters:

dgm (Diagram) – See for example init_diagrams.

Keyword Arguments:
  • bins (int) – bins for histogram, see ax.hist2d (Default: 200)

  • lognorm (bool) – Use logarithmic norm (Default: True)

  • diagonal (bool) – (Default: True)

  • show (bool) – Display the plot. (Default: False)

  • labels (bool) – Set axis labels. (Default: False)

  • ax (AxesSubplot) – Axes that should be used for plotting (Default: None)

  • **hist_style – Arguments passed to ax.hist2d for style of the histogram. (Defaults: bins=200)

Diagnostics

is_simplicial(f, report=False)

Check if filtration is simplicial. If report = True, output the problems.