pytspl.decomposition.hodge_decomposition
Module for calculating the Hodge decomposition of a edge flow defined over a network.
The following components can be extracted: - Total variance - Divergence - Curl - Gradient component - Curl component - Harmonic component
Functions
|
Calculate the gradient flow of a flow on a graph. |
|
Calculate the curl flow of a flow on a graph. |
|
Calculate the harmonic flow of a flow on a graph. |
Module Contents
- pytspl.decomposition.hodge_decomposition.get_gradient_flow(B1: scipy.sparse.csr_matrix, flow: numpy.ndarray, round_fig: bool = True, round_sig_fig: int = 2) numpy.ndarray[source]
Calculate the gradient flow of a flow on a graph.
- Args:
B1 (csr_matrix): The incidence matrix of the graph, nodes to edges (B1). flow (np.ndarray): The flow on the graph. round_sig_fig (int, optional): Round to significant figure. Defaults to 2.
- Returns:
np.ndarray: The gradient flow.
- pytspl.decomposition.hodge_decomposition.get_curl_flow(B2: scipy.sparse.csr_matrix, flow: numpy.ndarray, round_fig: bool = True, round_sig_fig: int = 2) numpy.ndarray[source]
Calculate the curl flow of a flow on a graph.
- Args:
B2 (csr_matrix): The incidence matrix of the graph, edges to triangles (B2). flow (np.ndarray): The flow on the graph. round_sig_fig (int, optional): Round to significant figure. Defaults to 2.
- Returns:
np.ndarray: The curl flow.
- pytspl.decomposition.hodge_decomposition.get_harmonic_flow(B1: scipy.sparse.csr_matrix, B2: scipy.sparse.csr_matrix, flow: numpy.ndarray, round_fig: bool = True, round_sig_fig: int = 2) numpy.ndarray[source]
Calculate the harmonic flow of a flow on a graph.
- Args:
B1 (csr_matrix): The incidence matrix of the graph, nodes to edges (B1). B2 (csr_matrix): The incidence matrix of the graph, flow (np.ndarray): The flow on the graph. round_sig_fig (int, optional): Round to significant figure. Defaults to 2.
- Returns:
np.ndarray: The harmonic flow.