#### Re: dionysus Wasserstein distances

nukpezah@...

Hi Dmitri
I also have a question about the Wassertein distances. I have 21 different NMR structures of the same protein and I am trying to compute the pairwise wasserstein distances in dimension 0, dimension 1, and dimension 2.  I lable the persistence diagrams  of the different NMR structures as dgms1, dgms2, dgms3,....., dgms21. I can compute the  dimension 0 distance between dgms1 and the 21 peristence diagrams in the following code;
j = 0 #compute the zero dimensional wasserstein distances
A0 = np.array([])
A0 =np.append(A0, d.wasserstein_distance(dgms1[j], dgms1[j], q=2))
A0 =np.append(A0, d.wasserstein_distance(dgms1[j], dgms2[j], q=2))
A0 =np.append(A0, d.wasserstein_distance(dgms1[j], dgms3[j], q=2))
A0 =np.append(A0, d.wasserstein_distance(dgms1[j], dgms4[j], q=2))
A0 =np.append(A0, d.wasserstein_distance(dgms1[j], dgms5[j], q=2))
A0 =np.append(A0, d.wasserstein_distance(dgms1[j], dgms6[j], q=2))
A0 =np.append(A0, d.wasserstein_distance(dgms1[j], dgms7[j], q=2))
A0 =np.append(A0, d.wasserstein_distance(dgms1[j], dgms8[j], q=2))
A0 =np.append(A0, d.wasserstein_distance(dgms1[j], dgms9[j], q=2))
A0 =np.append(A0, d.wasserstein_distance(dgms1[j], dgms10[j], q=2))
A0 =np.append(A0, d.wasserstein_distance(dgms1[j], dgms11[j], q=2))
A0 =np.append(A0, d.wasserstein_distance(dgms1[j], dgms12[j], q=2))
A0 =np.append(A0, d.wasserstein_distance(dgms1[j], dgms13[j], q=2))
A0 =np.append(A0, d.wasserstein_distance(dgms1[j], dgms14[j], q=2))
A0 =np.append(A0, d.wasserstein_distance(dgms1[j], dgms15[j], q=2))
A0 =np.append(A0, d.wasserstein_distance(dgms1[j], dgms16[j], q=2))
A0 =np.append(A0, d.wasserstein_distance(dgms1[j], dgms17[j], q=2))
A0 =np.append(A0, d.wasserstein_distance(dgms1[j], dgms18[j], q=2))
A0 =np.append(A0, d.wasserstein_distance(dgms1[j], dgms19[j], q=2))
A0 =np.append(A0, d.wasserstein_distance(dgms1[j], dgms20[j], q=2))
A0 =np.append(A0, d.wasserstein_distance(dgms1[j], dgms21[j], q=2))
A0
and it gives me the result in the jupyter notebook as
```array([0.        , 0.86897045, 0.86734861, 0.87343866, 0.68319196,
0.86747402, 0.86989343, 0.86605436, 0.86735857, 0.85884637,
0.86786294, 0.87749594, 0.86279768, 0.86108643, 0.8721627 ,
0.87351388, 0.86195225, 0.87039518, 0.86997241, 0.86407465,
0.87141883])But when I try to compute the dimension 0 wasserstein distance between dgms2 and the 21 structures as in the following code below, it keeps running withiout giving me any result; I wonder if it has something to to do with the data type of dgms?j=0A1 = np.array([])
A1 =np.append(A1, d.wasserstein_distance(dgms2[j], dgms1[j], q=2))
A1 =np.append(A1, d.wasserstein_distance(dgms2[j], dgms2[j], q=2))
A1 =np.append(A1, d.wasserstein_distance(dgms2[j], dgms3[j], q=2))
A1 =np.append(A1, d.wasserstein_distance(dgms2[j], dgms4[j], q=2))
A1 =np.append(A1, d.wasserstein_distance(dgms2[j], dgms5[j], q=2))
A1 =np.append(A1, d.wasserstein_distance(dgms2[j], dgms6[j], q=2))
A1 =np.append(A1, d.wasserstein_distance(dgms2[j], dgms7[j], q=2))
A1 =np.append(A1, d.wasserstein_distance(dgms2[j], dgms8[j], q=2))
A1 =np.append(A1, d.wasserstein_distance(dgms2[j], dgms9[j], q=2))
A1 =np.append(A1, d.wasserstein_distance(dgms2[j], dgms10[j], q=2))
A1 =np.append(A1, d.wasserstein_distance(dgms2[j], dgms11[j], q=2))
A1 =np.append(A1, d.wasserstein_distance(dgms2[j], dgms12[j], q=2))
A1 =np.append(A1, d.wasserstein_distance(dgms2[j], dgms13[j], q=2))
A1 =np.append(A1, d.wasserstein_distance(dgms2[j], dgms14[j], q=2))
A1 =np.append(A1, d.wasserstein_distance(dgms2[j], dgms15[j], q=2))
A1 =np.append(A1, d.wasserstein_distance(dgms2[j], dgms16[j], q=2))
A1 =np.append(A1, d.wasserstein_distance(dgms2[j], dgms17[j], q=2))
A1 =np.append(A1, d.wasserstein_distance(dgms2[j], dgms18[j], q=2))
A1 =np.append(A1, d.wasserstein_distance(dgms2[j], dgms19[j], q=2))
A1 =np.append(A1, d.wasserstein_distance(dgms2[j], dgms20[j], q=2))
A1 =np.append(A1, d.wasserstein_distance(dgms2[j], dgms21[j], q=2))
A1Thanks for your help.SincerelyJonathan```

Join dionysus@groups.io to automatically receive all group messages.