Repository navigation
feat: canonical identity-switch move - #74
Merged
Merged
Conversation
Single-box, composition-conserving pair exchange: one molecule of component A and one of component B swap identities in place. Complements the semi-grand IdentityChangeCBMC; conserves N of every component and needs no fugacities. Input keys: IdentitySwitches, IdentitySwitchProbability. Tests: tests/raspa3-tests/mc_identity_switch_drift.cpp
Contributor
Author
|
The three red checks are all pre-existing CI issues that fail on
I verified locally with cmake 4.3 + clang: clean build, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
Move::Types::IdentitySwitchCBMC: a single-box, composition-conserving pair exchange. Onemolecule of component A and one of component B swap identities in place.
It complements
IdentityChangeCBMC(which converts a single molecule against an imposed fugacityratio). Because a pair is exchanged, N of every component is conserved, and no fugacities are needed:
It changes no equilibrium average; it exists to decorrelate dense mixtures where whole-molecule
insertion/deletion is inefficient.
Input:
IdentitySwitches: [partner ids],IdentitySwitchProbability.Notes for review:
id to skip. So the partner is briefly given the same id (and restored right after) so one skip
covers both; the A–B interaction that this hides is added back explicitly as
dU_pair.moleculeIdexclusion fix in fix: match Ewald exclusion pairs on moleculeId instead of per span #73 (merged);this branch is based on it.
identitySwitchesbumps theComponentrestart-file version to 2, read behind aversionNumber >= 2guard, so older restart files still load.Tests (
tests/raspa3-tests/mc_identity_switch_drift.cpp):identical_components_are_always_accepted— identical-type components ⇒ acceptance exactly 1,composition frozen.
charged_multisite_components_energy_drift— CO2 ↔ water with Ewald ⇒ zero drift incl.ewald_exclusion.