def split_PETSc_Mat(mat):
    """ Decompose a PETSc matrix into a symmetric and skew-symmetric
        matrix

    Parameters:
    ----------
    mat : :class: `PETSc4py Matrix`

    Returns:
    --------
    H : :class: `PETSc4py Matrix`
        Symmetric (or Hermitian) component of mat
    S : :class: `PETSc4py Matrix`
        Skew-Symmetric (or skew-Hermitian) component of mat
    """
    H = mat.copy()
    H.zeroEntries()
    H.axpy(1.0,mat)
    H.axpy(1.0,mat.transpose())
    H.scale(0.5)
    S = mat.copy()
    S.zeroEntries()
    S.axpy(1.0,mat)
    S.aypx(-1.0,mat.transpose())
    S.scale(0.5)
    return H, S