generics

generics

Functions

Name Description
boundary Returns the boundary of a simplicial object, optionally signed.
card Counts the number of p-dimensional simplices of a simplicial object s.
dim Returns the dimension of a simplicial object.
faces Returns the faces of a simplicial object, optionally restricted by dimension.
handle_data

boundary

generics.boundary(s, p=None, oriented=False, **kwargs)

Returns the boundary of a simplicial object, optionally signed.

If s has an existing method s.boundary(p, oriented), then that method is called with additional keyword args kwargs.

Otherwise, the behavior of this function depends on the type-class of s. Namely, - if s is SimplexLike with dimension p, then a generator enumerating (p-1)-faces of s is created. - if s is ComplexLike, then a sparse boundary matrix whose columns represent boundary chains is returned. - if s is FiltrationLike, then a sparse boundary matrix whose columns represent boundary chains in filtration order is returned. - if s is none of the above but is Sized and Iterable, all len(s)-1 combinations are returned of s are returned.

TODO: finish this

card

generics.card(s, p=None, **kwargs)

Counts the number of p-dimensional simplices of a simplicial object s.

If s has an existing method s.card(p), then that method is called with additional keyword arguments kwargs.

Otherwise, the behavior of this function depends on the type-class of s and whether p is specified. Namely, - If s is complex like, then card(s) returns a tuple containing the number of simplices in s in each dimension, and card(s, p) the number of simplices in s with dimension p.

dim

generics.dim(s, **kwargs)

Returns the dimension of a simplicial object.

If s has an existing method s.dim(…), then that method is called with additional keyword arguments kwargs.

Otherwise, the behavior of this function depends on the type-class of s. Namely, - if s is SimplexLike with dimension p, then p is returned. - if s is ComplexLike, then the largest dimension p of any face in s is returned. - if s is none of the above but is Sized, len(s) - 1 is returned.

faces

generics.faces(s, p=None, data=False, **kwargs)

Returns the faces of a simplicial object, optionally restricted by dimension.

If s has an existing method s.faces(p), then that method is called with additional keyword arguments kwargs.

Otherwise, the behavior of this function depends on the type-class of s. Namely, - if s is SimplexLike, then a generator enumerating p-combinations of s is returned. - if s is ComplexLike, then a generator enumerating p-faces of s (in any order) is returned. - if s is FiltrationLike, then a generator enumerating p-faces of s in filtration order is returned. - if s is none of the above but is Sized and Iterable, all combinations of s of length p+1 are chained and returned.

handle_data

generics.handle_data(g, data)