steenroder
.barcodes
- steenroder.barcodes(k, filtration, absolute=False, filtration_values=None, return_filtration_values=False, maxdim=None, n_jobs=1, verbose=False)[source]
Given a filtration, compute ordinary persistent (relative or absolute) cohomology barcodes and relative Steenrod barcodes.
- Parameters
k (int) – Positive integer defining the cohomology operation Sq^k to be performed.
filtration (sequence of list-like of int) – Represents a simplex-wise filtration. Entry
i
is a list/tuple/set containing the integer indices of the vertices defining thei
-th simplex in the filtration.absolute (bool, optional, default:
False
) – IfTrue
, return the ordinary persistent absolute homology barcode, and move inessential relative Steenrod bars to one degree lower while keeping essential bars in their degree. IfFalse
, return the ordinary persistent relative cohomology barcode and relative Steenrod barcode.filtration_values (ndarray or None, optional, default: None) – Optionally, a single 1D array of filtration values for each simplex in the filtration. Ordinary and Steenrod bars with equal birth and death filtration values are discarded by the computation.
return_filtration_values (bool, optional, default:
False
) – IfTrue
, birth and deaths will be expressed as filtration values instead of filtration indices. Ignored if filtration_values isNone
.maxdim (int or None, optional, default: None) – Maximum simplex dimension to be included.
None
means that all simplices are included.n_jobs (int, optional, default:
1
) – [Experimental] Controls the number of threads to be used during parallel computation of the Steenrod squares.-1
means using all available physical cores.verbose (bool, optional, default:
False
) – Whether to print timings for the intermediate steps in the computation.
- Returns
barcode (list of ndarray) – For each dimension
d
, a 2D int or float array of shape(n_bars, 2)
containing the births and deaths of persistent relative cohomology classes in degreed
. If absolute isFalse
, the birth of a bar is in entry 1 and the death in entry 0; otherwise, the positions are reversed. Births and death are expressed either as global filtration indices or as filtration values depending on filtration_values and return_filtration_values. If they are expressed as indices, essential bars have death equal to-1
; otherwise, essential bars have death equal tonumpy.inf
.steenrod_barcode (list of ndarray) – The (relative) Sq^k-barcode. For each dimension
d
, a 2D int or float array of shape(n_bars, 2)
containing the birth (entry 1) and death (entry 0) indices of Steenrod bars. The same conventions as for barcode are used for birth and death values.