nodal_domains#

tangles.separations.finding.nodal_domains(A: ndarray, U: ndarray, domain_type: str = 'weak', eps: float = 1e-10) ndarray#

Calculate the nodal domains of a function from the vertices of the graph with adjacency matrix A to the real numbers.

The nodal domains are calculated for each column in U, interpreting each column in U as a separate function.

The nodal domains are the connected components of the sides of a function. Here, one side is the set of vertices the function assigns a negative value to and the other side is the set of vertices the function assigns a positive value to (see the domain_type parameter description for more details).

Parameters#

Anp.ndarray

The adjacency matrix of a graph.

Unp.ndarray

A matrix or a vector. If it is s a vector, it represents a function from the vertices of the graph with adjacency matrix A to the real numbers. If it is a matrix, each column represents such a function.

domain_type{“weak”, “strong”, “decomposition”}

Specifies how to handle the epsilon value to identify connected components:

  • ‘weak’ (default): The negative side are the values mapped to values smaller than epsilon. The positive side are the values mapped to values larger than -epsilon.

  • ‘strong’: Like ‘weak’ but those that close to zero, closer than epsilon are removed from both sides.

  • ‘decomposition’. Those close to zero are added to the negative side.

epsfloat

The epsilon value.

Returns#

np.ndarray

A matrix containing the indicator vectors of the nodal domains of each input vector as columns.