code: def eigenvectors_from_displacements(disp,masses):
      
      nphonons,natoms,ndirections = disp.shape
      sqrt_masses = np.sqrt(masses)
      return np.einsum("nax,a->nax",disp,sqrt_masses)
docs: Calculate the eigenvectors from the atomic displacements