Degree Rips bifiltrations

Note. I’m not satisfied with this interface, so it may be subject to change.

import numpy as np
import gudhi as gd
from multipers.plots import plot_signed_measures, plot_surfaces
import multipers as mp
from multipers.function_rips import get_degree_rips,function_rips_surface, function_rips_signed_measure
import matplotlib.pyplot as plt
from multipers.data import three_annulus, noisy_annulus
X = three_annulus(1000,500)
degrees = np.linspace(0,500,100, dtype=int)
st = gd.RipsComplex(points=X, max_edge_length=1.2).create_simplex_tree()
st_multi, max_degree = get_degree_rips(st,degrees=degrees, grid_strategy="regular_closest", resolution=200)
plt.scatter(*X.T)
plt.gca().set_aspect(1)
../_images/9233b1159b3c61b2a502c34845f85e75c4b1bbd69aefb3ab6dbf345d9b1ab6c4.png
sms = function_rips_signed_measure(st_multi, homological_degrees= [0,1], mobius_inversion=True, zero_pad=False)
plot_signed_measures(sms)
../_images/19a9e5104c3eb34343a2988d658aa96da7e57f33d8077e990b6629d71c7e594f.png
from multipers.ml.signed_measures import SignedMeasureFormatter
sms_, = SignedMeasureFormatter(normalize=True).fit_transform([sms])
plot_signed_measures(sms_)
../_images/3ca91444f141363d42ccafe256c2bf6adb3c6e51e1a6771650baef242f782f8b.png
from multipers.ml.signed_measures import SignedMeasure2Convolution
imgs = SignedMeasure2Convolution(bandwidth=.01, plot=True, grid_strategy="regular_closest", resolution=500, kernel="gaussian").fit_transform([sms_])
[KeOps] Warning : Cuda libraries were not detected on the system or could not be loaded ; using cpu only mode
../_images/13fa09402e196f5b0d954d63eb4966099a309efe5f56f5eed2b649ba7d87c06c.png
X = noisy_annulus(500,100)
degrees = np.linspace(1,100,100, dtype=int)
st = gd.RipsComplex(points=X, max_edge_length=1).create_simplex_tree()
st_multi, max_degree = get_degree_rips(st,degrees=degrees, grid_strategy="regular_closest", resolution=1000)
plt.scatter(*X.T)
<matplotlib.collections.PathCollection at 0x7f2fbab0b140>
../_images/b6b62cf8a26874bb783645a5e81a81c84daab0f5267763676c5dc4012fd6201b.png
surfaces = function_rips_surface(st_multi, homological_degrees= [0,1], mobius_inversion=False, zero_pad=False)
plot_surfaces(surfaces, discrete_surface=True)
../_images/6c53a572b40ceeb6dbead37c2a4aa33407dac023516dbefb3cc03788e8778d47.png