models.concept
¶
Objects that represent parts of cause-effect structures.
-
class
pyphi.models.concept.
Mip
(phi, direction, mechanism, purview, partition, unpartitioned_repertoire, partitioned_repertoire, subsystem=None)¶ A minimum information partition for \(\varphi\) calculation.
These can be compared with the built-in Python comparison operators (
<
,>
, etc.). First, \(\varphi\) values are compared. Then, if these are equal up toPRECISION
, the size of the mechanism is compared (see thePICK_SMALLEST_PURVIEW
option inconfig
.)-
phi
¶ float – This is the difference between the mechanism’s unpartitioned and partitioned repertoires.
-
mechanism
¶ tuple[int] – The mechanism over which to evaluate the MIP.
-
purview
¶ tuple[int] – The purview over which the unpartitioned repertoire differs the least from the partitioned repertoire.
-
partition
¶ KPartition – The partition that makes the least difference to the mechanism’s repertoire.
-
unpartitioned_repertoire
¶ np.ndarray – The unpartitioned repertoire of the mechanism.
-
partitioned_repertoire
¶ np.ndarray – The partitioned repertoire of the mechanism. This is the product of the repertoires of each part of the partition.
-
unorderable_unless_eq
= ['direction']¶
-
order_by
()¶
-
to_json
()¶
-
-
class
pyphi.models.concept.
Mice
(mip)¶ A maximally irreducible cause or effect.
These can be compared with the built-in Python comparison operators (
<
,>
, etc.). First, \(\varphi\) values are compared. Then, if these are equal up toPRECISION
, the size of the mechanism is compared (see thePICK_SMALLEST_PURVIEW
option inconfig
.)-
phi
¶ float – The difference between the mechanism’s unpartitioned and partitioned repertoires.
-
mechanism
¶ list[int] – The mechanism for which the MICE is evaluated.
-
purview
¶ list[int] – The purview over which this mechanism’s \(\varphi\) is maximal.
-
partition
¶ KPartition – The partition that makes the least difference to the mechanism’s repertoire.
-
repertoire
¶ np.ndarray – The unpartitioned repertoire of the mechanism over the purview.
-
partitioned_repertoire
¶ np.ndarray – The partitioned repertoire of the mechanism over the purview.
-
mip
¶ MIP – The minimum information partition for this mechanism.
-
unorderable_unless_eq
= ['direction']¶
-
order_by
()¶
-
to_json
()¶
-
-
class
pyphi.models.concept.
Concept
(mechanism=None, cause=None, effect=None, subsystem=None, time=None)¶ The maximally irreducible cause and effect specified by a mechanism.
These can be compared with the built-in Python comparison operators (
<
,>
, etc.). First, \(\varphi\) values are compared. Then, if these are equal up toPRECISION
, the size of the mechanism is compared.-
mechanism
¶ tuple[int] – The mechanism that the concept consists of.
-
subsystem
¶ Subsystem – This concept’s parent subsystem.
-
time
¶ float – The number of seconds it took to calculate.
-
phi
¶ float – The size of the concept.
This is the minimum of the \(\varphi\) values of the concept’s core cause and core effect.
-
cause_purview
¶ tuple[int] – The cause purview.
-
effect_purview
¶ tuple[int] – The effect purview.
-
cause_repertoire
¶ np.ndarray – The cause repertoire.
-
effect_repertoire
¶ np.ndarray – The effect repertoire.
-
unorderable_unless_eq
= ['subsystem']¶
-
order_by
()¶
-
__bool__
()¶ A concept is
True
if \(\varphi > 0\).
-
eq_repertoires
(other)¶ Return whether this concept has the same repertoires as another.
Warning
This only checks if the cause and effect repertoires are equal as arrays; mechanisms, purviews, or even the nodes that the mechanism and purview indices refer to, might be different.
-
emd_eq
(other)¶ Return whether this concept is equal to another in the context of an EMD calculation.
-
expand_cause_repertoire
(new_purview=None)¶ See
expand_repertoire()
.
-
expand_effect_repertoire
(new_purview=None)¶ See
expand_repertoire()
.
-
expand_partitioned_cause_repertoire
()¶ See
expand_repertoire()
.
-
expand_partitioned_effect_repertoire
()¶ See
expand_repertoire()
.
-
to_json
()¶ Return a JSON-serializable representation.
-
classmethod
from_json
(dct)¶
-
-
class
pyphi.models.concept.
Constellation
¶ A constellation of concepts.
This is a wrapper around a tuple to provide a nice string representation and place to put constellation methods. Previously, constellations were represented as a
tuple[concept]
; this usage still works in all functions.Normalize the order of concepts in the constellation.
-
static
__new__
(concepts=())¶ Normalize the order of concepts in the constellation.
-
to_json
()¶
-
mechanisms
¶ The mechanism of each concept.
-
phis
¶ The \(\varphi\) values of each concept.
-
labeled_mechanisms
¶ The labeled mechanism of each concept.
-
classmethod
from_json
(json)¶
-
static
-
pyphi.models.concept.
normalize_constellation
(constellation)¶ Deterministically reorder the concepts in a constellation.
Parameters: constellation (Constellation) – The constellation in question. Returns: The constellation, ordered lexicographically by mechanism. Return type: Constellation