def _numpy_tensor_product(*product):
 if (not np):
  raise ImportError
 answer = product[0]
 for item in product[1:]:
  answer = np.kron(answer, item)
 return answer

def _numpy_tensor_product ( * product ) : if ( not np ) : raise ImportError answer = product [ 0 ] for item in product [ 1 : ] : answer = np . kron ( answer , item ) return answer
numpy version of tensor product of multiple arguments .