models.mechanism

Mechanism-level objects.

class pyphi.models.mechanism.Unit(index: int, state: int, label: str | None = None)

A unit in a state.

index: int
state: int
label: str = None
class pyphi.models.mechanism.StateSpecification(direction: pyphi.direction.Direction, purview: Tuple[int], state: Tuple[int], intrinsic_information: pyphi.data_structures.pyphi_float.PyPhiFloat, repertoire: numpy.__array_like._SupportsArray[numpy.dtype[Any]] | numpy.__nested_sequence._NestedSequence[numpy.__array_like._SupportsArray[numpy.dtype[Any]]] | bool | int | float | complex | str | bytes | numpy.__nested_sequence._NestedSequence[bool | int | float | complex | str | bytes], unconstrained_repertoire: numpy.__array_like._SupportsArray[numpy.dtype[Any]] | numpy.__nested_sequence._NestedSequence[numpy.__array_like._SupportsArray[numpy.dtype[Any]]] | bool | int | float | complex | str | bytes | numpy.__nested_sequence._NestedSequence[bool | int | float | complex | str | bytes])
direction: Direction
purview: Tuple[int]
state: Tuple[int]
intrinsic_information: PyPhiFloat
repertoire: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]
unconstrained_repertoire: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]
set_ties(ties: Iterable)
property ties
is_congruent(other)
to_json()
classmethod from_json(data)
class pyphi.models.mechanism.DistinctionPhiNormalizationRegistry

Storage for distinction \(\varphi\) normalizations.

desc = 'functions for normalizing distinction |small_phi| values'
pyphi.models.mechanism.normalization_factor(partition)
class pyphi.models.mechanism.ShortCircuitConditions(value)

An enumeration.

NO_PURVIEWS = 1
NO_PARTITIONS = 2
EMPTY_PURVIEW = 3
UNREACHABLE_STATE = 4
class pyphi.models.mechanism.RepertoireIrreducibilityAnalysis(phi, direction, mechanism, purview, partition, repertoire, partitioned_repertoire, specified_state=None, mechanism_state=None, purview_state=None, node_labels=None, selectivity=None, reasons=None)

An analysis of the irreducibility (\(\varphi\)) of a mechanism over a purview, for a given partition, in one temporal direction.

These can be compared with the built-in Python comparison operators (<, >, etc.). Comparison is based on \(\varphi\) value, then mechanism size.

property phi

This is the difference between the mechanism’s unpartitioned and partitioned repertoires.

Type:

PyPhiFloat

property normalized_phi

Normalized \(\varphi\) value.

Type:

float

property direction

CAUSE or EFFECT.

Type:

Direction

property mechanism

The mechanism that was analyzed.

Type:

tuple[int]

property mechanism_state

The current state of the mechanism.

Type:

tuple[int]

property purview

The purview over which the the mechanism was analyzed.

Type:

tuple[int]

property purview_state

The current state of the purview.

Type:

tuple[int]

property partition

The partition of the mechanism-purview pair that was analyzed.

Type:

KPartition

property repertoire

The repertoire of the mechanism over the purview.

Type:

np.ndarray

property partitioned_repertoire

The partitioned repertoire of the mechanism over the purview. This is the product of the repertoires of each part of the partition.

Type:

np.ndarray

property selectivity

The selectivity factor.

Type:

float

property reasons

Reasons why the computation short-circuited.

property specified_state

The state with the maximal absolute intrinsic difference between the unpartitioned and partitioned repertoires among all ties.

property purview_units
is_congruent(specified_state)

Whether the state specified by this RIA is congruent to the given one.

property state_ties
set_state_ties(ties)
property partition_ties
set_partition_ties(ties)
property ties
property num_state_ties
property num_partition_ties
property node_labels

NodeLabels for this system.

__bool__()

A RepertoireIrreducibilityAnalysis is True if it has \(\varphi > 0\).

make_repr(title=None, columns=None)
to_json()
classmethod from_json(data)
class pyphi.models.mechanism.MaximallyIrreducibleCauseOrEffect(ria)

A maximally irreducible cause or effect (MICE).

These can be compared with the built-in Python comparison operators (<, >, etc.). Comparison is based on \(\varphi\) value, then mechanism size.

property phi

The difference between the mechanism’s unpartitioned and partitioned repertoires.

Type:

