models.cuts
¶
Objects that represent partitions of sets of nodes.
- class pyphi.models.cuts.NullCut(indices, node_labels=None)¶
The cut that does nothing.
- property is_null¶
This is the only cut where
is_null == True
.
- property indices¶
Indices of the cut.
- cut_matrix(n)¶
Return a matrix of zeros.
- to_json()¶
- class pyphi.models.cuts.Cut(from_nodes, to_nodes, node_labels=None)¶
Represents a unidirectional cut.
- from_nodes¶
Connections from this group of nodes to those in
to_nodes
are from_nodes.- Type:
tuple[int]
- to_nodes¶
Connections to this group of nodes from those in
from_nodes
are from_nodes.- Type:
tuple[int]
- from_nodes¶
- to_nodes¶
- node_labels¶
- property indices¶
Indices of this cut.
- cut_matrix(n)¶
Compute the cut matrix for this cut.
The cut matrix is a square matrix which represents connections severed by the cut.
- Parameters:
n (int) – The size of the network.
Example
>>> cut = Cut((1,), (2,)) >>> cut.cut_matrix(3) array([[0., 0., 0.], [0., 0., 1.], [0., 0., 0.]])
- __len__()¶
The number of parts in the Cut.
- format(node_labels=None)¶
- to_json()¶
Return a JSON-serializable representation.
- classmethod from_json(data)¶
Return a Cut object from a JSON-serializable representation.
- class pyphi.models.cuts.SystemPartition(direction, *args, **kwargs)¶
A system partition.
Same as a IIT 3.0 unidirectional partition, but with a Direction.
- to_json()¶
Return a JSON-serializable representation.
- classmethod from_json(data)¶
Return a SystemPartition object from a JSON-serializable representation.
- from_nodes¶
- to_nodes¶
- node_labels¶
- class pyphi.models.cuts.CompleteSystemPartition¶
Represents the SystemPartition that destroys all distinctions & relations.
- class pyphi.models.cuts.KCut(direction, partition, node_labels=None)¶
A cut that severs all connections between parts of a K-partition.
- property indices¶
Indices of this cut.
- cut_matrix(n)¶
The matrix of connections that are severed by this cut.
- to_json()¶
- class pyphi.models.cuts.ActualCut(direction, partition, node_labels=None)¶
Represents an cut for a
Transition
.- property indices¶
Indices of this cut.
- class pyphi.models.cuts.GeneralKCut(node_indices, cut_matrix, node_labels=None)¶
A cut defined by a matrix of cut connections.
- normalization_factor()¶
The normalization factor for this cut.
- property indices¶
Indices of this cut.
- cut_matrix(n)¶
The matrix of connections that are severed by this cut.
- to_json()¶
- classmethod from_json(data)¶
- class pyphi.models.cuts.CompleteGeneralKCut(node_indices, node_labels=None)¶
- normalization_factor()¶
The normalization factor for this cut.
- class pyphi.models.cuts.GeneralSetPartition(*args, set_partition=None, **kwargs)¶
- property num_parts¶
- to_json()¶
- classmethod from_json(data)¶
- relabel(node_indices, node_labels=None)¶
- class pyphi.models.cuts.CompleteGeneralSetPartition(node_indices, node_labels=None)¶
- class pyphi.models.cuts.Part(mechanism: tuple, purview: tuple, node_labels: NodeLabels | None = None)¶
Represents one part of a
Bipartition
.- mechanism¶
The nodes in the mechanism for this part.
- Type:
tuple[int]
- purview¶
The nodes in the mechanism for this part.
- Type:
tuple[int]
Example
When calculating \(\varphi\) of a 3-node subsystem, we partition the system in the following way:
mechanism: A,C B ─── ✕ ─── purview: B A,C
This class represents one term in the above product.
- mechanism: tuple¶
- purview: tuple¶
- node_labels: NodeLabels = None¶
- to_json()¶
Return a JSON-serializable representation.
- class pyphi.models.cuts.KPartition(*parts, node_labels=None)¶
A partition with an arbitrary number of parts.
- parts¶
- node_labels¶
- property mechanism¶
The nodes of the mechanism in the partition.
- Type:
tuple[int]
- property purview¶
The nodes of the purview in the partition.
- Type:
tuple[int]
- property indices¶
Indices of this cut.
- normalize()¶
Normalize the order of parts in the partition.
- num_connections_cut()¶
The number of connections cut by this partition.
- cut_matrix(n)¶
The matrix of connections that are severed by this cut.
- to_json()¶
- classmethod from_json(dct)¶