def fun(x): w, v = np.linalg.eigh(x, 'U') return tuple((w, np.abs(v)))
def fun(x): u, s, v = np.linalg.svd(x, full_matrices=False) return tuple((u, s, v)) return grad(fun)(x)
def fun(x): w, v = np.linalg.eigh(x) return tuple((w, v))
def fun(x): w, v = np.linalg.eigh(x, 'U') return tuple((w, v))
def fun(x): u, s, v = np.linalg.svd(x, full_matrices=False) return tuple((np.abs(u), s, np.abs(v)))
def fun(x): w, v = np.linalg.eig(x) return tuple((np.abs(w), np.abs(v)))