#### Picking Generators of Homology

nukpezah@...

Hi
I have a question about picking generators of homology represented in the barcodes. I understand that the homology generators are equivalence classes of non boundary cycles, so we can only pick a representative. In Dionysus, the persistence_homology class gives us the reduced representation of the boundary matrix from which I presume we can read off the homology generators. But I am confused about how to do that. In my understanding, we have some ordering of the simplices in the filtration, hence the columns of reduced boundary matrices gives you the indexed simplices that give you the generators? But it does not tell you the actual collection of vertices that generate the indexed simplices in the reduced boundary matrix? I guess I am confused about this code on the site shown below; how do you read from this code that the simplex [o,1,2] is a homology generator for H1( one homology). Thanks
Jon
```>>> m = d.homology_persistence(f)
>>> for i,c in enumerate(m):
...     print(i, c)
0
1
2 1*0 + 1*1
3
4 1*1 + 1*3
5```

Dmitriy Morozov

There are two things at work here. First of all, by default, Dionysus computes generators only for finite bars. So the 1-dimensional cycle, the boundary of [0,1,2] is never computed. If the triangle was in that filtration, then you'd have a pair (5,6) and 6 would store the cycle consisting of the three edges.

The cycles are stored in terms of indices in the filtration, so to translate them into simplices, you need to look them up in the filtration. So, for example, you could change the loop above to:

for i,c in enumerate(m):
print(f[i],end=': ')
print(" + ".join(["%d * %s" % (x.element, f[x.index]) for x in c]))

In other words, the elements of c have members element and index that tell you what the coefficient is and where the simplex is in the filtration.

I hope it helps.
Dmitriy

On Wed, Aug 15, 2018 at 7:42 PM, wrote:
Hi
I have a question about picking generators of homology represented in the barcodes. I understand that the homology generators are equivalence classes of non boundary cycles, so we can only pick a representative. In Dionysus, the persistence_homology class gives us the reduced representation of the boundary matrix from which I presume we can read off the homology generators. But I am confused about how to do that. In my understanding, we have some ordering of the simplices in the filtration, hence the columns of reduced boundary matrices gives you the indexed simplices that give you the generators? But it does not tell you the actual collection of vertices that generate the indexed simplices in the reduced boundary matrix? I guess I am confused about this code on the site shown below; how do you read from this code that the simplex [o,1,2] is a homology generator for H1( one homology). Thanks
Jon
```>>> m = d.homology_persistence(f)
>>> for i,c in enumerate(m):
...     print(i, c)
0
1
2 1*0 + 1*1
3
4 1*1 + 1*3
5```

nukpezah@...

Hi Dmitriy
Thanks for your quick response. I think I understand what you meant. I run the code and could see where the simplices representing the homology generators were in the filtration. I assume that the coefficient 1 I am getting in the code comes from the reduced representation. I will try that for a protein point cloud that I am working on and see if I can make sense of it for the data I have.  I may ask some further questions then for clarification. Thanks again
Jonathan

nukpezah@...

Hi Dmitriy
I apologize for the insistent bother. I finally got to applying this to my protein cloud problem. I changed the code slightly to express the elements of the cycle as a list of tuples with each tuple comprising the coefficient and the actual simplex with its radius using the Vietoris-Rips filtration. The lists typically look like this;
<93,96,108> 2.14463:[(1, <96,108> 1.07808), (1, <93,96> 1.53489), (1, <93,108> 2.14463)]. ( I observed that the code stores the cycle represented by the list in the filtration at the point where the two-simplex <93,96,108> 2.14463 appears)
I understand from the code that this is a cycle which appears in the filtration when the one-simplex <93,108> 2.14463 appears. My question is that I am unable to connect these cycles to the H1 persistence barcodes which I show below (my cutoff distance in the rips filtration is 6 and the skeleton dimension is 3)

For the cycle above, how can I tell where it appears and where it dies. Does it appear at distance 2.14463? Thanks
Jonathan

Dmitriy Morozov

Hi Jonathan,

The particular cycle that you picked appears and dies at 2.14463 -- it's a 0-persistence cycle. In general, the cycle appears at the highest value of its 1-simplices and dies at the value of the 2-simplex with which it is associated.

I hope it helps.
Dmitriy

On Tue, Sep 4, 2018 at 12:30 PM, wrote:
Hi Dmitriy
I apologize for the insistent bother. I finally got to applying this to my protein cloud problem. I changed the code slightly to express the elements of the cycle as a list of tuples with each tuple comprising the coefficient and the actual simplex with its radius using the Vietoris-Rips filtration. The lists typically look like this;
<93,96,108> 2.14463:[(1, <96,108> 1.07808), (1, <93,96> 1.53489), (1, <93,108> 2.14463)]. ( I observed that the code stores the cycle represented by the list in the filtration at the point where the two-simplex <93,96,108> 2.14463 appears)
I understand from the code that this is a cycle which appears in the filtration when the one-simplex <93,108> 2.14463 appears. My question is that I am unable to connect these cycles to the H1 persistence barcodes which I show below (my cutoff distance in the rips filtration is 6 and the skeleton dimension is 3)

For the cycle above, how can I tell where it appears and where it dies. Does it appear at distance 2.14463? Thanks
Jonathan

nukpezah@...

Hi Dmitry
Yes it helps. It clarifies things for me. Thanks again.
Sincerely
Jonathan