Avoid using names like vectors and matrices when indicated numpy arrays. Expected matrix behavior (Hadamard product versus matrix product) and the differences between the np.array and np.matrix classes may be confused here.