def _reset_rdm(rdm):
    if (rdm is not None):
        if (spin_free and (rdm.shape[0] != n_MOs)):
            return None
        if ((not spin_free) and (rdm.shape[0] != n_SOs)):
            return None
    return rdm
def _reset_rdm(rdm):
    if (rdm is not None):
        if (spin_free and (rdm.shape[0] != n_MOs)):
            return None
        if ((not spin_free) and (rdm.shape[0] != n_SOs)):
            return None
    return rdm