Skip to content

(feat) optional mass weighting in VACF - #598

Open
jwjeffr wants to merge 1 commit into
TorchSim:mainfrom
jwjeffr:main
Open

(feat) optional mass weighting in VACF#598
jwjeffr wants to merge 1 commit into
TorchSim:mainfrom
jwjeffr:main

Conversation

@jwjeffr

@jwjeffr jwjeffr commented Aug 15, 2026

Copy link
Copy Markdown

Summary

This PR adds an optional mass weight option to the VACF calculation in properties.correlations.VelocityAutoCorrelation, similar to the implementation in pwtools, which is necessary for getting accurate spectra in multicomponent systems.

Feature

  • Added mass weighting as a Boolean flag which defaults to False for backwards compatibility. I.e., if the user passes mass_weighted=True into the initializer, then the VACF is:

$$ C(t) \propto \sum_i m_i \left\langle \mathbf{v}_i(0)\cdot\mathbf{v}_i(t)\right\rangle$$

rather than the unweighted case where $m_i = 1$. The main changes are here, and are similar to the implementation in pwtools here.

Checklist

Before a pull request can be merged, the following items must be checked:

  • Doc strings have been added in the Google docstring format.
  • Run ruff on your code.
  • Tests have been added for any new functionality or bug fixes.

@jwjeffr
jwjeffr marked this pull request as ready for review August 15, 2026 19:21
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.

1 participant