pyphi.actual.Transition#
- class pyphi.actual.Transition(substrate, before_state, after_state, cause_indices, effect_indices, *, partition=None, noise_background=False)[source]#
Bases:
SerializableA state transition over a substrate, holding two TransitionSystem views.
Implements the actual-causation framework of Albantakis, Marshall, Hoel, and Tononi (2019). The cause and effect analyses live in
TransitionSysteminstances accessed viacause_systemandeffect_system, keyed byDirectioninsystem.- Parameters:
substrate (Substrate) – The substrate the transition is defined over.
before_state (tuple[int]) – The state of the substrate at time t-1.
after_state (tuple[int]) – The state of the substrate at time t.
cause_indices (tuple[int] or tuple[str]) – Indices (or labels) of nodes in the cause system.
effect_indices (tuple[int] or tuple[str]) – Indices (or labels) of nodes in the effect system.
partition (DirectedBipartition, optional) – The partition applied to this transition. Defaults to a
NullCutover the union of cause and effect indices.noise_background (bool, optional) – If
True, background conditions are noised instead of frozen.
- Raises:
TransitionUnreachableError – If the effect occurrence has zero probability given the before state, violating the Realization principle of Albantakis et al. (2019), Section 2.4: p(v_t | v_{t−1}) > 0. The check applies the transition’s own background semantics (frozen, or noised when
noise_backgroundisTrue) and runs only for unpartitioned construction; a transition built with an explicitpartitionis a derived copy of an already-validated transition.
- apply_partition(partition)[source]#
Return a copy of this transition with
partitionapplied.- Parameters:
partition (DirectedBipartition) – The partition to apply; its severed connections are removed from both the cause and the effect system.
- Returns:
Transition – A new transition, equal to this one except for its partition.
- Return type:
- unconstrained_cause_repertoire(purview)[source]#
Return the unconstrained cause repertoire of the occurrence.
- unconstrained_effect_repertoire(purview)[source]#
Return the unconstrained effect repertoire of the occurrence.
- repertoire(direction, mechanism, purview)[source]#
Return the cause or effect repertoire for the given direction.
- Parameters:
- Raises:
ValueError – If
purviewis not a subset of the purview indices, ormechanismis not a subset of the mechanism indices, for the given direction.
- state_probability(direction, repertoire, purview)[source]#
Compute the probability of the purview in its current state given the repertoire.
Collapses the dimensions of the repertoire that correspond to the purview nodes onto their state. All other dimensions are already singleton and thus receive 0 as the conditioning index.
- Parameters:
direction (Direction) – The temporal direction (CAUSE or EFFECT).
repertoire (numpy.ndarray) – The repertoire array to index into.
- Returns:
float – A single probability.
- probability(direction, mechanism, purview)[source]#
Probability that the purview is in its current state given the state of the mechanism.
- purview_state(direction)[source]#
The state of the purview when we are computing coefficients in
direction.For example, if we are computing the cause coefficient of a mechanism in
after_state, the direction isCAUSEand thepurview_stateisbefore_state.
- mechanism_state(direction)[source]#
The state of the mechanism when computing coefficients in
direction.
- cause_ratio(mechanism, purview)[source]#
The cause ratio of the
purviewgivenmechanism.Always evaluated with PMI (pointwise mutual information), per the 2019 Albantakis et al. formalism, independent of
config.formalism.actual_causation.alpha_measure.
- effect_ratio(mechanism, purview)[source]#
The effect ratio of the
purviewgivenmechanism.Always evaluated with PMI (pointwise mutual information), per the 2019 Albantakis et al. formalism, independent of
config.formalism.actual_causation.alpha_measure.
- partitioned_repertoire(direction, partition, *, partitioned_repertoire_scheme=None)[source]#
Compute the repertoire over the partition in the given direction.
- partitioned_probability(direction, partition, *, partitioned_repertoire_scheme=None)[source]#
Compute the probability of the mechanism over the purview in the partition.
- find_mip(direction, mechanism, purview, *, allow_neg=False)[source]#
Find the ratio minimum information partition for a mechanism over a purview.
Dispatches through the active actual-causation formalism (
config.formalism.actual_causation.version).
- potential_purviews(direction, mechanism, purviews=None)[source]#
Return all purviews that could belong to the maximally irreducible cause (
MaximallyIrreducibleCause) or effect (MaximallyIrreducibleEffect).Filters out trivially reducible purviews.
- find_causal_link(direction, mechanism, purviews=None, *, allow_neg=False)[source]#
Return the maximally irreducible cause or effect ratio for a mechanism.
Dispatches through the active actual-causation formalism (
config.formalism.actual_causation.version).
- find_actual_cause(mechanism, purviews=None, *, allow_neg=False)[source]#
Return the actual cause of a mechanism.
- find_actual_effect(mechanism, purviews=None, *, allow_neg=False)[source]#
Return the actual effect of a mechanism.
- find_mice(*args, **kwargs)[source]#
Alias for
find_causal_link().