Repertoires
iitx.repertoires
Repertoires: the distributions a mechanism specifies over a purview.
This is the shared kernel layer of the library (docs/design.md §6.1): everything both
IIT versions compute is built from the repertoire algebra here, which in turn is nothing
but mask-parameterized tensor algebra over the factored view of a system
(:func:iitx.system.node_tpms).
Full-shape embedding. A repertoire over a purview Z is mathematically a
distribution over the states of Z alone, but iitx always represents it as a
full-shape tensor over the states of all units, with the units outside the purview
carried as an exactly uniform, independent factor (docs/design.md §2, P3). Every
repertoire therefore has the same shape regardless of its purview, which is what lets one
compiled kernel vmap over tables of mechanism and purview masks. The embedding is
lossless — the purview distribution is recovered by summing out the uniform axes — and it
is transparent to the Hamming-metric EMD, which costs nothing for moving an identical
uniform factor onto itself.
Semantics (the conventions of both theories, fixed by the papers and the oracle):
- Cause (Bayes under a uniform interventional prior): each mechanism unit contributes the likelihood of its observed state as a function of the previous system state; each likelihood is uniformly marginalized over non-purview units before the product over mechanism units (the "virtual elements" / product-probability doctrine that severs common-input correlations); the product is then normalized.
- Effect (forward perturbation): each purview unit contributes its next-value distribution given the mechanism clamped to its observed state and every other unit uniformly perturbed; the repertoire is the product over purview units.
- The unconstrained repertoire is the same computation with an empty mechanism: uniform over the purview on the cause side, and the fully perturbed one-step distribution on the effect side (not uniform in general).
repertoire(node_tpms, state, mechanism, purview, direction)
Compute the repertoire a mechanism in a state specifies over a purview.
Implements Eqs. S2-S9 of Oizumi et al. (2014) Text S2 — equivalently the product
probabilities of Eqs. 29-30 of Albantakis et al. (2023) — in the marginalize-then-
multiply form both theories mandate. An empty mechanism yields the unconstrained
repertoire.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_tpms
|
tuple[Array, ...]
|
The factored view of the (already background-conditioned) system: one
array of shape |
required |
state
|
Array
|
Current state of the system, shape |
required |
mechanism
|
Array
|
Mask of the mechanism units, shape |
required |
purview
|
Array
|
Mask of the purview units, shape |
required |
direction
|
Direction
|
|
required |
Returns:
| Type | Description |
|---|---|
Array
|
Full-shape tensor of shape |
Array
|
uniform factor on non-purview axes. Sums to 1, except for a cause repertoire whose |
Array
|
mechanism state is unreachable within the purview, which is identically zero (the |
Array
|
convention under which its φ is zero, matching PyPhi). |
Source code in src/iitx/repertoires.py
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 | |
purview_distribution(full, purview)
Recover the bare purview distribution from a full-shape repertoire.
Sums out the uniform non-purview axes (keeping dimensions, so the shape is stable
under vmap): the result is the distribution over purview states, broadcast along
singleton-like constant axes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
full
|
Array
|
Full-shape repertoire, shape |
required |
purview
|
Array
|
Mask of the purview units, shape |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Tensor of shape |
Array
|
purview-state probabilities. |
Source code in src/iitx/repertoires.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |
condition(node_tpms, state, candidate)
Clamp non-candidate previous-state axes of the factors at the current state.
This is the frozen-background conditioning shared by both theory versions on the effect side (and by IIT 3.0 on the cause side): units outside the candidate system are fixed at their current state. The clamped factors are constant along background axes, so downstream uniform marginalization leaves them untouched.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_tpms
|
tuple[Array, ...]
|
Per-unit conditionals of the whole system. |
required |
state
|
Array
|
Current state of the whole system, shape |
required |
candidate
|
Array
|
Mask of the candidate system's units, shape |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Factors constant along background axes, equal to their value at the current |
...
|
background state. |
Source code in src/iitx/repertoires.py
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | |
sever(node_tpms, cut)
Noise the connections a cut severs.
Severed inputs are uniformly marginalized out of the receiving unit's conditional, so each unit perceives its severed sources as independent noise — the cut semantics of both theory versions (IIT 3.0 unidirectional cuts and IIT 4.0 directional partitions differ only in which cut matrices are enumerated).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_tpms
|
tuple[Array, ...]
|
Per-unit conditionals. |
required |
cut
|
Array
|
Cut matrix, shape |
required |
Returns:
| Type | Description |
|---|---|
tuple[Array, ...]
|
The partitioned factors. |
Source code in src/iitx/repertoires.py
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 | |