pyphi.macro.units.MacroUnit#

class pyphi.macro.units.MacroUnit(constituents, update_grain, mapping, background_apportionment=())[source]#

Bases: object

A macro unit J = (U^J, V^J, tau'_J, g'_J, W^J) (Eq. 12).

Parameters:
  • constituents (tuple[MacroUnit | int, ...]) – Direct constituents V^J — micro unit indices or meso MacroUnit objects. Order fixes the truth-table digit order.

  • update_grain (int) – tau'_J — constituent updates per unit update.

  • mapping (tuple[int, ...]) – g'_J as a flat truth table of 0/1 entries over the prod(alphabets) ** update_grain joint sequence-states of the constituents (see module docstring for digit order).

  • background_apportionment (tuple[int, ...]) – W^J — universe indices apportioned to this unit.

property alphabet_size: int#

Number of unit states (binary).

property constituent_alphabet_sizes: tuple[int, ...][source]#

Alphabet size of each direct constituent.

property micro_constituents: tuple[int, ...][source]#

the sorted union of micro constituents.

Type:

U^J

property constituent_micro_grain: int[source]#

The common micro grain of the direct constituents.

property micro_grain: int[source]#

micro updates spanned by one update of this unit.

Type:

tau_J

state_from(history)[source]#

The unit’s state given a micro-state window of U^J (Eq. 22).

Parameters:

history (sequence of tuple[int, ...]) – Sequence of length micro_grain of micro states of U^J (each a tuple of 0/1 values ordered by ascending micro index), oldest first.

Returns:

int – The macro state j = g_J applied to the window.

Return type:

int

property micro_mapping: tuple[int, ...][source]#

the composed truth table over micro windows (Eq. 15).

Indexed with the same convention as mapping, with the micro constituents of U^J in ascending order as the within-update digits.

Type:

g_J