The authors have declared that no competing interests exist.
Integrated information theory provides a mathematical framework to fully characterize the causeeffect structure of a physical system. Here, we introduce
This is a
Integrated information theory (IIT) has been proposed as a theory of consciousness. The central hypothesis is that a physical system has to meet five requirements (‘postulates’) in order to be a physical substrate of subjective experience: (1)
From these postulates, IIT develops a mathematical framework to assess the causeeffect structure (CES) of a physical system that is applicable to discrete dynamical systems. This framework has proven useful not only for the study of consciousness but has also been applied in research on complexity [
The main measure of causeeffect power,
Here we describe
Details of the mathematical framework are published elsewhere [
The software has two primary functions: (1) to unfold the full CES of a discrete dynamical system of interacting elements and compute its Φ value, and (2) to compute the maximallyirreducible causeeffect repertoires of a particular set of elements within the system. The first is function is implemented by
The CES is composed of
The starting point for the IIT analysis is a discrete Markovian dynamical system
Each node has its own TPM—in this case, the truthtable of a deterministic logic gate. Yellow signifies the “ON” state; white signifies “OFF”. The system’s TPM (right) is composed of the TPMs of its nodes (left), here shown in statebynode form (see § Representation of the TPM and probability distributions). Note that in PyPhi’s TPM representation, the first node’s state varies the fastest, according to the littleendian convention (see § 2dimensional statebynode form).
Such a discrete dynamical system is completely specified by its transition probability matrix (TPM), which contains the probabilities of all state transitions from
Formally, if we let
Moreover, IIT assumes that there is no instantaneous causation; that is, it is assumed that the elements of the dynamical system influence one another only from one timestep to the next. Therefore we require that the system satisfies the following Markov condition, called the
In PyPhi, the system under analysis is represented by a
Once the
The mathematical framework of IIT is typically formulated using graphical causal models as representations of physical systems of elements. The framework builds on the causal calculus of the
For reference, we define a set of graphical operations that are used during the IIT analysis. To
In this section we demonstrate some of the capabilities of the software by unfolding the CES of a small deterministic system of logic gates as described in [
PyPhi functions are named in boxes, with arguments in grey. Arrows point from callee to caller. Functions are organized by the postulate they correspond to (left). ⊗ denotes the tensor product;
PyPhi functions are named in boxes, with arguments in grey. Arrows point from callee to caller. Functions are organized by the postulate they correspond to (left).
The first step is to create the
We select a subsystem and a system state for analysis by creating a
If there are nodes outside the subsystem, they are considered as
The lowestlevel objects in the CES of a system are the
In terms of graphical operations, the effect repertoire is obtained by (1)
The cause repertoire is obtained similarly, but in that case, the purview nodes at time
Note that, operationally, we enforce that each input from a noised node conveys
With the
We see that mechanism
Note that repertoires are returned in multidimensional form, so they can be indexed with state tuples as above. Repertoires can be reshaped to be 1dimensional if needed,
Having assessed the information of a mechanism over a purview, the next step is to assess its
In terms of graphical operations, the irreducibility of a mechanismpurview pair is tested by partitioning it into parts and
The amount of irreducibility of a mechanism over a purview with respect to a partition is quantified as the distance between the unpartitioned repertoire and the partitioned repertoire (calculated with
The MIP search procedure is implemented by the
Here we can see that the MIP attempts to factor the repertoire of
Next, we apply IIT’s postulate of exclusion at the mechanism level by finding the
If the mechanism’s MIC has
We can compute the concept depicted in Fig. 9 of [
Note that in PyPhi, the repertoires are distributions over purview states, rather than system states. Occasionally it is more convenient to represent repertoires as distributions over the entire system. This can be done with the
Also note that
The next step is to compute the CES, the set of all concepts specified by the subsystem. The CES characterizes all of the causal constraints that are intrinsic to a physical system. This is implemented by the
We see that every mechanism in
At this point, the irreducibility of the subsystem’s CES is evaluated by applying the integration postulate at the system level. As with integration at the mechanism level, the idea is to measure the difference made by each partition and then take the minimal value as the irreducibility of the subsystem.
We begin by performing a
The irreducibility of a CES with respect to a partition is the distance between the unpartitioned and partitioned CESs (calculated with
This procedure is implemented by the
The final step in unfolding the CES of the system is to apply the postulate of exclusion at the system level. We compute the CES of each subset of the network, considered as a subsystem (that is,
In this example, we find that the whole system
Note that since
PyPhi was designed to be easy to use in interactive, exploratory research settings while nonetheless remaining suitable for use in largescale simulations or as a component in larger applications. It was also designed to be efficient, given the high computational complexity of the algorithms in IIT. Here we describe some implementation details and optimizations used in the software.
PyPhi supports three different TPM representations: 2
A TPM in statebynode form is a matrix where the entry (
Because the possible system states at
When a statebystate TPM is provided to PyPhi by the user, it is converted to statebynode form and the conditional independence property (
The first entry of this array signifies that if the state of the system is
Most importantly, the multidimensional representation simplifies the calculation of marginal and conditional distributions and cause/effect repertoires, because it allows efficient “broadcasting” [
The cause and effect repertoires of a mechanism over a purview describe how the mechanism nodes in a particular state at
We begin with the simplest case: calculating the effect repertoire of a mechanism
This operation is implemented in PyPhi by several subroutines. First, in a preprocessing step performed when the
In cases where there are mechanism nodes that are not parents of the purview node, the resulting array is multiplied by an array of ones that has the desired shape (dimensions of size two for each mechanism node, and singleton dimensions for each nonmechanism node). Because of NumPy’s broadcasting feature, this step is equivalent to taking the tensor product of the array with the maximumentropy distribution over mechanism nodes that are not parents, so that the final result is a distribution over all mechanism nodes, as desired.
The effect repertoire over a purview of more than one element is given by the tensor product of the effect repertories over each individual purview element,
The cause repertoire of a singleelement mechanism
In PyPhi, the “backward” conditional probabilities Pr(
The cause repertoire of a mechanism with multiple elements is the normalized tensor product of the cause repertoires of each individual mechanism element,
The postulates of IIT induce a natural hierarchy of computations [
Theoretical object  PyPhi object 

Discrete dynamical system 

Candidate system 

System element 

System state  Python 
Mechanism  Python 
Purview  Python 
Repertoire over a purview 
NumPy array with  
MIP  The 
MIC and MIE 

Concept 

The 

CES 

Φ  The 
MICS  The 
Complex  The 
Many aspects of PyPhi’s behavior may be configured via the
Alternatively,
Default settings are used if no configuration is provided. A full description of the available settings and their default values is available in the
Here we describe various optimizations and approximations used by the software to reduce the complexity of the calculations (see § Limitations). Memoization and caching optimizations are described in
As mentioned in § Input, providing connectivity information explicitly with a CM can greatly reduce the time complexity of the computations, because in certain cases missing connections imply reducibility
For example, at the system level, if the subsystem is not strongly connected then Φ is necessarily zero. This is because a unidirectional cut between one system part and the rest can always be found that will not actually remove any edges, so the CESs with and without the cut will be identical (see
Similarly, at the mechanism level, PyPhi uses the CM to exclude certain purviews from consideration when computing a MIC or MIE by efficiently determining that repertoires over those purviews are reducible without needing to explicitly compute them. Suppose there are two sets of nodes
One of the repertoire distances available in PyPhi is the earth mover’s distance (EMD), with the Hamming distance as the ground metric. Computing the EMD between repertoires is a costly operation, with time complexity
Currently, two approximate methods of computing Φ are available. These can be used via settings in the PyPhi configuration file (they are disabled by default):
In both cases, the complexity of the calculation is greatly reduced by replacing the optimal partitioned CES by an approximate solution. The system’s Φ value is then computed as usual as the difference between the unpartitioned CES and the approximate partitioned CES.
The “cut one” approximation reduces the scope of the search for the MIP over possible system cuts. Instead of evaluating the partitioned CES for each of the 2^{n} unidirectional bipartitions of the system, only those 2
For most choices of mechanism partitioning schemes and distance measures, it is possible that the CES of the partitioned system contains concepts that are reducible in the unpartitioned system and thus not part of the unpartitioned CES. For this reason, PyPhi by default computes the partitioned CES from scratch from the partitioned TPM. Under the “no new concepts” approximation, such new concepts are ignored. Instead of repeating the entire CES computation for each system partition, which requires reevaluating all possible candidate mechanisms for irreducibility, only those mechanisms are taken into account that already specify concepts in the unpartitioned CES. In many types of systems, new concepts due to the partition are rare. Approximations using the “no new concepts” option are thus often accurate. Note, however, that this approximation provides neither a theoretical upper nor lower bound on the exact Φ value of the system.
PyPhi’s main limitation is that the algorithm is exponential time in the number of nodes,
Another limitation is that the analysis can only be meaningfully applied to a system that is Markovian and satisfies the conditional independence property. These are reasonable assumptions for the intended use case of the software: analyzing a causal TPM derived using the calculus of perturbations [
PyPhi can be installed with Python’s package manager via the command ‘
Several additional features are in development and will be released in future versions. These include a module for calculating Φ over multiple spatial and temporal scales, as theoretically required by the exclusion postulate (in the current version, the
Illustration of the algorithm.
(PDF)
(PDF)
(PDF)
(PDF)
(PDF)
Note that installing PyPhi via ‘
(ZIP)
Note that accessing the documentation online at
(ZIP)
We thank Andrew Haun, Leonardo Barbosa, Sabrina Streipert, and Erik Hoel for their valuable feedback as early users of the software.