pyphi.system.System#

class pyphi.system.System(substrate, state, node_indices=None, partition=None, external_indices=None, background_conditioning=None, background_state=None)[source]#

Bases: Displayable, ToPandasMixin, Serializable

A substrate evaluated in a specific state over a node subset, with partition.

The external_indices field specifies which substrate units are the background when computing repertoires. When None (the default), it resolves in __post_init__ to substrate - node_indices, the background units W = U S, which under the default convention are causally marginalized conditional on the current state (Albantakis et al. 2023, Eqs. 3-4). An explicit override (used by TransitionSystem for actual-causation analysis) may overlap with node_indices.

The background_conditioning field pins this System to one cause-side background convention. None (the default) resolves config.formalism.iit.background_conditioning at compute time.

The background_state field supplies the state at which external units are conditioned, when that differs from state. None (the default) conditions them at state. Used by TransitionSystem for actual causation, where the cause direction evaluates mechanisms against the observed after-state while the background is fixed at the observed before-state.

Parameters:
apply_cut(partition)[source]#

Return a new System with the given partition applied.

substrate, state, and node_indices are unchanged. The cause/effect marginals depend only on those inputs — the cut enters downstream through the cut connectivity matrix when node TPMs marginalize out severed inputs — so the marginals are materialized on this instance and shared with the new one rather than re-derived.

Parameters:

partition (DirectedBipartition)

Return type:

System

classmethod from_substrate(substrate, state, nodes=None, partition=None, **kwargs)[source]#

Construct a System from a substrate, state, and optional node subset.

Parameters:
Return type:

System

to_networkx(connectivity='inferred')[source]#

Return the substrate’s networkx.DiGraph with node attributes.

Each node carries state and in_system. Edges default to the TPM-inferred causal connectivity (connectivity="declared" for the declared cm).

Parameters:

connectivity (str)

Return type:

Any

property cause_marginal: CauseMarginals#

Per-system-unit cause factors under the active background convention: the marginalization of Albantakis et al. (2023), Eq. 4, or the background conditioned at its observed state (CONDITION_CURRENT_STATE).

property effect_marginal: FactoredTPM[source]#

Forward TPM conditioned on the external units at their observed state.

property proper_effect_marginal: FactoredTPM[source]#

Effect TPM restricted to system units.

Per system unit i in node_indices, the returned FactoredTPM carries the forward factor of effect_marginal — the external units (external_indices) conditioned at the background reference state — with all non-system input dims dropped, so the returned shape is (*system_alphabet, k_i) per system output unit. Substrate units neither in the system nor external are marginalized uniformly (the noise-background convention). The effect-side dual of proper_cause_marginal.

property proper_cause_marginal: FactoredTPM#

Cause TPM restricted to system units.

Per system unit i in node_indices, the returned FactoredTPM carries the cause factor of cause_marginal — background handled per the active convention (the marginalization of Albantakis et al. (2023), Eq. 4, or the external units conditioned at the background reference state) — with all non-system input dims dropped, so the returned shape is (*system_alphabet, k_i) per system output unit. Substrate units neither in the system nor external are marginalized uniformly (the noise-background convention).

property null_concept: Any[source]#

IIT 3.0 alias for null_distinction.

sia(**kwargs)[source]#

Return the system irreducibility analysis of this system.

Resolves the system- and specification-level measures from config at the public boundary and threads them to the active formalism explicitly, so formalism methods are never called without explicit measures in normal flow.

A system_state keyword, when given, must be the state specification the analysis would itself compute (it is derived deterministically from the system and configuration). Calls with a caller-supplied system_state bypass the disk result cache: nothing verifies the supplied state is the canonical one, so sharing the cache entry would let a non-canonical state poison (and be served by) the plain sia() result.

Parameters:

kwargs (Any)

Return type:

Any

ces(**kwargs)[source]#

Return the cause-effect structure of this system (Eq. 57).

The result is a CauseEffectStructure: the distinctions plus their relations.

Notes

For results computed under an earlier version of IIT (see Reproduce results from earlier versions of IIT): IIT 3.0 has no relations, so under it the CES is exactly the set of distinctions, returned as a ResolvedDistinctions with the concepts as .concepts.

Parameters:

kwargs (Any)

Return type:

Any

distinctions(congruent=False, **kwargs)[source]#

Return the Distinctions of this system.

The set of irreducible cause-effect distinctions specified by mechanisms in the system, without the relations that bind them.

Parameters:
  • congruent (bool) – Filter to the distinctions congruent with the system’s specified state, as the cause-effect structure does, but without the system-partition search. The result is a ResolvedDistinctions equal to ces().distinctions when the specified state is untied, and the unfiltered UnresolvedDistinctions when it ties (see congruent_distinctions()).

  • kwargs (Any)

Return type:

Any

Notes

Congruence filtering can remove every distinction — a system whose mechanisms specify states incongruent with the system’s own has a nonempty unfiltered set and an empty cause-effect structure. The unfiltered count and Σφ_d are therefore upper bounds, not estimates.

For results computed under an earlier version of IIT (see Reproduce results from earlier versions of IIT): IIT 3.0 has no tied specified states, so its distinctions are congruent as computed.

find_mip(direction, mechanism, purview, **kwargs)[source]#

Return the minimum partition for a mechanism over a purview.

Resolves mechanism- and specification-level measures from config at the public boundary so the active formalism’s MIP search is never called without explicit measures in normal flow. Explicit mechanism_measure/specification_measure kwargs override.

Parameters:
  • direction (Any)

  • mechanism (Any)

  • purview (Any)

  • kwargs (Any)

Return type:

Any