PyPhi is a Python library for computing integrated information (𝚽), and the associated quantities and objects.
If you use this code, please cite the paper:
Mayner WGP, Marshall W, Albantakis L, Findlay G, Marchman R, Tononi G. (2018) PyPhi: A toolbox for integrated information theory. PLOS Computational Biology 14(7): e1006343. https://doi.org/10.1371/journal.pcbi.1006343
An illustrated tutorial on how Φ is calculated is available as a supplement to the paper.
- Documentation for the latest stable release
- Documentation for the latest (potentially unstable) development version.
- Documentation is also available within the Python interpreter with the
helpfunction.
uv is a fast Python package manager. Install it with:
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"Then install PyPhi:
uv pip install pyphiSet up a Python 3.12+ virtual environment and install with:
pip install pyphiTo install the latest development version, which is a work in progress and may have bugs, run:
pip install "git+https://github.com/wmayner/pyphi@develop#egg=pyphi"Note: The conda package is deprecated. Please use uv or pip instead.
If you encounter issues on Windows with older systems, you can use the Anaconda Python distribution and install PyPhi with conda:
conda install -c wmayner pyphiFor discussion about the software or integrated information theory in general, you can join the pyphi-users group.
For technical issues with PyPhi or feature requests, please use the issues page.
To help develop PyPhi, fork the project on GitHub and install with uv:
# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone your fork
git clone https://github.com/YOUR_USERNAME/pyphi.git
cd pyphi
# Create virtual environment and install with dev dependencies
uv venv
uv pip install -e ".[dev,parallel,visualize,graphs,emd,caching]"The Makefile defines some tasks to help with development:
make testruns the unit tests every time you change the source code.
make benchmarkruns performance benchmarks.
make docsbuilds the HTML documentation.
With uv, all dependencies including compiled packages are installed automatically from pre-built wheels. If you need system headers for development:
sudo apt-get install python3-devAll dependencies now have pre-built wheels for Windows, so installation should work seamlessly with uv:
# Install uv
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# Install PyPhi for development
uv venv
uv pip install -e ".[dev]"If you encounter issues, the legacy conda approach is still available (see Installation section above).
Mayner WGP, Marshall W, Albantakis L, Findlay G, Marchman R, Tononi G. (2018) PyPhi: A toolbox for integrated information theory. PLOS Computational Biology 14(7): e1006343. https://doi.org/10.1371/journal.pcbi.1006343
@article{mayner2018pyphi,
title={PyPhi: A toolbox for integrated information theory},
author={Mayner, William GP and Marshall, William and Albantakis, Larissa and Findlay, Graham and Marchman, Robert and Tononi, Giulio},
journal={PLoS Computational Biology},
volume={14},
number={7},
pages={e1006343},
year={2018},
publisher={Public Library of Science},
doi={10.1371/journal.pcbi.1006343},
url={https://doi.org/10.1371/journal.pcbi.1006343}
}
Albantakis L, Oizumi M, Tononi G (2014). From the Phenomenology to the Mechanisms of Consciousness: Integrated Information Theory 3.0. PLoS Comput Biol 10(5): e1003588. doi: 10.1371/journal.pcbi.1003588.
@article{iit3,
title={From the Phenomenology to the Mechanisms of Consciousness:
author={Albantakis, Larissa AND Oizumi, Masafumi AND Tononi, Giulio},
Integrated Information Theory 3.0},
journal={PLoS Comput Biol},
publisher={Public Library of Science},
year={2014},
month={05},
volume={10},
pages={e1003588},
number={5},
doi={10.1371/journal.pcbi.1003588},
url={http://dx.doi.org/10.1371%2Fjournal.pcbi.1003588}
}
This project is inspired by a previous project written in Matlab by L. Albantakis, M. Oizumi, A. Hashmi, A. Nere, U. Olcese, P. Rana, and B. Shababo.
Correspondence regarding this code and the PyPhi paper should be directed to Will Mayner, at mayner@wisc.edu. Correspondence regarding the Matlab code and the IIT 3.0 paper should be directed to Larissa Albantakis, PhD, at albantakis@wisc.edu.