Switched s to be real in from_matrix.