chalc.sixpack.types¶
Implementation of a 6-pack of persistence diagrams.
Classes¶
Persistence diagram represented by paired and unpaired simplices. |
|
6-pack of persistence diagrams. |
Module Contents¶
- class SimplexPairings(paired: collections.abc.Collection[tuple[int, int]] = set(), unpaired: collections.abc.Collection[int] = set())¶
Bases:
digraph inheritancea3cfdb496f { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "Collection" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "Sized" -> "Collection" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Iterable" -> "Collection" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Container" -> "Collection" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Container" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "Iterable" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "SimplexPairings" [URL="#chalc.sixpack.types.SimplexPairings",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Persistence diagram represented by paired and unpaired simplices."]; "Collection" -> "SimplexPairings" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Sized" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; }collections.abc.Collection
Persistence diagram represented by paired and unpaired simplices.
- __contains__(feature: object) bool ¶
Return true if a feature is in the diagram.
The feature to check should be either a pair of simplices (int, int) or a single simplex (int).
- __iter__() collections.abc.Iterator[tuple[int, int] | int] ¶
Iterate over all features in the diagram.
- paired_as_matrix() numpy.ndarray[tuple[int, Literal[2]], numpy.dtype[numpy.int64]] ¶
Return a matrix representation of the finite persistence features in the diagram.
- class SixPack(
- kernel: SimplexPairings | None = None,
- cokernel: SimplexPairings | None = None,
- domain: SimplexPairings | None = None,
- codomain: SimplexPairings | None = None,
- image: SimplexPairings | None = None,
- relative: SimplexPairings | None = None,
- entrance_times: collections.abc.Sequence[float] = [],
- dimensions: collections.abc.Sequence[int] = [],
Bases:
digraph inheritancef35d1a9f87 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "Collection" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "Sized" -> "Collection" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Iterable" -> "Collection" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Container" -> "Collection" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Container" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "Iterable" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "Mapping" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="A Mapping is a generic container for associating key/value"]; "Collection" -> "Mapping" [arrowsize=0.5,style="setlinewidth(0.5)"]; "SixPack" [URL="#chalc.sixpack.types.SixPack",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="6-pack of persistence diagrams."]; "Mapping" -> "SixPack" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Sized" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; }collections.abc.Mapping
6-pack of persistence diagrams.
- __getitem__(key: DiagramName) SimplexPairings ¶
Access a specific diagram in the 6-pack.
- __iter__() collections.abc.Iterator[DiagramName] ¶
Iterate over all diagrams in the 6-pack.
- property dimensions: numpy.ndarray[tuple[int], numpy.dtype[numpy.int64]]¶
Dimensions of the simplices.
- property entrance_times: numpy.ndarray[tuple[int], numpy.dtype[numpy.float64]]¶
Entrance times of the simplices.
- classmethod from_file(file: h5py.Group) SixPack ¶
Load a 6-pack of persistence diagrams from a HDF5 file or group.
- Parameters:
file – A h5py file or group.
- get_matrix(diagram_name: DiagramName, dimension: int) numpy.ndarray[tuple[int, Literal[2]], numpy.dtype[numpy.float64]] ¶
- get_matrix(diagram_name: DiagramName, dimension: list[int] | None = None) list[numpy.ndarray[tuple[int, Literal[2]], numpy.dtype[numpy.float64]]]
Get a specific diagram as a matrix of birth and death times.
- Parameters:
diagram_name – One of
'ker'
,'cok'
,'dom'
,'cod'
,'im'
, or'rel'
.dimension – Dimension(s) of the diagram desired. If a list is provided then a list of matrices is returned, with the order of matrices respecting the order of entries of dim. If dimension is not provided then the returned matrix will contain persistent features from all homological dimensions from zero to
max(self.dimensions)
.
- Returns:
An \(m \times 2\) matrix whose rows are a pair of birth and death times, or a list of such matrices.
- items() collections.abc.ItemsView[DiagramName, SimplexPairings] ¶
View of the diagrams in the 6-pack.
- keys() collections.abc.KeysView[DiagramName] ¶
View of the names of the diagrams in the 6-pack.
- save(file: h5py.Group) None ¶
Save a 6-pack of persistence diagrams to a HDF5 file or group.
- Parameters:
file – A h5py file or group.
- values() collections.abc.ValuesView[SimplexPairings] ¶
View of the diagrams in the 6-pack.