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

Commit

Permalink
Add doctest for cohomology_generators
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmarco committed Jan 23, 2019
1 parent f29f168 commit 270b5d3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/sage/algebras/commutative_dga.py
Expand Up @@ -2206,6 +2206,15 @@ def cohomology_generators(self, max_degree):
sage: acyclic = X.cdg_algebra({x: y})
sage: acyclic.cohomology_generators(3)
{}
Test that redundant generators are eliminated::
sage: A.<e1,e2,e3,e4> = GradedCommutativeAlgebra(QQ)
sage: d = A.differential({e1:e4*e3,e2:e4*e3})
sage: B = A.cdg_algebra(d)
sage: B.cohomology_generators(3)
{1: [e4, e3, -e1 + e2], 2: [e2*e4, e2*e3]}
"""
if not (max_degree in ZZ and max_degree > 0):
raise ValueError("the given maximal degree must be a positive integer")
Expand Down

0 comments on commit 270b5d3

Please sign in to comment.