NpT MD using triclinic boxes

Dear LAMMPS community,

I have a question regarding the NpT MD using triclinic boxes.
As can be clearly seen from the LAMMPS manual, to specifiy the initial atomic configuration, one is requred to obey the convention about basis vectors a=(ax,ay,az), b=(bx,by,bz), c=(cx,cy,cz). The convention requires e.g. a=(ax,0,0) and so on. This is trivial to satisfy as one builds the initial configuration. However, when we run an MD in NpT, the basis vectors are changing at each timestep. My question is whether LAMMPS enforces the aforementioned restrictions at each timestep by applying rotations on coordinates and basis vectors, or does it print the atomic coordinates in the basis which does not obey the restrictions?
I was unable to deduce that by myself from the manual.
Thanks in advance.

Before the box vectors are changed, the coordinates are transformed to fractional coordinates, then the box vectors adjusted, and finally the coordinates converted back to cartesian. This procedure is applied for many operations in LAMMPS that are easier implemented for orthogonal boxes.

Thanks for the quick reply and the explanation, but I am still confused.
To make more sense about my intentions, I have to write a code for calculations of g(r) in triclinic cells and related stuff by myself. As I understand from your answer the coordinates written to the trajectory file will be in Cartesian coordinates. On the other hand by using thermo_style custom one can either get info on (a,b,c,alpha,beta,gamma) or (lx,ly,lz,xy,xz,yz). Let’s say I choose the latter option. Is it safe to assume that at eact timestep the cell matrix will be of the form:
lx xy xz
0 ly yz
0 0 lz
What I was implying in my original post is that during an MD run it is not necessary for the matrix elements below the diagonal to be 0 and that LAMMPS would have to make a rotation on coordinates and basis vectors to satisfy that. So, is what I have just described also included in “…box vectors adjusted…”?


There are no “rotations”. In LAMMPS non-orthogonal boxes must always follow the convention of the a-vector being parallel to the x-axis, the b-vector in the xy-plane and the c-vector chosen to form a right handed system. This is required on input and there is nothing in NPT dynamics with variable cell tilt that requires to violate that.

Mind you there is nothing in the compute rdf command — LAMMPS documentation
in LAMMPS that takes even note of non-orthogonal cells.

Relevant information about simulations with non-orthogonal boxes are collected in this howto page: 8.2.2. Triclinic (non-orthogonal) simulation boxes — LAMMPS documentation