pyphi.models.partitions.EdgeCut#

class pyphi.models.partitions.EdgeCut(node_indices, cut_matrix, node_labels=None)[source]#

Bases: Displayable, _PartitionBase

An edge cut specified by an explicit binary severance matrix.

Stores (node_indices, _cut_matrix) where _cut_matrix[i, j] == 1 indicates that the connection from node node_indices[i] to node_indices[j] is severed. The full n by n cut matrix is produced by embedding _cut_matrix at the rows/cols corresponding to node_indices.

Parameters:
  • node_indices (tuple[int, ...])

  • cut_matrix (NDArray[np.int_])

  • node_labels (NodeLabels | None)

normalization_factor()[source]#

Normalization factor: 1 / number of severed connections.

Return type:

float

property indices: tuple[int, ...]#

Indices of the partitioned nodes.

cut_matrix(n)[source]#

Return the binary edge-cut matrix induced by this partition.

cut_matrix[a, b] == 1 iff the directed connection a→b is severed.

Parameters:

n (int) – The size of the substrate.

Return type:

ndarray[tuple[Any, …], dtype[int64]]

removed_edges()[source]#

The set of directed edges (from, to) this partition severs.

Default derivation from cut_matrix(); concrete subclasses override with an equivalent structural form that avoids materializing the full n x n matrix. The two forms agree.

Return type:

frozenset[tuple[int, int]]