Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Trac #31669: add differentials to category
Browse files Browse the repository at this point in the history
  • Loading branch information
mjungmath committed Apr 19, 2021
1 parent 718d354 commit 98e3ed6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/sage/categories/chain_complexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,30 @@ def homology(self, *args, **kwargs):
"""
raise NotImplementedError

def differential(self, *args, **kwargs):
r"""
Return the differentials (or boundary maps) of the chain complex.
EXAMPLES::
sage: C = ChainComplex({0: matrix(ZZ, 2, 3, [3, 0, 0, 0, 0, 0])})
sage: C.differential(0)
[3 0 0]
[0 0 0]
::
sage: A.<x,y,z> = GradedCommutativeAlgebra(QQ, degrees=(2, 2, 3))
sage: C = A.cdg_algebra({z: x*y})
sage: C.differential()
Differential of Commutative Differential Graded Algebra with generators ('x', 'y', 'z') in degrees (2, 2, 3) over Rational Field
Defn: x --> 0
y --> 0
z --> x*y
"""
raise NotImplementedError

class MorphismMethods:
def induced_homology_morphism(self, *args, **kwargs):
r"""
Expand Down
1 change: 1 addition & 0 deletions src/sage/homology/chain_complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,7 @@ def differential(self, dim=None):
except KeyError:
pass
# all differentials that are not 0x0 are in self._diff
# TODO: turn differentials into morphisms between free modules?
return matrix(self.base_ring(), 0, 0)

def dual(self):
Expand Down

0 comments on commit 98e3ed6

Please sign in to comment.