Skip to content

Commit fa30f22

Browse files
committed
Physical atoms must be physical at both end states.
1 parent e1ca58b commit fa30f22

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/ghostly/_ghostly.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,10 @@ def modify(system, k_hard=100, k_soft=5, optimise_angles=True, num_optimise=10):
168168
for b in bridges0:
169169
physical0[b] = []
170170
for c in connectivity0.connections_to(b):
171-
if not _is_ghost(mol, [c])[0]:
171+
if (
172+
not _is_ghost(mol, [c])[0]
173+
and not _is_ghost(mol, [c], is_lambda1=True)[0]
174+
):
172175
physical0[b].append(c)
173176
for b in physical0:
174177
physical0[b].sort(key=lambda x: x.value())
@@ -186,7 +189,10 @@ def modify(system, k_hard=100, k_soft=5, optimise_angles=True, num_optimise=10):
186189
for b in bridges1:
187190
physical1[b] = []
188191
for c in connectivity1.connections_to(b):
189-
if not _is_ghost(mol, [c], is_lambda1=True)[0]:
192+
if (
193+
not _is_ghost(mol, [c])[0]
194+
and not _is_ghost(mol, [c], is_lambda1=True)[0]
195+
):
190196
physical1[b].append(c)
191197
for b in physical1:
192198
physical1[b].sort(key=lambda x: x.value())

0 commit comments

Comments
 (0)