pyphi.graph.substrate_from_networkx#
- pyphi.graph.substrate_from_networkx(graph, tpm, *, node_labels=None)[source]#
Build a
Substratefrom a DiGraph topology plus a TPM.The graph supplies the connectivity (its adjacency, self-loops kept) and the node order (
node_labelsif given, elselist(graph.nodes())).tpmis required and must accept the formsSubstrate(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: