How to extract coordinate tuples of homology generators from a simplicial complex?
I am trying to extract the generators of the homology of a simplicial complex using SageMath. The only way I currently know to do this is to first convert the simplicial complex into a chain complex, and then compute the homology with generators. For example,
K = SimplicialComplex([[0, 1], [1, 2], [2, 0]])
CC = K.chain_complex()
d = CC.homology(generators=True)
print(d)
This returns the output:
{0: [(Z, Chain(0:(0, 1, 0)))], 1: [(Z, Chain(1:(1, -1, 1)))]}
I would like to extract just the coordinate tuple from the generator — for instance, from Chain(1:(1, -1, 1)), I want to extract the tuple (1, -1, 1). I know that the output is a dictionary. Using the following command
d[1][0][1]
I get
Chain(1:(1, -1, 1))
What is the proper way to access or extract this tuple of coefficients from the Chain object? Any help would be appreciated!