def _get_possible_outcomes(m, bits):
 size = max(m.shape)
 nqubits = int((math.log(size, 2) + 0.1))
 output_matrices = []
 for i in range((1 << len(bits))):
  output_matrices.append(zeros((2 ** nqubits), 1))
 bit_masks = []
 for bit in bits:
  bit_masks.append((1 << bit))
 for i in range((2 ** nqubits)):
  trueness = 0
  for j in range(len(bit_masks)):
   if (i & bit_masks[j]):
    trueness += (j + 1)
  output_matrices[trueness][i] = m[i]
 return output_matrices

def _get_possible_outcomes ( m , bits ) : size = max ( m . shape ) nqubits = int ( ( math . log ( size , 2 ) + 0.1 ) ) output_matrices = [ ] for i in range ( ( 1 << len ( bits ) ) ) : output_matrices . append ( zeros ( ( 2 ** nqubits ) , 1 ) ) bit_masks = [ ] for bit in bits : bit_masks . append ( ( 1 << bit ) ) for i in range ( ( 2 ** nqubits ) ) : trueness = 0 for j in range ( len ( bit_masks ) ) : if ( i & bit_masks [ j ] ) : trueness += ( j + 1 ) output_matrices [ trueness ] [ i ] = m [ i ] return output_matrices
get the possible states that can be produced in a measurement .