First time here? Check out the FAQ!

Ask Your Question
1

Rank of Homology Groups?

asked 0 years ago

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

Preview: (hide)

Comments

Please provide an actual code illustrating the issue.

Max Alekseyev gravatar imageMax Alekseyev ( 0 years ago )

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 ( 0 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 0 years ago

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]
Preview: (hide)
link

Comments

Ah, thank you this helps a lot!

WinterStorm7 gravatar imageWinterStorm7 ( 0 years ago )
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 ( 0 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: 0 years ago

Seen: 268 times

Last updated: May 29 '24