np.linalg.norm with the axis argument is too new for phonopy users; rewrote in a different way