def isNewPhase(ds1, ds2):
    """
    Check if two dynamicsState have the same contacts
    :param ds1:
    :param ds2:
    :return: True if they have the same contacts, False otherwise
    """
    assert ds1.effNum() == ds2.effNum(), "The two dynamic states do not comes from the same model."

    for i in range(ds1.effNum()):
        if ds1.effActivation(i) != ds2.effActivation(i):
            return True
    return False