qiskit/tools/apps/optimization.py
def index_2_bit(state_index, num_bits):
    """Returns bit string corresponding to quantum state index

    Args:
        state_index (int): basis index of a quantum state
        num_bits (int): the number of bits in the returned string
    Returns:
        numpy.array: A integer array with the binary representation of
            state_index
    """
    return np.array([int(c) for c
                     in np.binary_repr(state_index, num_bits)[::-1]],
                    dtype=np.uint8)
Returns bit string corresponding to quantum state index

    Args:
        state_index (int): basis index of a quantum state
        num_bits (int): the number of bits in the returned string
    Returns:
        numpy.array: A integer array with the binary representation of
            state_index
    
Returns bit string corresponding to quantum state index
Returns bit string corresponding to quantum state index
def index_2_bit(state_index, num_bits):
    return np.array([int(c) for c
                     in np.binary_repr(state_index, num_bits)[::-1]],
                    dtype=np.uint8)
def index_2_bit ( state_index , num_bits ) : return np . array ( [ int ( c ) for c in np . binary_repr ( state_index , num_bits ) [ : : - 1 ] ] , dtype = np . uint8 )
Returns bit string corresponding to quantum state index
Returns bit string corresponding to quantum state index
"""Returns bit string corresponding to quantum state index

    Args:
        state_index (int): basis index of a quantum state
        num_bits (int): the number of bits in the returned string
    Returns:
        numpy.array: A integer array with the binary representation of
            state_index
    """
A integer array with the binary representation of
state_index
A integer array with the binary representation of state_index
numpy.array
state_index
basis index of a quantum state
basis index of a quantum state
num_bits
the number of bits in the returned string
the number of bits in the returned string