def permutation_integers(mat):
    """
    Return list of integers representing one-hot rows from a permutation matrix
    :param mat: Permutation matrix (no checking)
    :return: list of integers
    """
    ret = []
    for r in range(mat.shape[0]):
        for c in range(mat.shape[1]):
            # When multipled by a one-hot ket,
            # the column is returned corresponding to the one-hot row
            if round(mat[c][r].real, 4) == 1:
                ret.append(c)
                break
    return ret