subsystem
¶
Represents a candidate set for \(\varphi\) calculation.
-
class
pyphi.subsystem.
Subsystem
(node_indices, network, cut=None, mice_cache=None, repertoire_cache=None, cache_info=None)¶ A set of nodes in a network.
Parameters: - nodes (tuple(int) – A sequence of indices of the nodes in this subsystem.
- network (Network) – The network the subsystem belongs to.
-
nodes
¶ list(Node – A list of nodes in the subsystem.
-
node_indices
¶ tuple(int – The indices of the nodes in the subsystem.
-
size
¶ int – The number of nodes in the subsystem.
-
network
¶ Network – The network the subsystem belongs to.
-
cut
¶ Cut – The cut that has been applied to this subsystem.
-
connectivity_matrix
¶ np.array – The connectivity matrix after applying the cut.
-
cut_matrix
¶ np.array – A matrix of connections which have been severed by the cut.
-
perturb_vector
¶ np.array – The vector of perturbation probabilities for each node.
-
null_cut
¶ Cut – The cut object representing no cut.
-
past_tpm
¶ np.array – The TPM conditioned on the past state of the external nodes (nodes outside the subsystem).
-
current_tpm
¶ np.array – The TPM conditioned on the current state of the external nodes.
-
repertoire_cache_info
()¶ Report repertoire cache statistics.
-
__eq__
(other)¶ Return whether this subsystem is equal to the other object.
Two subsystems are equal if their sets of nodes, networks, and cuts are equal.
-
__bool__
()¶ Return false if the subsystem has no nodes, true otherwise.
-
json_dict
()¶
-
indices2nodes
(indices)¶
-
cause_repertoire
(mechanism, purview)¶ Return the cause repertoire of a mechanism over a purview.
Parameters: - mechanism (tuple(Node) – The mechanism for which to calculate the cause repertoire.
- purview (tuple(Node) – The purview over which to calculate the cause repertoire.
Returns: cause_repertoire –
- The cause repertoire of the
mechanism over the purview.
Return type: np.ndarray
-
effect_repertoire
(mechanism, purview)¶ Return the effect repertoire of a mechanism over a purview.
Parameters: - mechanism (tuple(Node) – The mechanism for which to calculate the
- repertoire. (effect) –
- purview (tuple(Node) – The purview over which to calculate the
- repertoire. –
Returns: effect_repertoire –
- The effect repertoire of the
mechanism over the purview.
Return type: np.ndarray
-
unconstrained_cause_repertoire
(purview)¶ Return the unconstrained cause repertoire for a purview.
This is just the cause repertoire in the absence of any mechanism.
-
unconstrained_effect_repertoire
(purview)¶ Return the unconstrained effect repertoire for a purview.
This is just the effect repertoire in the absence of any mechanism.
-
expand_repertoire
(direction, purview, repertoire, new_purview=None)¶ Return the unconstrained cause or effect repertoire based on a direction.
-
expand_cause_repertoire
(purview, repertoire, new_purview=None)¶ Expand a partial cause repertoire over a purview to a distribution over the entire subsystem’s state space.
-
expand_effect_repertoire
(purview, repertoire, new_purview=None)¶ Expand a partial effect repertoire over a purview to a distribution over the entire subsystem’s state space.
-
cause_info
(mechanism, purview)¶ Return the cause information for a mechanism over a purview.
-
effect_info
(mechanism, purview)¶ Return the effect information for a mechanism over a purview.
-
cause_effect_info
(mechanism, purview)¶ Return the cause-effect information for a mechanism over a purview.
This is the minimum of the cause and effect information.
-
find_mip
(direction, mechanism, purview)¶ Return the minimum information partition for a mechanism over a purview.
Parameters: - direction (str) – Either
DIRECTIONS[PAST]
orDIRECTIONS[FUTURE]
. - mechanism (tuple(Node) – The nodes in the mechanism.
- purview (tuple(Node) – The nodes in the purview.
Returns: mip –
- The mininum-information partition in one temporal
direction.
Return type: - direction (str) – Either
-
mip_past
(mechanism, purview)¶ Return the past minimum information partition.
Alias for |find_mip| with
direction
set toDIRECTIONS[PAST]
.
-
mip_future
(mechanism, purview)¶ Return the future minimum information partition.
Alias for |find_mip| with
direction
set toDIRECTIONS[FUTURE]
.
-
phi_mip_past
(mechanism, purview)¶ Return the \(\varphi\) value of the past minimum information partition.
This is the distance between the unpartitioned cause repertoire and the MIP cause repertoire.
-
phi_mip_future
(mechanism, purview)¶ Return the \(\varphi\) value of the future minimum information partition.
This is the distance between the unpartitioned effect repertoire and the MIP cause repertoire.
-
phi
(mechanism, purview)¶ Return the \(\varphi\) value of a mechanism over a purview.
-
find_mice
(direction, mechanism, purviews=False)¶ Return the maximally irreducible cause or effect for a mechanism.
Parameters: - direction (str) – The temporal direction, specifying cause or effect.
- mechanism (tuple(Node) – The mechanism to be tested for irreducibility.
Keyword Arguments: purviews (tuple(Node) – Optionally restrict the possible purviews to a subset of the subsystem. This may be useful for _e.g._ finding only concepts that are “about” a certain subset of nodes.
Returns: mice – The maximally-irreducible cause or effect.
Return type: Note
Strictly speaking, the MICE is a pair of repertoires: the core cause repertoire and core effect repertoire of a mechanism, which are maximally different than the unconstrained cause/effect repertoires (i.e., those that maximize \(\varphi\)). Here, we return only information corresponding to one direction,
DIRECTIONS[PAST]
orDIRECTIONS[FUTURE]
, i.e., we return a core cause or core effect, not the pair of them.
-
core_cause
(mechanism, purviews=False)¶ Returns the core cause repertoire of a mechanism.
Alias for |find_mice| with
direction
set toDIRECTIONS[PAST]
.
-
core_effect
(mechanism, purviews=False)¶ Returns the core effect repertoire of a mechanism.
Alias for |find_mice| with
direction
set toDIRECTIONS[PAST]
.
-
phi_max
(mechanism)¶ Return the \(\varphi^{\textrm{max}}\) of a mechanism.
This is the maximum of \(\varphi\) taken over all possible purviews.
-
null_concept
¶ Return the null concept of this subsystem, a point in concept space identified with the unconstrained cause and effect repertoire of this subsystem.
-
concept
(mechanism)¶ Calculate a concept.