Does sorting content of cfg files by dump_modify change the values of atoms velocities?

Dear Lammps experts,

I am using serial version (21 Jan 2015) of lammps. Usually I print my simulation results in cfg and xyz format. I am simulating graphene sheet and extract atoms velocity and coordinate from cfg files, and calculating VAF (velocity autocorrelation function) and other things. And I did not use dump_modify to sort cfg content.
Later I needed to change my simulation to sort cfg files content based on atoms IDs because I am using PCA (principal component analysis) on atom coordinates to study its motion and based on PCA results I build xyz file to view atoms motion on VMD. The issue is that VMD need atoms to be sorted by ID in the xyz files. Based on lammps documentation, sorting is off by default for cfg format. I have used dump_modify to sort cfg files by atoms IDs which caused a change in VAF curve. My code of VAF is calculating the correlation of each atom, then I calculate the average of all atoms. As I understand, the atoms order should not affect VAF and its Fourier transform because it is the average of all atoms, while in my case I found difference in VAF and Fourier curves of the sorted simulation. I assume that dump_modify does not affect the atoms velocities but only order the values based on the atoms ID. Is my understanding right? Why I am getting different VAf and Fourier curves in the sorted and unsorted simulations. If any body has clarification of my problem, it will be helpful.
I have attached a document that includes my simulations code with the curves that I got in the two cases. You will notice that the peaks in the sorted simulation have less width and slightly different position.

Thanks in advance,

Sorted and unsorted graphene simulations.docx (33.5 KB)

plesae note that your message below is a conversion that you first and
foremost should have with your advisers and colleagues.

Dear Lammps experts,

I am using serial version (21 Jan 2015) of lammps. Usually I print my
simulation results in cfg and xyz format. I am simulating graphene sheet and
extract atoms velocity and coordinate from cfg files, and calculating VAF
(velocity autocorrelation function) and other things. And I did not use
dump_modify to sort cfg content.
Later I needed to change my simulation to sort cfg files content based on
atoms IDs because I am using PCA (principal component analysis) on atom
coordinates to study its motion and based on PCA results I build xyz file to
view atoms motion on VMD. The issue is that VMD need atoms to be sorted by
ID in the xyz files. Based on lammps documentation, sorting is off by
default for cfg format. I have used dump_modify to sort cfg files by atoms
IDs which caused a change in VAF curve. My code of VAF is calculating the
correlation of each atom, then I calculate the average of all atoms. As I
understand, the atoms order should not affect VAF and its Fourier transform
because it is the average of all atoms, while in my case I found difference
in VAF and Fourier curves of the sorted simulation. I assume that
dump_modify does not affect the atoms velocities but only order the values
based on the atoms ID. Is my understanding right? Why I am getting different
VAf and Fourier curves in the sorted and unsorted simulations. If any body
has clarification of my problem, it will be helpful.
I have attached a document that includes my simulations code with the curves
that I got in the two cases. You will notice that the peaks in the sorted
simulation have less width and slightly different position.

but which one is closer to the expected spectrum? that is a trivial
check that you should have done anyway. that will likely get you
quickly on the road of understanding.

without having seen it, my guess is that the code that you wrote to
compute the VACFs is not processing the unsorted data correctly and
instead implicitly assumes that the input data is already sorted,
which in turn suggests, that you may not have fully understood how
VACFs are computed in the first place.

sorting out the output does not change velocities in LAMMPS and there
is no convincing evidence in your message to the contrary. please have
a conversation with your adviser(s) and colleague(s) on this subject
and study the relevant text book(s) some more.

axel.

p.s.: attaching word files for emails to a mailing list is not a good
idea. those are prone to carry malware and may require people to have
special software installed. some mailing lists automatically "scrub"
such attachments. a better choice would be PDF or simlpy plain test
and jpeg or png images.