pyphi.convert.le_index2state#

pyphi.convert.le_index2state(i, number_of_nodes)[source]#

Convert a decimal integer to a PyPhi state-tuple using the little-endian convention.

The output is the reverse of be_index2state().

Parameters:
  • i (int) – A decimal integer corresponding to a substrate state under the little-endian convention.

  • number_of_nodes (int) – The number of nodes in the system.

Returns:

tuple[int] – A state-tuple where the i-th element gives the state of the i-th node.

Examples

>>> number_of_nodes = 5
>>> le_index2state(1, number_of_nodes)
(1, 0, 0, 0, 0)
>>> number_of_nodes = 8
>>> le_index2state(7, number_of_nodes)
(1, 1, 1, 0, 0, 0, 0, 0)