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/55c52d0d4b135222f9eee51957cac9530ae6d4a198335bcf25ac88f2fec0bf94.png
sms = function_rips_signed_measure(st_multi, homological_degrees= [0,1], mobius_inversion=True, zero_pad=False)
plot_signed_measures(sms)
Text(396.2790404040403, 0.5, 'degree')
../_images/6131944f0b7dd8bbcae2a63d8225dce64574b2d59bc06b64cd2bd1aae64cdcae.png
from multipers.ml.signed_measures import SignedMeasureFormatter
sms_, = SignedMeasureFormatter(normalize=True).fit_transform([sms])
plot_signed_measures(sms_)
../_images/19700838c10feb26f94c07a0d3a0c02c6266b10b4ff958e02fc5c25eae995511.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_])
../_images/50e6a234b60c258e500273addbf71b8a6232986fd1c341892e711a481504028c.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 0x7f5a32b0e9f0>
../_images/93c69ee6a7bd1c79e21a8e717ed0935b3ea8d9459da6fa951c3fc7a78a55a70c.png
surfaces = function_rips_surface(st_multi, homological_degrees= [0,1], mobius_inversion=False, zero_pad=False)
plot_surfaces(surfaces, discrete_surface=True)
../_images/fcbe5b0ba75f3ed3e5d32d9fb5742d3903f09f7319c74c23582b22e7f4302253.png