pyphi.timescale.run_cm#
- pyphi.timescale.run_cm(cm, time_scale)[source]#
Iterate a connectivity matrix the specified number of steps.
Raising the connectivity matrix to the
time_scalepower counts directed paths of that length between nodes; every nonzero entry is then clipped back to 1, so the result marks which node pairs are connected by a path oftime_scalesteps.- Parameters:
cm (np.ndarray) – A connectivity matrix.
time_scale (int) – The number of steps to run.
- Returns:
np.ndarray – The connectivity matrix at the new timescale.
Notes
np.linalg.matrix_powerreturns its input unchanged (not a copy) whentime_scale == 1, so a copy is made up front: without it, clipping values back to 1 would mutate the caller’s matrix in place and raise on a read-only one.