chalc.morphisms.types¶
Augmented persistence modules and 6-packs of persistence modules.
Classes¶
An \(\mathbb{R}\)-indexed persistence module of \(\mathbb{N}\)-graded vector spaces. |
|
6-pack of persistence modules. |
|
Natural maps between persistence modules, with one-dimensional int64 support arrays. |
|
Birth-death pairings for persistence modules in a 6-pack. |
|
Representative cycles for persistence modules, with one-dimensional int64 support arrays. |
Module Contents¶
- class AugmentedPersistenceModule(
- intervals: collections.abc.Mapping[int, int | None] | None = None,
- entrance_times: collections.abc.Sequence[float] | numpy.ndarray[tuple[int], numpy.dtype[numpy.floating]] = (),
- degrees: collections.abc.Mapping[int, int] | None = None,
An \(\mathbb{R}\)-indexed persistence module of \(\mathbb{N}\)-graded vector spaces.
The module is augmented with (1) a choice of interval basis, where each interval is a pairing between a generator and a relation, (2) a strict linear ordering of the set of all generators and relations, which is compatible with their entrance times.
In particular, each interval is uniquely identified by the integer index of its generator, and distinct integer indices may correspond to elements that have the same entrance time.
- property degrees: types.MappingProxyType[int, int]¶
Return the degrees of interval endpoints.
- property entrance_times: numpy.ndarray[tuple[int], numpy.dtype[numpy.float64]]¶
Return all entrance times of generators/relations in the persistence module.
The entrance times are sorted by generator/relation index.
- interval(birth_index: int | numpy.integer) tuple[float, float]¶
Return the interval with the given birth index.
- intervals(degrees: int | numpy.integer) numpy.ndarray[tuple[int, Literal[2]], numpy.dtype[numpy.float64]]¶
- intervals(degrees: collections.abc.Sequence[int] | IndexArray | None = ...) dict[int, numpy.ndarray[tuple[int, Literal[2]], numpy.dtype[numpy.float64]]]
Get the interval decomposition of the persistence module.
- Parameters:
degrees – Degrees in which the intervals are desired. If a list is provided then a list of matrices is returned, with the order of matrices respecting the order of entries of degree. If degree is not provided then the returned matrix will contain intervals features from all degrees from zero to
max(self.degrees).- Returns:
An \(m \times 2\) matrix whose rows are the endpoints of intervals in the interval decomposition, or a dictionary of such matrices indexed by degree. The rows are sorted by generator index. Degenerate intervals (having zero persistence) are not removed.
- nonempty_degrees() IndexArray¶
Return all inhabited degrees in the persistence module.
- property pairings: types.MappingProxyType[int, int | None]¶
Get the birth-death pairing indices for this module.
- to_hdf5(file: h5py.Group, *, pairings: collections.abc.Mapping[int, int | None] | None = None) None¶
Save interval pairings, endpoint entrance times, and interval degrees.
Infinite deaths are stored as
-1. Degrees are stored in pairing row order. By default, pairings use this module’s endpoint indices. An enclosing 6-pack can supply its original pairings instead, in the same interval order.
- class SixPack(
- *,
- pairings: SixPackPairings | None = None,
- entrance_times: collections.abc.Sequence[float] | numpy.ndarray[tuple[int], numpy.dtype[numpy.floating]] = (),
- degrees: collections.abc.Sequence[int] | numpy.ndarray[tuple[int], numpy.dtype[numpy.integer]] = (),
- representatives: SixPackRepresentatives | None = None,
- morphisms: SixPackMorphisms | None = None,
6-pack of persistence modules.
- __eq__(other: object) bool¶
Check equality of 6-packs.
Checks if all the persistence modules in the 6-packs are equal, with identical interval endpoint metadata.
- __iter__() collections.abc.Iterator[tuple[PersistenceModuleName, AugmentedPersistenceModule]]¶
Iterate over the persistence modules in the 6-pack.
- property codomain: AugmentedPersistenceModule¶
Codomain persistence module.
- property cokernel: AugmentedPersistenceModule¶
Cokernel persistence module.
- property domain: AugmentedPersistenceModule¶
Domain persistence module.
- classmethod from_hdf5(file: h5py.Group) SixPack¶
Load modules, raw pairings, and optional representatives and maps.
Consumer metadata is ignored and initialized to
None. Malformed datasets raiseRuntimeError.
- property image: AugmentedPersistenceModule¶
Image persistence module.
- property kernel: AugmentedPersistenceModule¶
Kernel persistence module.
- max_nonempty_degree() int¶
Get the maximum degree of all features in all persistence modules in the 6-pack.
Returns -1 if all persistence modules in the 6-pack are trivial.
- classmethod module_names() tuple[PersistenceModuleName, ...]¶
Return all six persistence module names in iteration order.
- property morphisms: SixPackMorphisms | None¶
Natural morphisms between modules in the 6-pack.
- property pairings: SixPackPairings¶
Birth-death pairings defining the 6-pack.
- property relative: AugmentedPersistenceModule¶
Relative persistence module.
- property representatives: SixPackRepresentatives | None¶
Representative cycles for intervals in the modules in the 6-pack.
- to_hdf5(file: h5py.Group) None¶
Save modules, raw pairings, and optional representatives and maps.
Each module stores its own endpoint times and interval degrees. Representatives and maps use the same module-local indices as in memory. Consumer metadata is not serialized; consumers may store it separately in the same file or group.
- class SixPackMorphisms¶
Natural maps between persistence modules, with one-dimensional int64 support arrays.
- class SixPackPairings¶
Birth-death pairings for persistence modules in a 6-pack.
- class SixPackRepresentatives¶
Representative cycles for persistence modules, with one-dimensional int64 support arrays.