System
iitx.system
The system under analysis: a transition probability matrix over discrete units.
A :class:System is the only input iitx accepts. It knows nothing about where it came
from — a cellular automaton, a logic circuit, a neural recording, a coarse-grained macro
level — which is what makes the library general (docs/design.md §2, P8).
The canonical form is a state-by-state transition probability matrix over units with
arbitrary finite alphabets. Mechanism-level IIT additionally requires the units to be
conditionally independent given the previous state; that is a checked property here
(:func:node_tpms), never an unchecked assumption and never silently enforced by a lossy
conversion.
System
dataclass
A finite discrete dynamical system, given by its transition probability matrix.
The transition probability matrix is interventional: tpm[u, v] is
p(v | do(u)), the probability of state v one step after the system is
perturbed into state u. It is not an observed frequency. Deterministic systems are
the special case where every row is a one-hot vector.
States are indexed in little-endian mixed-radix order (see :mod:iitx.states), so
tpm has shape (Q, Q) with Q = prod(shape).
The constructor performs no validation, because it is also the pytree constructor and
must accept tracers under jax.jit. Call :func:validate at the boundary where a
system enters the library from user code.
Attributes:
| Name | Type | Description |
|---|---|---|
tpm |
Array
|
State-by-state transition probabilities, shape |
shape |
tuple[int, ...]
|
Per-unit alphabet sizes |
cm |
Array | None
|
Connectivity, shape |
Source code in src/iitx/system.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |
n
property
Number of units.
num_states
property
Number of states of the whole system, Q = prod(shape).
from_node_tpms(node_tpms, cm=None)
classmethod
Build a system from per-unit conditional distributions.
This is the conditionally independent construction: the joint transition
probability is the product of the units' conditionals, so the resulting system
satisfies :func:is_conditionally_independent by construction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_tpms
|
tuple[Array, ...]
|
One array per unit; unit |
required |
cm
|
Array | None
|
Connectivity, or |
None
|
Returns:
| Type | Description |
|---|---|
System
|
The system whose state-by-state matrix is the product of these conditionals. |
Source code in src/iitx/system.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | |
from_state_by_node(tpm, cm=None)
classmethod
Build a binary system from a state-by-node matrix.
The state-by-node form is PyPhi's most common input: tpm[u, i] is the
probability that binary unit i is ON one step after the system is perturbed
into state u. It presumes conditional independence, since it specifies only
the marginals.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tpm
|
Array
|
Probabilities of each unit being ON, shape |
required |
cm
|
Array | None
|
Connectivity, or |
None
|
Returns:
| Type | Description |
|---|---|
System
|
The equivalent system over |
Source code in src/iitx/system.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |
connectivity(system)
Return the system's connectivity matrix, resolving None to fully connected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
system
|
System
|
The system. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Boolean array of shape |
Array
|
unit |
Source code in src/iitx/system.py
143 144 145 146 147 148 149 150 151 152 153 154 155 156 | |
node_tpms(system, *, check_independence=True, tolerance=None)
Derive the per-unit conditional distributions of a system.
This is the factored view that mechanism-level IIT requires: unit i's array holds
p(u_i' = v | u), obtained by marginalizing the state-by-state matrix over the other
units' next states.
The factored view describes the same dynamics as the state-by-state matrix only when
the units are conditionally independent given the previous state. When they are not,
marginalizing discards the dependencies, so iitx refuses rather than silently
returning a different system — the failure PyPhi's convert module documents as a
"danger". Model dependent units by adding hidden units, as both IIT papers prescribe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
system
|
System
|
The system. |
required |
check_independence
|
bool
|
Whether to verify that the units are conditionally independent. Disable only for systems already validated, and never with a state-by-state matrix of unknown provenance. |
True
|
tolerance
|
float | None
|
Absolute tolerance of the conditional-independence check, or |
None
|
Returns:
| Type | Description |
|---|---|
Array
|
One array per unit; unit |
...
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/iitx/system.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | |
is_conditionally_independent(system, *, tolerance=None)
Test whether a system's units are conditionally independent given the previous state.
Conditional independence means p(u' | u) = prod_i p(u_i' | u) for every pair of
states. It is an assumption of both IIT 3.0 and IIT 4.0, and it is what allows every
repertoire to be built from per-unit factors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
system
|
System
|
The system. |
required |
tolerance
|
float | None
|
Absolute tolerance on each transition probability, or |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
Whether the state-by-state matrix equals the product of its per-unit marginals. |
Source code in src/iitx/system.py
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | |
validate(system)
Check that a system is well formed, and return it unchanged.
Validation happens at the boundary between user code and the library, never inside a jitted kernel: the checks are data-dependent and raise Python exceptions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
system
|
System
|
The system to check. |
required |
Returns:
| Type | Description |
|---|---|
System
|
The same system, so this composes as |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the alphabet sizes, matrix shapes, or probabilities are invalid. |
Source code in src/iitx/system.py
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | |
is_strongly_connected(system, units=None)
Test whether a candidate's units are strongly connected under the connectivity.
A system that is not strongly connected has a part with no causes or no effects in the rest, so its integrated information is zero by definition — both theory versions short-circuit on this.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
system
|
System
|
The system. |
required |
units
|
tuple[int, ...] | None
|
The candidate's units; |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
Whether every unit reaches every other along directed connections (a single unit |
bool
|
is trivially strongly connected). |
Source code in src/iitx/system.py
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 | |