Ask Your Question
1

homology of simplicial complexes

asked 2013-03-24 17:40:49 +0200

updated 2023-01-10 00:01:09 +0200

tmonteil gravatar image

I am building a simplicial complex as follows:

sage: S = range(1,7)
sage: Z = SimplicialComplex([S])
sage: T = Z.n_skeleton(1)
sage: T.faces()
{0: set([(4,), (5,), (3,), (1,), (6,), (2,)]), 1: set([(2, 4), (3, 6),
(5, 6), (2, 6), (1, 4), (3, 5), (3, 4), (2, 3), (4, 6), (2, 5), (1, 2),
(1, 3), (4, 5), (1, 5), (1, 6)]), -1: set([()])}
sage: T.homology()
{0: 0, 1: Z^10}

So far everything seems good. Then I try adding a face to T.

sage: T.add_face([1,2,6])
sage: T.faces()
{0: set([(4,), (5,), (3,), (1,), (6,), (2,)]), 1: set([(2, 4), (3, 6),
(5, 6), (1, 5), (1, 4), (3, 5), (3, 4), (2, 3), (4, 6), (2, 5), (1, 2),
(1, 3), (1, 6), (2, 6), (4, 5)]), 2: set([(1, 2, 6)]), -1: set([()])}

So the face seems to have been added.

But then:

sage: T.homology()

results in:

{0: 0, 1: Z^10, 2: 0}

But this doesn't make any sense --- it should say 0:0, 1:Z^9, 2:0, since adding a 2-face kills a class in $H_1(T)$.

Can anyone tell what I'm doing wrong?

edit retag flag offensive close merge delete

Comments

1

[2015-01-05: Just fixed code formatting of this 2013 question. By the way, the patch from ticket #14354 mentioned in John Palmieri's answer was merged in Sage 5.9.beta2, and running the example in the question now gives the correct answer.] [Matt: you could mark John's answer as accepted by clicking the tick mark.]

slelievre gravatar imageslelievre ( 2015-01-05 11:26:00 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-03-25 01:54:54 +0200

updated 2013-03-25 02:02:05 +0200

There's a bug in the add_face method. Various information about simplicial complexes is cached, especially when computing homology, and when you call add_face, it doesn't modify that cached information, so the homology computation is for the old complex, not the new one. See here for a patch. Meanwhile, as a workaround, do

sage: T.add_face([1,2,6])
sage: T1 = SimplicialComplex(T.facets())

Then T1 will have the correct facets but no cached data, so its homology will be correct.

edit flag offensive delete link more

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: 2013-03-24 17:40:49 +0200

Seen: 365 times

Last updated: Jan 05 '15