Skip to content

Fix issue #56 - #57

Merged
lohedges merged 1 commit into
develfrom
fix_56
Nov 8, 2026
Merged

lohedges merged 1 commit into
develfrom
fix_56

Conversation

@lohedges

@lohedges lohedges commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Closes #56.

The energy kernel only caught a trial water atom on top of a system atom (r2 < 1e-6) when the system wasn't alchemical. In an alchemical system, a non-ghost atom went through the hard LJ and Coulomb path with no clamp, so an exact overlap gave inf or NaN rather than the overlap energy. The check now applies to every non-ghost atom, whether or not the system is alchemical. Ghost atoms still use the soft-core path, which clamps r2.

In practice this was very unlikely to matter: a random trial has to land within 0.001 Å of an atom, and an inf or NaN energy was already rejected by the acceptance kernel. Only an exact overlap of opposite charges with no LJ on either atom would give −inf and be accepted.

The energy kernel launch is moved from move() into a private _compute_energy() method, so that a test can score trial waters placed by hand. test_overlap_in_alchemical_system puts a trial water's oxygen on a non-ghost atom in sd12. It checks that this pair gets the overlap energy and that every energy for the trial is finite, on both CUDA and OpenCL.

@lohedges lohedges added the bug Something isn't working label Nov 8, 2026
@lohedges
lohedges merged commit 7d93d56 into devel Nov 8, 2026
4 checks passed
@lohedges
lohedges deleted the fix_56 branch November 8, 2026 15:48
@lohedges lohedges mentioned this pull request Nov 8, 2026

This branch was previously deployed

1 inactive deployment
loch-build — 25207fa6 Deployed Nov 8, 2026 by lohedges via build (3.12, linux) #34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Overlapping atoms aren't caught for non-ghost atoms in alchemical systems

1 participant