pyphi.graph.substrate_from_networkx#

pyphi.graph.substrate_from_networkx(graph, tpm, *, node_labels=None)[source]#

Build a Substrate from a DiGraph topology plus a TPM.

The graph supplies the connectivity (its adjacency, self-loops kept) and the node order (node_labels if given, else list(graph.nodes())). tpm is required and must accept the forms Substrate(tpm=...) accepts, with a unit order matching the node order. Construction validates connectivity, so a topology that omits a real TPM edge is rejected.

Parameters:

graph (networkx.DiGraph)

Return type:

Substrate