float

property normalized_phi

Normalized \(\varphi\) value.

Type:

float

property direction

CAUSE or EFFECT.

Type:

Direction

property mechanism

The mechanism for which the MICE is evaluated.

Type:

list[int]

property mechanism_state

The current state of the mechanism.

Type:

tuple[int]

property purview

The purview over which this mechanism’s \(\varphi\) is maximal.

Type:

list[int]

property purview_units
property purview_state

The current state of the purview.

Type:

tuple[int]

property mip

The partition that makes the least difference to the mechanism’s repertoire.

Type:

KPartition

property repertoire

The unpartitioned repertoire of the mechanism over the purview.

Type:

np.ndarray

property partitioned_repertoire

The partitioned repertoire of the mechanism over the purview.

Type:

np.ndarray

property selectivity

The selectivity factor.

Type:

float

property specified_state

The state(s) with the maximal absolute intrinsic difference between the unpartitioned and partitioned repertoires.

property ria

The irreducibility analysis for this mechanism.

Type:

RepertoireIrreducibilityAnalysis

property node_labels
property partition
property reasons
property state_ties
set_state_ties(ties)
property num_state_ties
property partition_ties
set_partition_ties(ties)
property num_partition_ties
property purview_ties

The purviews that are tied for maximal \(\varphi\) value.

Type:

tuple[MaximallyIrreducibleCauseOrEffect]

set_purview_ties(ties)

Set the ties.

property num_purview_ties
flip()

Return the linked MICE in the other direction.

is_congruent(specified_state)

Return whether the state specified by this MICE is congruent.

unorderable_unless_eq = []
order_by()

Return a list of values to compare for ordering.

The first value in the list has the greatest priority; if the first objects are equal the second object is compared, etc.

to_json()
classmethod from_json(data)
damaged_by_cut(subsystem)

Return True if this MICE is affected by the subsystem’s cut.

The cut affects the MICE if it either splits the MICE’s mechanism or splits the connections between the purview and mechanism.

class pyphi.models.mechanism.MaximallyIrreducibleCause(ria)

A maximally irreducible cause (MIC).

These can be compared with the built-in Python comparison operators (<, >, etc.). Comparison is based on \(\varphi\) value, then mechanism size.

order_by()

Return a list of values to compare for ordering.

The first value in the list has the greatest priority; if the first objects are equal the second object is compared, etc.

property direction

CAUSE.

Type:

Direction

class pyphi.models.mechanism.MaximallyIrreducibleEffect(ria)

A maximally irreducible effect (MIE).

These can be compared with the built-in Python comparison operators (<, >, etc.). Comparison is based on \(\varphi\) value, then mechanism size.

property direction

EFFECT.

Type:

Direction

class pyphi.models.mechanism.Concept(mechanism=None, cause=None, effect=None, subsystem=None)

The maximally irreducible cause and effect specified by a mechanism.

These can be compared with the built-in Python comparison operators (<, >, etc.). Comparison is based on \(\varphi\) value, then mechanism size.

mechanism

The mechanism that the concept consists of.

Type:

tuple[int]

cause

The MaximallyIrreducibleCause representing the maximally-irreducible cause of this concept.

Type:

MaximallyIrreducibleCause

effect

The MaximallyIrreducibleEffect representing the maximally-irreducible effect of this concept.

Type:

MaximallyIrreducibleEffect

subsystem

This concept’s parent subsystem.

Type:

Subsystem

time

The number of seconds it took to calculate.

Type:

float

property phi

The size of the concept.

This is the minimum of the \(\varphi\) values of the concept’s MaximallyIrreducibleCause and MaximallyIrreducibleEffect.

Type:

float

mice(direction)
property cause_purview

The cause purview.

Type:

tuple[int]

property effect_purview

The effect purview.

Type:

tuple[int]

property purview_union
property cause_repertoire

The cause repertoire.

Type:

np.ndarray

property effect_repertoire

The effect repertoire.

Type:

np.ndarray

property mechanism_state

The state of this mechanism.

Type:

tuple(int)

purview(direction)

Return the purview in the given direction.

unorderable_unless_eq = ['subsystem']
__bool__()

A concept is True if \(\varphi > 0\).

is_congruent(system_state)
resolve_congruence(system_state)

Choose the MIC/MIE that are congruent, if any.

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)