if lookup:
            # based on atom names: potential has to be defined in bondtypes already
            # this is for tabulated bond potentials specified based on type
            t1, t2 = types[pid1-1], types[pid2-1]
            if t1 > t2: # interactions in the other way