pyphi.connectivity.subadjacency#

pyphi.connectivity.subadjacency(cm, source, target=None)[source]#

Return the sub-adjacency matrix for two groups of nodes.

This gives the connections from the first group to the second group.

Parameters:
  • cm (ArrayLike) – A connectivity matrix.

  • source (Iterable[int]) – The source nodes.

  • target (Iterable[int] or None) – The target nodes. If None, defaults to the same nodes as source.

Return type:

ndarray[tuple[Any, …], dtype[int64]]

Examples

>>> cm = np.identity(5)
>>> subadjacency(cm, (2, 3))
array([[1., 0.],
       [0., 1.]])
>>> subadjacency(cm, (0, 1), (1, 2))
array([[0., 0.],
       [1., 0.]])