pyphi.models.partitions.DirectedBipartition#

class pyphi.models.partitions.DirectedBipartition(direction, from_nodes, to_nodes, node_labels=None)[source]#

Bases: Displayable, _PartitionBase

A directed bipartition of an index set.

Severs connections from from_nodes to to_nodes in a causal direction (CAUSE or EFFECT). Corresponds to θ ∈ Θ(S) in IIT 4.0 Eq. 14-18 in the bipartite case.

Variables:
  • direction (Direction) – The causal direction of the cut.

  • from_nodes (tuple[int, ...]) – Source side; connections from these to to_nodes are severed.

  • to_nodes (tuple[int, ...]) – Target side; connections from from_nodes to these are severed.

  • node_labels (NodeLabels or None) – Optional labels for pretty-printing.

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

Indices of the partitioned nodes.

cut_matrix(n)[source]#

Connections from from_nodes to to_nodes are severed.

Examples

>>> from pyphi.direction import Direction
>>> sp = DirectedBipartition(Direction.EFFECT, (1,), (2,))
>>> sp.cut_matrix(3)
array([[0, 0, 0],
       [0, 0, 1],
       [0, 0, 0]])
Parameters:

n (int)

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]]