Opened 11 months ago
Closed 11 months ago
#30838 closed enhancement (fixed)
Generators for homology of simplicial complexes
Reported by:  jhpalmieri  Owned by:  

Priority:  major  Milestone:  sage9.3 
Component:  algebraic topology  Keywords:  
Cc:  tscrim  Merged in:  
Authors:  John Palmieri  Reviewers:  Travis Scrimshaw 
Report Upstream:  N/A  Work issues:  
Branch:  a5b41da (Commits, GitHub, GitLab)  Commit:  a5b41da0657cbd5d13a6858f6fa36aefcbac9c0e 
Dependencies:  Stopgaps: 
Description (last modified by )
This is a followup to #6100, and was reported on this ask question. If K
is a simplicial complex, the generators
argument to K.homology(...)
does nothing: K.homology(...)
calls the homology
method for generic cell complexes, which in turn calls _homology_
for simplicial complexes, and that method ignores the generators
keyword.
There is an easy solution: in the generic homology
method, if generators
is True, then don't call _homology_
, just continue in that method. This will give information about chain complex generators. It is possible, although obscure, to extract the simplicial complex information from that.
A better solution: actually do the obscure work, don't force the users to figure it out. That is:
 call
K.chain_complex(generators=True)
, and  use
K._n_cells_sorted()
to convert the chain complex generators (which are just vectors in the corresponding free module over the base ring) to actual chains in the simplicial complex.
Change History (10)
comment:1 Changed 11 months ago by
 Branch set to u/jhpalmieri/homologygenerators
comment:2 Changed 11 months ago by
 Commit set to c1eae33ab0700e3d827ac20ff1a16da9dbd757f6
 Status changed from new to needs_review
comment:3 Changed 11 months ago by
 Commit changed from c1eae33ab0700e3d827ac20ff1a16da9dbd757f6 to 8ca6c0e907aa4f5977d8f8d69883c5960a3ca043
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
8ca6c0e  trac 30838: compute generators for homology of simplicial complexes,

comment:4 Changed 11 months ago by
 Commit changed from 8ca6c0e907aa4f5977d8f8d69883c5960a3ca043 to a5b41da0657cbd5d13a6858f6fa36aefcbac9c0e
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
a5b41da  trac 30838: compute generators for homology of simplicial complexes,

comment:5 Changed 11 months ago by
Before this branch:
sage: simplicial_complexes.Sphere(2).homology(generators=True) {0: 0, 1: 0, 2: Z} sage: cubical_complexes.Sphere(2).homology(generators=True) {0: [], 1: [], 2: [(Z, Chain(2:(1, 1, 1, 1, 1, 1)))]} sage: simplicial_sets.Sphere(2).homology(generators=True) {0: [], 1: 0, 2: [(Z, Chain(2:(1)))]}
Note that no generators are given at all in the simplicial complex case. In the other cases, the answers are given in terms of the chain groups.
After:
sage: simplicial_complexes.Sphere(2).homology(generators=True) {0: [], 1: [], 2: [(Z, (0, 1, 2)  (0, 1, 3) + (0, 2, 3)  (1, 2, 3))]} sage: cubical_complexes.Sphere(2).homology(generators=True) {0: [], 1: [], 2: [(Z, [0,0] x [0,1] x [0,1]  [0,1] x [0,0] x [0,1] + [0,1] x [0,1] x [0,0]  [0,1] x [0,1] x [1,1] + [0,1] x [1,1] x [0,1]  [1,1] x [0,1] x [0,1])]} sage: simplicial_sets.Sphere(2).homology(generators=True) {0: [], 1: 0, 2: [(Z, sigma_2)]}
comment:6 Changed 11 months ago by
 Cc tscrim added
comment:7 Changed 11 months ago by
 Description modified (diff)
comment:8 Changed 11 months ago by
 Reviewers set to Travis Scrimshaw
 Status changed from needs_review to positive_review
LGTM.
comment:9 Changed 11 months ago by
Thanks very much.
comment:10 Changed 11 months ago by
 Branch changed from u/jhpalmieri/homologygenerators to a5b41da0657cbd5d13a6858f6fa36aefcbac9c0e
 Resolution set to fixed
 Status changed from positive_review to closed
New commits:
trac 30838: compute generators for homology of simplicial complexes,