The Python cohomology computation illustrates the use of CohomologyPersistence.
Initializes CohomologyPersistence with the given prime; from
this point on all the computation will be performed with coefficients
coming from
.
Adds a simplex with the given boundary to the complex, i.e.
and boundary =
.
If a new class is born as a result of the addition, birth is stored with
it for future reference.
If store is False and a class is born, it will not be stored in CohomologyPersistence. This is useful to not waste space on the classes of the dimension equal to the maximum-dimensional simplices of the complex since such classes will never die.
The image parameter allows one to work with a case of a space
where the filtration of
induces a
filtration of
. In this case, one may want to compute image
persistence (i.e. the persistence of the sequences of the images given
by the inclusion of
in
). image indicates whether
the simplex added belongs to
or not.
If given, coefficients is a list parallel to boundary that provides
coefficients for the corresponding boundary elements. If empty, it is
assumed to be
.
| Returns: | a pair (i, d). The first element is the index i. It is the internal representation of the newly added simplex, and should be used later for removal or when constructing the boundaries of its cofaces. In other words, boundary must consist of these indices. The second element d is the death element. It is None if a birth occurred, otherwise it contains the value passed as birth to add() when the class that just died was born. |
|---|
Iterator over the live cocycles stored in CohomologyPersistence. The returned elements are of the type Cocycle below.
The birth value associated with the cocycle. It is passed to CohomologyPersistence in method add().
The index of the simplex, of type CHSimplexIndex.
Coefficient in
associated with the
simplex.
The count associated with the simplex when it is inserted into CohomologyPersistence.