How lammps swaps the velocities of molecular ?

Dear LAMMPS users
I really want to know how the lammps use the fix thermal/conductivity command to deal with the molecular.
I found Muller-Plathe algorithm also can deal with the molecular.Previously,I found that the energy is not conserved,but recently,I also find that energy conservation can be achieved in small steps.
From literature, we know that we should swap the molecular center-of-mass velocities,rather than atomic velocities.
Can anyone explain how the lammps swap the velocities of molecular?
Jack zhuang

From the fix thermal/conductivity doc page:

LAMMPS does not check, but you should not use this fix to swap the kinetic energy of atoms that are in constrained molecules, e.g. via fix shake or fix rigid. This is because application of the constraints will alter the amount of transferred momentum. You should, however, be able to use flexible molecules. See the Zhang paper for a discussion and results of this idea.

In other words, the fix does not do anything special wrt moleclues. But it

should still work for flexible molecules, b/c swapping between

2 atoms (in 2 different molecules) is fine.