def mtakfac(m):
u, s, v = msvd(np.asarray(m, dtype=complex))<EOL>f = np.sqrt(u.conj().T @ v.conj())<EOL>w = v @ f<EOL>return w, s<EOL>
Modified Takagi factorization of a (complex) symmetric matrix.

    Returns U, S where U^T M U = diag(S) and the singular values
    are sorted in ascending order (small to large).