petls.Complex#
- class petls.Complex(boundaries=None, filtrations=None, eigs_Algorithm='eigvalsh', up_Algorithm='schur', simplex_tree=None)[source]#
Primary class used to compute persistent Laplacian matrices and eigenvalues from a complex.
- Attributes:
- verboseboolean
Print progress if spectra() is called
- flippedboolean
Compute the top-dimensional Laplacian’s eigenvalues via the eigenvalues of the smaller of B_N B_N^T or B_N^T B_N and possible zero-padding
Methods
set_boundaries_filtrations(boundaries, filtrations)
If the boundaries and filtrations were not set in the constructor, set them here.
set_eigs_Algorithm(eigs_Algorithm, num_eigenvalues, eigenvalue_order)
Set the eigenvalue algorithm to use.
set_up_Algorithm(up_Algorithm)
Set the up-Laplacian algorithm to use. Currently only “schur” is available in Python. Passing a callable function is only available in C++.
get_L(dim, a, b)
Get the persistent Laplacian matrix.
get_up(dim, a, b)
Get the persistent up-Laplacian matrix.
get_down(dim, a)
Get the persistent down-Laplacian matrix.
nonzero_spectra(dim, a, b, PH_basis=None, use_dummy_harmonic_basis=True)
Compute the nonzero eigenvalues of the PL using reduction by persistent homology or standard basis of the null space.
spectra(dim = None, a = None, b = None, request_list = None)
Compute the eigenvalues of L_{dim}^{a,b} or for every tuple (dim, a, b) in request_list.
eigenpairs(dim = None, a = None, b = None, request_list = None)
Compute the eigenvalues and eigenvectors of L_{dim}^{a,b} or for every tuple (dim, a, b) in request_list.
eigenvalues_summarize(eigenvalues)
Compute the betti number and least nonzero eigenvalue of a list of eigenvalues.
print_boundaries(self):
Print all boundaries and corresponding filtrations in the complex.
store_spectra(spectra_list, file_prefix):
Store all of the eigenvalues in files f”{file_prefix}_spectra_{dim}.txt” for each dimension in the complex.
store_spectra_summary(spectra_list, file_prefix):
Store eigenvalue summaries in file f”{file_prefix}_spectra_summary.txt”.
time_to_csv(self, filename):
Store the time taken to compute the spectra in a CSV file. This is done automatically when spectra() is called.
filtration_list_to_spectra_request(filtrations, dims):
Get a list of tuples (dim, a, b) for all combinations of dimension and successive filtration values (a=filtrations[i], b=filtrations[i+1]).
get_all_filtrations(self):
Get a sorted list of all filtration values that occur in the complex.
- __init__(boundaries=None, filtrations=None, eigs_Algorithm='eigvalsh', up_Algorithm='schur', simplex_tree=None)[source]#
Constructor for the Complex class.
Methods
__init__
([boundaries, filtrations, ...])Constructor for the Complex class.
eigenpairs
([dim, a, b, request_list, allpairs])Compute the eigenvalues and eigenvectors of L_{dim}^{a,b} or for every tuple (dim, a, b) in request_list.
eigenvalues_summarize
(eigenvalues)filtration_list_to_spectra_request
(...[, ...])get_L
(dim, a, b)get_all_filtrations
()get_down
(dim, a)get_up
(dim, a, b)nonzero_spectra
(dim, a, b[, PH_basis, ...])print_boundaries
()set_boundaries_filtrations
(boundaries, ...)If the boundaries and filtrations were not set in the constructor, set them here.
set_eigs_Algorithm
(eigs_Algorithm[, ...])set_up_Algorithm
(up_Algorithm)spectra
([dim, a, b, request_list, allpairs])Compute the eigenvalues of L_{dim}^{a,b} or for every tuple (dim, a, b) in request_list.
store_L
(dim, a, b, prefix)store_spectra
(spectra_list, file_prefix)store_spectra_summary
(spectra_list, file_prefix)time_to_csv
(filename)Attributes
cpp_algorithms_list
flipped
verbose