| Crates.io | iit |
| lib.rs | iit |
| version | 0.1.0 |
| created_at | 2025-11-10 21:26:34.858089+00 |
| updated_at | 2025-11-10 21:26:34.858089+00 |
| description | Complete Integrated Information Theory (IIT) 3.0 library for calculating Phi and analyzing consciousness in neural systems |
| homepage | |
| repository | https://github.com/Yatrogenesis/cortexia-workspace |
| max_upload_size | |
| id | 1926222 |
| size | 176,904 |
A complete Rust implementation of Integrated Information Theory (IIT) 3.0, a mathematical framework for quantifying consciousness and integrated information in neural and computational systems.
IIT quantifies consciousness as Φ (Phi) - integrated information that measures how much a system is irreducible to its parts. This library provides:
Add to your Cargo.toml:
[dependencies]
iit = "0.1.0"
use iit::*;
// Create a 3-neuron system
let mut system = IITSystem::new(3);
// Set up all-to-all connectivity
for i in 0..3 {
for j in 0..3 {
if i != j {
system.set_connection(i, j, true).unwrap();
}
}
}
// Set system state
system.set_state(vec![1, 0, 1]).unwrap();
// Calculate Φ
let result = system.calculate_phi().unwrap();
println!("Φ = {}", result.phi);
use iit::*;
let system = IITSystemBuilder::new(4)
.state(vec![1, 1, 0, 1])
.fully_connected()
.approximation(ApproximationMethod::Geometric)
.parallel(true)
.build()
.unwrap();
let result = system.calculate_phi().unwrap();
use iit::*;
let mut system = fully_connected_system(3);
system.set_state(vec![1, 0, 1]).unwrap();
let ces = system.identify_concepts().unwrap();
println!("Found {} concepts", ces.n_concepts());
// Get top concepts by Φ
let top = ces.core(5);
for concept in top {
println!("Mechanism {:?}: Φ = {:.4}", concept.mechanism, concept.phi);
}
use iit::*;
let methods = vec![
ApproximationMethod::Geometric,
ApproximationMethod::Spectral,
ApproximationMethod::MeanField,
ApproximationMethod::Tau,
];
let mut system = fully_connected_system(10);
system.set_state(vec![1; 10]).unwrap();
for method in methods {
let mut config = PhiConfig::default();
config.approximation = method;
system.set_config(config);
let result = system.calculate_phi().unwrap();
println!("{:?}: Φ = {:.4}", method, result.phi);
}
use iit::*;
let mut system = fully_connected_system(3);
system.set_state(vec![1, 1, 0]).unwrap();
let qualia = system.analyze_qualia_space().unwrap();
println!("Concepts: {}", qualia.n_concepts);
println!("Mean Φ: {:.4}", qualia.mean_phi);
println!("Max Φ: {:.4}", qualia.max_phi);
IIT proposes that consciousness corresponds to integrated information. A system is conscious to the extent that it:
Φ (Phi) is defined as the distance between:
For a mechanism M in state s:
iit/
├── src/
│ ├── lib.rs # Main API and IITSystem
│ ├── phi.rs # Φ calculation methods
│ ├── partition.rs # MIP search and partition enumeration
│ ├── repertoire.rs # Cause and effect repertoires
│ ├── causality.rs # Cause-effect structure
│ ├── concepts.rs # Concept identification
│ ├── emd.rs # Earth Mover's Distance
│ └── error.rs # Error types
├── tests/ # Integration tests
├── benches/ # Performance benchmarks
└── examples/ # Usage examples
IITSystem: Main system representationPhiResult: Results of Φ calculationConcept: A mechanism with cause-effect powerCauseEffectStructure: Constellation of conceptsRepertoire: Probability distribution over statesMICE: Maximally irreducible cause-effectconfig.parallel = truemin_phi threshold to reduce computationRun tests:
cargo test
Run benchmarks:
cargo bench
Run examples:
cargo run --example basic_usage
Contributions are welcome! Areas of interest:
Licensed under either of:
at your option.
If you use this library in academic work, please cite:
@software{iit_rust,
author = {Francisco Molina Burgos and Claude-CORTEXIA},
title = {IIT: Integrated Information Theory 3.0 in Rust},
year = {2024},
url = {https://github.com/cortexia/iit}
}
Oizumi, M., Albantakis, L., & Tononi, G. (2014). From the phenomenology to the mechanisms of consciousness: Integrated Information Theory 3.0. PLOS Computational Biology, 10(5), e1003588.
Balduzzi, D., & Tononi, G. (2008). Integrated information in discrete dynamical systems: Motivation and theoretical framework. PLOS Computational Biology, 4(6), e1000091.
Tononi, G. (2004). An information integration theory of consciousness. BMC Neuroscience, 5(1), 42.
Tononi, G., Boly, M., Massimini, M., & Koch, C. (2016). Integrated information theory: from consciousness to its physical substrate. Nature Reviews Neuroscience, 17(7), 450-461.
This implementation is based on the theoretical work of Giulio Tononi and collaborators at the University of Wisconsin-Madison. We thank the IIT community for their open discussion of the theory and its implementation challenges.