### Run Persistent Path Homology via CLI Source: https://github.com/weilabmsu/pathhom/blob/main/README.md Execute persistent path homology calculations using distance or angle-based filtration from the command line. ```bash # dis-based python "./code/pathhomology.py" --input_type cloudpoints --input_data "./data/B12N12_cage.csv" --filtration_type distance --max_distance 5 --save_name 'betti_numbers_dppt.npy' --max_path 2 # angle-based python "./code/pathhomology.py" --input_type cloudpoints --input_data "./data/B12N12_cage.csv" --filtration_type angle --save_name 'betti_numbers_dppt.npy' --max_path 2 ``` -------------------------------- ### Compute Basic Path Homology Source: https://github.com/weilabmsu/pathhom/blob/main/README.md Calculate Betti numbers from a set of nodes and edges using the PathHomology class. ```python import numpy as np from pathhomology import PathHomology nodes = np.array([1, 2, 3, 4, 5, 6]) edges = np.array( [ [1, 2], [3, 4], [3, 2], [5, 2], [5, 1], ] ) max_path = 2 betti_num = PathHomology().path_homology(edges, nodes, max_path) print(f'Betti numbers for 0 to max {max_path} path: {betti_num}') ``` -------------------------------- ### Compute Persistent Path Homology in Python Source: https://github.com/weilabmsu/pathhom/blob/main/README.md Calculate persistent path homology from cloudpoints or predefined digraphs using the PathHomology API. ```python # From cloudpoints import numpy as np from pathhomology import PathHomology max_path = 2 cloudpoints = np.array([ [-1.1, 0, 0], [1.2, 0, 0], [0, -1.3, 0], [0, 1.4, 0], [1.5, 0, 0], [-1.6, 0, 0] ]) points_weight = [1, 2, 9, 4, 5, 6] betti_nums_dppt = PathHomology().persistent_path_homology( cloudpoints, points_weight, max_path, filtration=None) betti_nums_appt = PathHomology().persistent_angle_path_homology( cloudpoints, points_weight, max_path) # ############# # From digraph (predefined digraph) all_edges = np.array([ [1, 3, 4, 4, 5, 5, 3, 5, 6, 2, 3, 4], [2, 2, 3, 1, 1, 2, 5, 4, 1, 6, 6, 6], ]).T - 1 betti_num_appt_digraph = PathHomology().persistent_angle_path_homology_from_digraph( cloudpoints, all_edges, max_path, filtration_angle_step=30) filtration_for_dis_filtration = np.arange(0, 5, 0.2) betti_num_dppt_digraph = PathHomology().persistent_path_homology_from_digraph( cloudpoints, all_edges, max_path, filtration=filtration_for_dis_filtration) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.