code: def canorth(S):
      "Canonical orthogonalization U/sqrt(lambda)"
      E,U = np.linalg.eigh(S)
      for i in range(len(E)):
          U[:,i] = U[:,i] / np.sqrt(E[i])
      return f canorth(S):
      "Canonical orthogonalization U/sqrt(lambda)"
      E,U = np.linalg.eigh(S)
      for i in range(len(E)):
          U[:,i] = U[:,i] / np.sqrt(E[i])
      return U
docs: Canonical orthogonalization U/sqrt(lambda)