import copy


def truncate(pot, sym_num):
    """ Take a potential and limit it's terms by the symmetry number
    """

    if sym_num == 1:
        potr = copy.deepcopy(pot)
    else:
        potr = {}
        lpot = int(len(pot) / sym_num)
        for i, key in enumerate(pot.keys()):
            if i < lpot:
                potr[key] = pot[key]

    return potr