First time here? Check out the FAQ!

Ask Your Question
2

Generators of simplicial homology

asked 4 years ago

springfieldgion gravatar image

updated 2 years ago

tmonteil gravatar image

I have this code to compute the homology of a simplicial complex

S = SimplicialComplex([[5, 2], [5, 2, 1], [5, 0], [5, 1], [4, 3], [4, 3, 0], [4, 2], [4, 0], [3, 0], [3, 1], [2, 1],])
S.homology(generators = True)

The output only consists of the homology, and does not contain the generators. Am I missing something?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 4 years ago

This looks like a missing feature and/or a bug. Note that the documentation for S.homology() says, regarding generators:

Since trac ticket #6100, the result may not be what you expect when not using CHomP since its return is in terms of the chain complex.

The bug is that there is no result at all, but you can recover it by doing:

sage: S.chain_complex().homology(generators=True)
{0: [(Z, Chain(0:(0, 0, 0, 1, 0, 0)))],
 1: [(Z, Chain(1:(0, 1, -1, 0, 0, 0, -1, 1, 0))),
  (Z, Chain(1:(0, 0, 0, 0, 1, -1, -1, 1, 1)))],
 2: []}

To interpret this, you need to know how the simplicial complex is turned into a chain complex. The simplices in each dimension are sorted in order to construct the matrices representing the boundary maps, so to get the first generator in dimension 1, for example, you would look at

sage: S._n_cells_sorted(1)                                                                
[(0, 3), (0, 4), (0, 5), (1, 2), (1, 3), (1, 5), (2, 4), (2, 5), (3, 4)]

The first generator is given by (0, 1, -1, 0, 0, 0, -1, 1, 0), which means the sum of 1 x (item 1 in list), -1 x (item 2), etc.:

(0, 4) - (0, 5) - (2, 4) + (2, 5)
Preview: (hide)
link

Comments

This is perfect, thank a lot!

springfieldgion gravatar imagespringfieldgion ( 4 years ago )
1

I don't think it's perfect — it should be fixed — but I'm glad it's helpful.

John Palmieri gravatar imageJohn Palmieri ( 4 years ago )
1

This problem is being tracked at https://trac.sagemath.org/ticket/30838.

John Palmieri gravatar imageJohn Palmieri ( 4 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 4 years ago

Seen: 956 times

Last updated: Oct 29 '20