Introduction¶
PySheaf is a Python module that implements cellular sheaves with a view towards computing useful invariants such as cohomology, consistency radius, and induced maps. It is based on the idea that cell complexes are topological spaces, and that sheaves on cell complexes have at least that structure with some additional information as well. The design follows the principles set out in the following book, which might be helpful to consult:
Michael Robinson, Topological Signal Processing, Springer, 2014.
Although PySheaf can compute (co)homology of sheaves and cell complexes, the primary workflow for sheaves is
- Construct the
Sheaf
instance, which involves defining lists ofSheafCell
andSheafCoface
instances. Presently, theSheaf
instance will remain fixed once constructed. Therefore, make sure to have all stalks and restrictions defined at this point! - If you want to compute cohomology of the
Sheaf
, you can do so using theSheaf.cohomology()
orSheaf.betti()
- Construct various
Section
instances for the data you have. Key point: aSection
refers to a local section. ItsSectionCell
members refer to theSheaf
you’ve just finished building, so you must built theSheaf
first! - Process the data using the
Sheaf
andSection
instances:- You can measure the consistency using
Sheaf.consistencyRadius()
- You can fit a nearest global section using
Sheaf.fuseAssignment()
- You may also use
Section.extend()
- You can measure the consistency using
- If you want to relate your
Sheaf
to others, you may construct aSheafMorphism
instance, which incidentally may also be used as a restriction morphism if you want to build aSheaf
of sheaves!
For cell complexes, you can do steps (1) and (2). Instead of a Sheaf
, you define a CellComplex
built from lists of Cell
and Coface
instances.
PySheaf is very much under active development and exploration, since there aren’t well-established ways of computing using sheaves to process data. Expect some rough edges, but feel free to suggest improvements!