Ask Your Question
1

Rank of Homology Groups?

asked 2024-05-29 19:38:56 +0100

WinterStorm7 gravatar image

I'm trying to compute Magnitude Homology, but when compiling and running the code I keep getting the error: 'HomologyGroup_class_with_category' object has no attribute 'rank.'

I've tried other methods for trying to compute the rank of the Homology Groups, but it's the same thing. Not all the typical functions used for Abelian Groups carries over to Homology in sagemath. The only functions I've found that work are .ngens(), .invariants(), .gens(), and .order().

Can someone please explain to me how to find the rank of the Homology groups I'm trying to work with? I'm looking for torsion, so any explanation on how to work with these will be a big help!

PM

edit retag flag offensive close merge delete

Comments

Please provide an actual code illustrating the issue.

Max Alekseyev gravatar imageMax Alekseyev ( 2024-05-29 22:17:22 +0100 )edit

You could define any simplicial complex "C" and then ask for C.rank() and this will get you the error. Other functions like C.ngens(), C.invariants(), and C.gens() will work but an error always shows up for C.rank().

WinterStorm7 gravatar imageWinterStorm7 ( 2024-05-29 22:40:11 +0100 )edit
FrédéricC gravatar imageFrédéricC ( 2024-05-30 07:43:25 +0100 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2024-05-29 22:20:32 +0100

You can use the invariants method:

sage: K = simplicial_complexes.KleinBottle()
sage: H = K.homology(1)
sage: H.invariants()
(2, 0)
sage: T3 = simplicial_complexes.SurfaceOfGenus(3)
sage: T3.homology(1)
Z^6
sage: T3.homology(1).invariants()
(0, 0, 0, 0, 0, 0)

If you want the rank, count how many zeroes are in this list. If you want the torsion, look at the nonzero entries.

sage: T3.homology(1).invariants().count(0)
6

sage: H
Z x C2
sage: [x for x in H.invariants() if x > 0]
[2]
edit flag offensive delete link more

Comments

Ah, thank you this helps a lot!

WinterStorm7 gravatar imageWinterStorm7 ( 2024-05-29 22:38:37 +0100 )edit
1

also one can work over QQ

sage: C=simplicial_complexes.Sphere(4)
sage: h = C.homology(base_ring=QQ)
sage: h[4].dimension()
1
FrédéricC gravatar imageFrédéricC ( 2024-05-30 21:12:02 +0100 )edit

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: 2024-05-29 19:38:56 +0100

Seen: 237 times

Last updated: May 29