Add type first option to correlation fixes#4493
Merged
Merged
Conversation
sjplimp
reviewed
Mar 11, 2025
| :math:`\{i,j\} = \{1,N\}`, so :math:`N_\text{pair} = N^2`). | ||
| * If *type* is set to *first* then each input value is correlated with | ||
| the first input value (i.e., :math:`C_{ij} = V_1 V_j` for | ||
| :math:`\{i,j\} = \{1,N\}`, so :math:`N_\text{pair} = N`). |
Contributor
There was a problem hiding this comment.
should this just be j = (1,N) since i is not varying ?
Collaborator
Author
There was a problem hiding this comment.
Yes - my mistake! Missed it when I copy-pasted from type full. Can fix in an hour or so when I get to the office if you don't beat me to it.
Contributor
|
@ssande7 Thanks for the nice addition to the corrrelation options. Makes sense why it is useful. |
Collaborator
Author
|
Thanks @sjplimp . Should be all good now. |
sjplimp
approved these changes
Mar 11, 2025
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.
Summary
Adds a
type firstoption tofix ave/correlateandfix ave/correlate/longto correlate the first value with all values. This is useful for response theory calculations, where one value may need to be correlated with many values calculated for example byfix ave/chunk, but correlations between chunks are not meaningful. With existing options, many redundant columns are generated, or to avoid that, individual fixes and output files are needed for each correlation. In our use case (calculating the velocity profile across a confined LJ fluid with 100 bins and using 4 different response theory methods withfix ave/correlate/long) this reduces 400 output files into 4, and gives a ~4x speedup.Related Issue(s)
None
Author(s)
Stephen Sanderson (The University of Queensland) - stephen.sanderson@uq.edu.au
Licensing
By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).
Backward Compatibility
No problems expected.
Implementation Notes
Output with
type firsttested to exactly match the first N columns when usingtype full:Post Submission Checklist
Further Information, Files, and Links