Comment 3 for bug 1835196

Revision history for this message
Nick Papior (nickpapior) wrote :

Actually, I am not so sure that i-pi uses the virial tensor as the transpose in its implementation.

The reason for cell to be transposed is because i-pi uses the cell vectors transposed in the python implementation (in my opinion this is an odd choice, but never mind). However, the virial matrix is never used as such. In fact it is automatically truncated to the Voigt representation once received from the socket.

Two things that may be valuable for future reference:

1) the virial tensor is symmetric, so it shouldn't matter either way
2) the i-pi/drivers/driver.f90 uses the transpose of the virial matrix. However, in that implementation the virial matrix is only calculated in the (1,[1,2,3]), (2,[2,3]), (3, [3]) values (which are not the standard fortran indexing). This is my main motivation for *not* doing this with the virial matrix since the i-pi implementation does this (after retrieval: see engine/forces.py: get_vir) vir[1, 0] = 0, vir[2, 0:2] = 0.

Thanks for getting me to look up this.