pyphi.analyze#

pyphi.analyze(substrate, state, *, subset=None, formalism=None, compute=None, grains=None, parallel_kwargs=None)[source]#

Analyze one candidate system over substrate in state, or run a grain search over the whole substrate.

Parameters:
  • substrate (Any) – The substrate to analyze.

  • state (tuple[int, ...]) – The state of the substrate’s nodes. When the bounds’ maximum micro grain (max_update_grain ** max_depth) exceeds 1, a sequence of that many micro states (oldest first) instead — see pyphi.macro.complexes().

  • subset (optional) – Node indices of the candidate system; None uses the whole substrate. Incompatible with grains.

  • formalism (str or None, optional) – Leave unset to compute IIT under the active configuration. Pass an earlier version’s name ("IIT_4_0_2023" or "IIT_3_0") only to reproduce published results; it applies to this call only. The name a preset is exported under ("iit3") and the preset itself (pyphi.iit3) select the same version. "IIT_4_0_2026" names the default; passing it applies that version’s complete preset, which differs from leaving formalism unset only if the active configuration has been customized. See Reproduce results from earlier versions of IIT.

  • compute (optional) – None returns an Analysis bundle; "sia", "ces", or "distinctions" returns the raw result object; a callable returns compute(system). Incompatible with grains. "distinctions" skips the system-partition search, which is the whole cost of a cause-effect structure over a sparse substrate; see distinctions().

  • grains (optional) – None analyzes the single candidate system. True runs the bounded intrinsic-unit search with default SearchBounds; a SearchBounds instance runs it with those bounds. The search returns its ComplexesResult.

  • parallel_kwargs (dict or None, optional) – Forwarded to pyphi.macro.complexes(); meaningful only with grains.

Returns:

Analysis – The full analysis bundle; the raw result object when compute selects one; or the grain search’s ComplexesResult when grains is set.

Raises:

ValueError – If formalism is not a known version name; if compute is not "sia", "ces", "distinctions", a callable, or None; if grains is not True, a SearchBounds, or None; if grains is combined with subset or compute; or if parallel_kwargs is given without grains.

Return type:

Analysis | Any