pyphi.mcp.server.build_substrate#

pyphi.mcp.server.build_substrate(tpm, cm=None, node_labels=None, alphabet=None)[source]#

Build a substrate from a transition probability matrix and return a handle.

Parameters:
  • tpm (list) – The transition probability matrix, as nested lists. For binary units, state-by-node form (one row per system state, one column per node, giving each node’s probability of turning on) is the usual input. States are ordered little-endian: the FIRST node is the least-significant bit, so state (0, 0, 1) is row index 4 in a 3-node system, not row 1. For multi-valued units, pass the joint array of shape (*alphabet, n_units, max_alphabet): entry [s_1, ..., s_n, i, k] is the probability that unit i is in state k at the next step given current state (s_1, …, s_n), with zeros past a unit’s own alphabet size.

  • cm (list, optional) – The connectivity matrix (cm[i][j] == 1 means node i is an input to node j). If omitted, full connectivity is assumed — always correct, but slower. A wrong connectivity matrix produces a wrong Φ, so omit it when unsure rather than guessing.

  • node_labels (list of str, optional) – Labels for the nodes; defaults to n0, n1, n2, ….

  • alphabet (list of int, optional) – The number of states per node, for multi-valued (k-ary) units, with tpm in the joint form above. Defaults to binary. Note that more states does not necessarily mean more Φ.

Returns:

dict – The substrate handle and a summary of its nodes and connectivity.

Return type:

dict[str, Any]