Skip to content

Implement general pair-potential and pair-force#483

Merged
CompRhys merged 4 commits intomainfrom
batched-pairfunction
Mar 3, 2026
Merged

Implement general pair-potential and pair-force#483
CompRhys merged 4 commits intomainfrom
batched-pairfunction

Conversation

@CompRhys
Copy link
Copy Markdown
Member

@CompRhys CompRhys commented Mar 2, 2026

Batch all the things.

Adds general Pair Potential and Pair Force models (allows asym forces). Testing consistency against older classical models for now. Considering leaving classical potentials for now but aim would be to deprecate and remove the implementations and just use the energy functions/force functions here. MultiSoftSphere has largest API changes to the args for setting up the matricies.

@CompRhys CompRhys changed the title [WIP] implement general pair-potential and pair-force Implement general pair-potential and pair-force Mar 2, 2026

def fn(dr: torch.Tensor) -> torch.Tensor:
return (-epsilon / sigma) * (1.0 - (dr / sigma)).pow(alpha - 1)
return (epsilon / sigma) * (1.0 - (dr / sigma)).pow(alpha - 1)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

testing against pair potential showed a bug in soft-sphere stress.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good catch. Looking at the original paper there shouldn't be a minus - https://doi.org/10.1103/PhysRevE.68.011306

@CompRhys CompRhys mentioned this pull request Mar 2, 2026
3 tasks
Base automatically changed from ag/batched_lj to main March 2, 2026 11:56
@CompRhys CompRhys force-pushed the batched-pairfunction branch from 9639889 to 77d5aa4 Compare March 2, 2026 18:36
@CompRhys CompRhys marked this pull request as ready for review March 2, 2026 18:39
@CompRhys CompRhys requested a review from abhijeetgangan March 2, 2026 18:39
@CompRhys CompRhys merged commit e8bc7a3 into main Mar 3, 2026
68 checks passed
@CompRhys CompRhys deleted the batched-pairfunction branch March 3, 2026 03:45
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.

2 participants