(no subject)

I consider my diatomic molecule as a rigid body.
But in lammps how I give different translational velocities to two atoms constituting molecule.

Not sure I understand what you are trying to do. If the atoms are part of a rigid body, they would all have to have the same “translational” velocity, and what you are asking impossible.

If there is a real issue, most likely you haven’t given enough information about it to get help.