diff --git a/parmed/openmm/topsystem.py b/parmed/openmm/topsystem.py index 923865bc19e5001ac2540af53384ef951f170801..5a5b363f1530f45caf56615667ffd2948a6ba635 100644 --- a/parmed/openmm/topsystem.py +++ b/parmed/openmm/topsystem.py @@ -392,10 +392,12 @@ def _process_nonbonded(struct, force): bond_graph_exceptions = defaultdict(set) for atom in struct.atoms: for a2 in atom.bond_partners: - bond_graph_exceptions[atom].add(a2) + if atom is not a2: + bond_graph_exceptions[atom].add(a2) for a3 in a2.bond_partners: if a3 is atom: continue - bond_graph_exceptions[atom].add(a3) + if atom is not a3: + bond_graph_exceptions[atom].add(a3) # TODO should we compress exception types? for ii in range(force.getNumExceptions()):