numpy.ndarray: binary string as numpy.ndarray of ints.
if isinstance(state_vector, dict) or isinstance(state_vector, OrderedDict):
temp_vec = np.zeros(2**n)
total = 0
for i in range(2**n):
state = np.binary_repr(i, n)
count = state_vector.get(state, 0)
temp_vec[i] = count
total += count
state_vector = temp_vec / float(total)
k = np.argmax(np.abs(state_vector))
x = np.zeros(n)
for i in range(n):
After Change
x = np.asarray([int(y) for y in list(binary_string)])
return x
else:
n = int(np.log2(state_vector.shape[0]))
k = np.argmax(np.abs(state_vector))
x = np.zeros(n)
for i in range(n):
x[i] = k % 2