Skip to content

Conversation

@rousseab
Copy link
Collaborator

This PR is on top of #79 .

This implements a radial, short range "repulsive force" that can be used to promote atom separation during sampling. I made a specific choice for the functional form to keep things as simple as possible.

Copy link
Collaborator

@sblackburn86 sblackburn86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor suggestion to avoid a nan


r = torch.linalg.norm(cartesian_displacements, dim=1)

pseudo_force_prefactors = 2.0 * s * (r - r0) / r
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r + epsilon to prevent NaN if r = 0 (two atoms at the same place - unlikely but we never know)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good 👍

@rousseab rousseab merged commit 8c2c6d2 into main Sep 28, 2024
1 check passed
@rousseab rousseab deleted the repulsive_force branch September 28, 2024 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants