Replies: 1 comment 7 replies
-
Hey Odin, thanks for your interest in this library ! Inserting simplices one by one is indeed very slow. This needs a python call for each simplex. Currently, the fastest option currently I think is using a "hidden" Slicer constructor (this is a class that can handle any filtration): import multipers as mp
options = {"is_kcritical":True}
HiddenSlicer_type = mp.Slicer(return_type_only=True, **options)
sparse_boundary_matrix = ... # cf example below
simplices_dimensions = ... # np.ndarray[ndim=1, dtype=int]
simplicies_filtrations = ... # [[f_1(splx), ..., f_k(splx) ] for splx]
HiddenSlicer_type(
sparse_boundary_matrix,
simplices_dimensions,
simplicies_filtrations
) To give you some example of these inputs: st = mp.SimplexTreeMulti(kcritical=True)
st.insert([0,1,2], [0,0])
st.remove_maximal_simplex([0,1,2])
st.insert([0,1,2], [1,0])
st.insert([0,1,2], [0,1])
s = mp.Slicer(st, **options) # same filtration, different c++ class
B = s.get_boundaries() # ((), (), (), (0, 1), (0, 2), (1, 2), (3, 4, 5))
F = s.get_filtrations() # [f for splx,f in st] up to some reordering
D = s.get_dimensions() # ordered dims : [0,0,0,1,1,1,2]
assert s == SomeSlicer_type(B,D,F) Another option is writing your filtration to an scc2020 file and read it afterwards with multipers with, e.g.,
I agree that this solution is not good, so I'll have to think about a better interface.
What do you think about this ? I'm open to anny suggestion so, if you have another idea in mind, --don't hesitate ;) |
Beta Was this translation helpful? Give feedback.
-
Firstly, thank you for developing such a great tool for working with multiparameter persistence.
I am constructing a$k$ -critical bifiltration using the
multipers.SimplexTreeMulti
class by inserting each simplex multiple times with different minimal filtration values. I follow the approach described in the documentation, using the.insert()
method of the simplex tree.My question is: Is there a more efficient way to achieve this? Any guidance on best practices for handling this kind of filtration efficiently would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions