API reference#

The modules a user of PyPhi works with, grouped by what they do. Each entry opens the module’s page: its functions, classes, and submodules. Modules that only serve the package’s internals (import deferral, registries, protocols, type aliases, utilities) are not listed.

The top-level namespace#

import pyphi gives the everyday API in one place: Substrate, System, analyze, sweep, examples, and config.

The example networks page shows every registered example rendered from the objects themselves.

pyphi

PyPhi

Substrates and systems#

pyphi.substrate

Represents the substrate of interest.

pyphi.system

System value type — (Substrate, state, node_subset, partition).

pyphi.substrate_generator

High-level interface for creating systems by specifying architecture.

pyphi.examples

Example substrates and systems to go along with the documentation.

pyphi.estimate

Estimate substrates from observed transitions, with epistemic uncertainty.

pyphi.labels

Helper class representing labels of substrate nodes.

pyphi.connectivity

Functions for determining substrate connectivity properties.

pyphi.convert

Conversion functions.

pyphi.validate

Methods for validating user input.

Analysis#

pyphi.analyze(substrate, state, *[, subset, ...])

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

pyphi.sweep(substrates, *, states[, ...])

Run a computation across the cartesian product of axes into a tidy table.

pyphi.cost

Analytic workload counting for single-system analyses.

pyphi.conf

Layered configuration system for PyPhi.

pyphi.formalism

Phi formalisms — strategies for computing integrated information.

pyphi.partition

Utilities for generating partitions.

pyphi.direction

Causal directions.

pyphi.relations

Implements the formalism for computing relations.

pyphi.resolve_ties

Resolve ties between IIT objects.

pyphi.condensation

Condensation of candidate systems into complexes.

pyphi.compositional_state

pyphi.macro

Intrinsic-units macro framework (Marshall et al. 2026).

pyphi.actual

Methods for computing actual causation of systems and mechanisms.

pyphi.matching

The matching formalism: perception and matching.

pyphi.landscape

Continuous-parameter analysis of IIT quantities over substrate space.

pyphi.optimize(builder, state, bounds, *, seed)

Search a substrate's weights for a maximizer of an IIT quantity.

pyphi.dynamics

Functions for simulating system state trajectories.

Results#

pyphi.models

See pyphi.models.sia, pyphi.models.mice, and pyphi.models.partitions for documentation.

pyphi.display

Unified object display: declarative descriptions rendered by pluggable backends.

pyphi.numerics

Tolerant scalar comparison of φ, Φ, and α values.

pyphi.measures

Distance functions.

pyphi.serialize

Typed, compact (de)serialization of PyPhi results via msgspec.

pyphi.provenance

Provenance record attached to top-level result objects.

pyphi.graph

Bridge between PyPhi value types and graph representations.

pyphi.visualize

Provides visualization capabilities for PyPhi objects.

pyphi.exceptions

PyPhi exceptions.

Infrastructure#

pyphi.parallel

Provides an interface for parallel computation.

pyphi.cache

Memoization and caching utilities.

pyphi.campaign

Distribute PyPhi computations across an HTCondor pool as batch campaigns.

pyphi.mcp

Model Context Protocol server exposing PyPhi to AI agents.

pyphi.log

Utilities for logging and progress bars.

Lower-level building blocks#

pyphi.core

Lower-level value types and primitives shared across PyPhi.

pyphi.distribution

Functions for manipulating probability distributions.

pyphi.timescale

Functions for manipulating the timescale of TPMs.

pyphi.automorphism

Behavior-aware substrate canonicalization.