Represents the network of interest. This is the primary object of PyPhi and the context of all \(\varphi\) and \(\Phi\) computation.
Network(tpm, cm=None, node_labels=None, purview_cache=None)¶
A network of nodes.
Represents the network under analysis and holds auxilary data about it.
tpm (np.ndarray) –
The transition probability matrix of the network.
The TPM can be provided in any of three forms: state-by-state, state-by-node, or multidimensional state-by-node form. In the state-by-node forms, row indices must follow the little-endian convention (see Little-endian convention). In state-by-state form, column indices must also follow the little-endian convention.
If the TPM is given in state-by-node form, it can be either 2-dimensional, so that
tpm[i]gives the probabilities of each node being ON if the previous state is encoded by \(i\) according to the little-endian convention, or in multidimensional form, so that
tpm[(0, 0, 1)]gives the probabilities of each node being ON if the previous state is \(N_0 = 0, N_1 = 0, N_2 = 1\).
The shape of the 2-dimensional form of a state-by-node TPM must be
(s, n), and the shape of the multidimensional form of the TPM must be
 * n + [n], where
sis the number of states and
nis the number of nodes in the network.
- cm (np.ndarray) – A square binary adjacency matrix indicating the
connections between nodes in the network.
cm[i][j] == 1means that node \(i\) is connected to node \(j\) (see Connectivity matrix conventions). If no connectivity matrix is given, PyPhi assumes that every node is connected to every node (including itself).
- node_labels (tuple[str] or
NodeLabels) – Human-readable labels for each node in the network.
In a 3-node network,
the_network.tpm[(0, 0, 1)]gives the transition probabilities for each node at \(t\) given that state at \(t-1\) was \(N_0 = 0, N_1 = 0, N_2 = 1\).
The network’s transition probability matrix, in multidimensional form.
The network’s connectivity matrix.
A square binary adjacency matrix indicating the connections between nodes in the network.
The number of nodes in the network.
The number of possible states of the network.
The indices of nodes in the network.
This is equivalent to
The labels of nodes in the network.
All purviews which are not clearly reducible for mechanism.
All purviews which are irreducible over
int: The number of nodes in the network.
Return whether this network equals the other object.
Networks are equal if they have the same TPM and CM.
Return a JSON-serializable representation.
- cm (np.ndarray) – A square binary adjacency matrix indicating the connections between nodes in the network.
irreducible_purviews(cm, direction, mechanism, purviews)¶
Return all purviews which are irreducible for the mechanism.
All purviews in
purviewswhich are not reducible over
ValueError – If