pyphi.convert.be_index2state#

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

Convert a decimal integer to a PyPhi state-tuple using the big-endian convention, in which the most-significant bit corresponds to the lowest-index node.

The output is the reverse of le_index2state().

Parameters:
  • i (int) – A decimal integer corresponding to a substrate state under the big-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
>>> be_index2state(1, number_of_nodes)
(0, 0, 0, 0, 1)
>>> number_of_nodes = 8
>>> be_index2state(7, number_of_nodes)
(0, 0, 0, 0, 0, 1, 1, 1)