pyphi.core.tpm.joint.JointTPM#

class pyphi.core.tpm.joint.JointTPM(data, node_labels=None, alphabet_sizes=None)[source]#

Bases: Displayable, ToPandasMixin

Read-only joint (dense) form of a substrate TPM. See module docstring.

Parameters:
  • data (ArrayLike)

  • node_labels (Sequence[str] | None)

  • alphabet_sizes (Sequence[int] | None)

property alphabet_sizes: tuple[int, ...]#

The per-unit output alphabet sizes.

Unchanged by condition(), which collapses input axes to singletons but leaves each unit’s output distribution intact.

condition(fixed)[source]#

Return the joint view with the given input units fixed to a state.

The conditioned axes collapse to singletons; the number of dimensions is unchanged, and alphabet_sizes still reports the true per-unit output alphabets.

Parameters:

fixed (Mapping[int, int])

Return type:

JointTPM

grid_section()[source]#

The transition grid as a labeled display Section.

Mirrors grid_section(), reading each unit’s per-state distribution from the explicit-alphabet array. Binary substrates get one P(on) column per unit; non-binary ones get one column per (unit, next-state) pair.

Return type:

Section

to_xarray()[source]#

Return the joint as a labeled xarray.DataArray.

Dims are ("u0", ..., "u{N-1}", "unit", "out"): the leading axes index each unit’s current state, unit selects the output unit, and out its next state. Values are the explicit-alphabet joint. Requires the optional xarray dependency.

Return type:

Any