Page 1 of 1

Homology

Posted: 27 Mar 2013, 18:35
by ramanath
I am working with a simplicial complex, and would like to print out just a particular homology group. Doing ->HOMOLOGY prints all the groups, and for a large dimension complex one has lots of 0's.

I see that one can do $sc->F2_VECTOR->(2,2) etc. to access particular values, is there something similar like for Homology? (I tried a couple obvious parallels, but didn't work). Any tips/tricks?

Basically I want to print out the Betti number sequence.

Thanks

-Ram

Re: Homology

Posted: 27 Mar 2013, 19:34
by joswig
The data type of the HOMOLOGY property is a bit special; actually it is Array<HomologyGroup<Integer>>. This is how you can address an individual group:

Code: Select all

topaz > $rp2=projective_plane(); topaz > print $rp2->HOMOLOGY->[1]; {(2 1)} 0
Each homology group more or less works like an array (of a pair and a number); the rational Betti number is the latter.

Code: Select all

topaz > print $rp2->HOMOLOGY->[1]->[0]; {(2 1)} topaz > print $rp2->HOMOLOGY->[1]->[1]; 0
You can also play with the torsion and its degree.

Code: Select all

topaz > print $rp2->HOMOLOGY->[1]->[0]->[0]; 2 1 topaz > print $rp2->HOMOLOGY->[1]->[0]->[0]->[0]; 2

Re: Homology

Posted: 27 Mar 2013, 19:55
by ramanath
Exactly what I need, thanks very much!

Ram

Re: Homology

Posted: 27 Mar 2013, 22:26
by gawrilow
For convenience, there are also named accessors:

Code: Select all

print $sc->HOMOLOGY->[$dim]->torsion; print $sc->HOMOLOGY->[$dim]->betti_number;
With some luck, polymake will even auto-TAB-complete these names on the command line.

Re: Homology

Posted: 28 Mar 2013, 01:00
by ramanath
Indeed, that is convenient!

Is there documentation some place to see what other nice features like this is out there that I might be missing? I am primarily interested in features of simplicial complexes (topaz). I had searched for Betti numbers under documentation before but didn't find any.

Thank you.

-Ram

Re: Homology

Posted: 28 Mar 2013, 10:57
by gawrilow
The reference documentation for property type HomologyGroup (linked from HOMOLOGY property) briefly lists the field names, albeit without further explanation. Admittedly, there is still room for improvement.