Skip to content

Fix issue #262 - #263

Merged
lohedges merged 4 commits into
develfrom
fix_262
Oct 23, 2026
Merged

lohedges merged 4 commits into
develfrom
fix_262

Conversation

@lohedges

Copy link
Copy Markdown
Contributor

Alchemical ions were always given their own standard_morph schedule, so their charge changed linearly over the whole λ range. Intermediate states were only neutral if the perturbable molecule's charge also changed linearly, which isn't the case for the ABFE, charge_scaled_morph or ring-breaking schedules.

Changes

  • annihilate / decouple: alchemical ions get a schedule with the same stages and stage weights as the ligand's. It morphs during decharge and holds the final state after that. This also applies when these schedules are passed as objects, e.g. decouple(fix_epsilon=False). The ligand's schedule can't be reused directly, because its ghost-atom equations, e.g. fixed epsilon, would stop the ion reaching its end state.
  • standard_morph, charge_scaled_morph, ring_break_morph, reverse_ring_break_morph: alchemical ions follow the perturbable molecule's schedule.
  • Custom schedules: alchemical ions still use standard_morph, and a warning says that intermediate states are only neutral if the perturbable molecule's charge changes linearly. No warning is raised when the custom schedule is standard_morph itself.

Notes

  • Neutrality doesn't depend on the sign ion is chosen. The ion's net chargechanges by −Δq at the same rate as the ligands'.
  • With charge_scaled_morph, the decharge and recharge stages scale the ligand's net charge, which the ion can't offset. The ion now matches the lihe morph stage.

Tests

  • tests/schedules/test_abfe.py: the ion's charge changes at the same rate as the ligand's for both ABFE schedules, with and without `fix_epsilonhts, and its LJ parameters reach theirfinal values.
  • tests/runner/test_alchemical_ions.pyn the runner for the keyword schedules,ABFE schedules passed as objects, a custher custom schedule.

The CI will currently fail due to the broken MKL package. I'm not going to add a pin since the issue will be fixed upstream soon. I'll just retrigger the CI when it is.

@lohedges lohedges added the bug Something isn't working label Oct 22, 2026
@lohedges
lohedges deployed to somd2-build October 22, 2026 14:50 — with GitHub Actions Active
@lohedges
lohedges deployed to somd2-build October 22, 2026 14:50 — with GitHub Actions Active
@lohedges
lohedges deployed to somd2-build October 23, 2026 06:27 — with GitHub Actions Active
@lohedges
lohedges deployed to somd2-build October 23, 2026 06:27 — with GitHub Actions Active
@lohedges
lohedges merged commit d3e3ca7 into devel Oct 23, 2026
8 of 12 checks passed
@lohedges
lohedges deleted the fix_262 branch October 23, 2026 14:52

This branch was successfully deployed

1 active deployment
somd2-build — 89ac1db2 Deployed Oct 23, 2026 by lohedges via build (3.12, linux) #134
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.

1 participant