'Key for sorting of indices.
particle < hole < general
FIXME: This is a bottle-neck, can we do it faster?'

@classmethod
def _sortkey(cls, index):

    h = hash(index)
    if isinstance(index, Dummy):
        if index.assumptions0.get('above_fermi'):
            return (20, h)
        elif index.assumptions0.get('below_fermi'):
            return (21, h)
        else:
            return (22, h)
    if index.assumptions0.get('above_fermi'):
        return (10, h)
    elif index.assumptions0.get('below_fermi'):
        return (11, h)
    else:
        return (12, h)
