Ask Your Question

Revision history [back]

If you just want homology generators, this works for me:

sage: K = SimplicialComplex([[0, 1], [1, 2], [2, 0]])
sage: K.set_immutable()
sage: K.homology(generators=True)
{0: [], 1: [(Z, (0, 1) - (0, 2) + (1, 2))]}

If you want to use the associated chain complex, the documentation obtained by K.chain_complex? says

The rows and columns of the boundary matrices are indexed by the lists
given by the "_n_cells_sorted()" method, which by default are sorted.

So you should look at

sage: K._n_cells_sorted(1)
[(0, 1), (0, 2), (1, 2)]

The ordered list of coefficients 1, -1, and 1 can be extracted by using:

sage: CC = K.chain_complex()
sage: d = CC.homology(1, generators=True)
sage: c = d[0][1]
sage: c
Chain(1:(1, -1, 1))
sage: c._vec
{1: (1, -1, 1)}
sage: c._vec[1]
(1, -1, 1)