trajectory units

97 views
Skip to first unread message

Marc Riera

unread,
Jun 13, 2018, 2:20:38 PM6/13/18
to ipi-users
Hello,

I have interfaced i-pi with our software, and I have tried to run a simple MD of a molecules of water. The simulation runs without any problem, but seems like the trajectory is printed in a weird way. In principle, I am specifying it to print Angstroms:
=======
  <output prefix='simulation'>
    <properties stride='5' filename='out'>  [ step, time{picosecond}, conserved{kelvin}, temperature{kelvin}, kinetic_cv{kelvin}, potential{kelvin}, pressure_cv{megapascal}] </properties>
    <trajectory filename='pos' stride='5' format='xyz' cell_units='angstrom'> positions{angstrom} </trajectory>
    <trajectory filename='force' stride='5' format='xyz' cell_units='angstrom'> forces{piconewton} </trajectory>
  </output>
=======
As far as I understand, all the units sent and received from and to  i-pi are in atomic units. I understand that without specifying the units, it should print atomic units for the positions, right? Then, if we specify Angstrom as the unit for the position in the trajectory, it should print Angstrom. I might be doing something wrong, since what the trajectory file contains is a number that is too small. However, multiplying that number by 1.8897259886^2, it returns the number that it should be. I paste here an example of the last frame of a 1000 step simulation:
=== trajectory file contains ====
3
# CELL(abcABC): 1000.00000  1000.00000  1000.00000    90.00000    90.00000    90.00000  Step:        1000  Bead:       0 positions{angstrom}  cell{angstrom}
       O -8.22884e-01  6.07688e-01  1.22183e-02
       H -7.62002e-01  3.41796e-01  5.08404e-02
       H -8.89739e-01  6.01798e-01 -2.44786e-01
=== Printing the coordinates received by i-pi inside the driver, and multiplying them by the bohr_to_angstrom conversion factor (1.8897259886)  ===
xyz[0] = -2.93857  xyz[1] = 2.17009  xyz[2] = 0.0436324
xyz[3] = -2.72116  xyz[4] = 1.22058  xyz[5] = 0.181554
xyz[6] = -3.17731  xyz[7] = 2.14906  xyz[8] = -0.874147

Any idea what I am doing wrong?
Thanks,
Marc

Michele Ceriotti

unread,
Jun 13, 2018, 3:38:08 PM6/13/18
to ipi-users
How does the input look like? It might be interpreting as Bohr an input that is in angstrom.

Marc Riera

unread,
Jun 13, 2018, 4:15:45 PM6/13/18
to ipi-users
Hey Michele,

I attach the inputs here. 1h2o.xml is the xml file that I pass to i-pi, and 1h2o.xyz is the XYZ file.
Inside my driver, I am obtaining the gradients in kcal/mol / A, so I am updtaing those values by g = -g / 1.8897259886 / 627.509 in order to send the forces in atomic units to the driver
Thanks for checking!

Marc
1h2o.xml
1h2o.xyz

Michele Ceriotti

unread,
Jun 13, 2018, 4:46:52 PM6/13/18
to ipi-users
yep. as I suspected. i-PI has a hardline "everything is AU" policy. only exception are PDB files for which the standard prescribes that coordinates are in angstrom.
if you give a xyz file without a header that specifies units, it'll assume it's AU. 
So either you add a header in the same format as what you get in the outputs (key bit is positions{angstrom}) or you override the default units by having in the input
<initialize nbeads='1'>
      <file mode='xyz' units='angstrom'> 1h2o.xyz </file>
.....

Marc Riera

unread,
Jun 13, 2018, 6:13:55 PM6/13/18
to ipi-users
Hey Michelle,

Seems that I finally made it work. I think I am still writting something in the wrong way. The XML attached here prints the right quantities in the position file, but at the beginning is getting the positions in atomic units, although ater the simulations corrects it and goes to a normal water structure. 

Could you please tell me what do I need to put in the trajectory and input in order to 1) pass the input in Angstrom and 2) print the trajectory and the cell in angstrom?
Note that in this case I deleted the cell_units='angstrom' from the trajectory, since if that keyword is there, I still have the problem I mentioned in the first message. 
Is it easier to just convert XYZ to a.u.?

Thanks!

PS: Sorry for all these questions, but I tried all the possible combinations that came to my mind and nothing seemed to work. I am sure is a dumb mistake, but I cannot figure it out.
1h2o.xml

Michele Ceriotti

unread,
Jun 14, 2018, 1:33:48 AM6/14/18
to ipi-users
These inputs - that are those you originally sent with the single addition of the units specifications for the input - work exactly as intended when run with the internal driver
i-pi-driver -m qtip4pf  -u -h localhost
Verify that this is the case. If you still get something inconsistent, the units conversion in your interface is almost certainly to blame.

1h2o.xml
1h2o.xyz

Marc Riera

unread,
Jun 14, 2018, 11:20:46 AM6/14/18
to ipi-users
Thanks a lot for your help Michelle. I Finally got it working!
All the best,

Marc 
Reply all
Reply to author
Forward
0 new messages