pyphi.timescale.run_tpm#
- pyphi.timescale.run_tpm(tpm, time_scale)[source]#
Iterate a TPM by the specified number of time steps.
- Parameters:
tpm (np.ndarray) – A state-by-node TPM.
time_scale (int) – The number of steps to run the TPM.
- Returns:
np.ndarray – The state-by-node TPM advanced by
time_scalesteps.- Raises:
pyphi.exceptions.ConditionallyDependentError – If the iterated dynamics are not conditionally independent, so no state-by-node TPM can represent them. Iterating typically introduces conditional dependence between nodes that share inputs, even though the single-step TPM is conditionally independent by construction.
Notes
The TPM is converted to state-by-state form and raised to the
time_scalepower there, then converted back. A scipy sparse matrix power (sparse_time()) is used when thesparse()heuristic, evaluated on the state-by-state matrix actually being raised to a power, returns true — i.e. when at most 10% of its entries are nonzero — and a dense power (dense_time()) otherwise.