A constant potential energy shift between i-pi and VASP

59 views
Skip to first unread message

Xu Heseri

unread,
Oct 26, 2025, 6:13:37 PMOct 26
to ipi-users
Dear i-pi developers,

I am trying to use i-pi (version 3.1.6) with VASP. I compiled VASP 6.3.0 with the vasp.6.3.0-ipi.patch file, and ran the simulation in examples/clients/vasp/water_1_npt_md_vasp. As shown in the enclosed files, there is a constant shift (0.003725 eV) between the potential energy values output by i-pi and VASP. (The values printed after “free  energy   TOTEN” in the OUTCAR file are regarded as the potential energies from VASP.)

I was a bit worried about these shifts, so I compiled VASP in two other ways: (1) VASP 6.3.0 with the patch_vasp.py file, and (2) VASP 6.2.1 with the vasp.6.2.1-ipi.patch file. However, the potential energy values remain different. I also noticed that this issue was raised about two years ago (https://groups.google.com/g/ipi-users/c/IRzM79I4a2w/m/IZPujVYOBQAJ), but there was no further update from the questioner.

Based on the new, detailed data provided above, could you please kindly look into this issue again? Thank you very much for your time and help.

Sincerely,
Xu

OUTCAR
ipi.out
OSZICAR

Michele Ceriotti

unread,
Oct 27, 2025, 1:25:12 AMOct 27
to ipi-users
Had a quick look. I suspect this might _not_ be a constant shift, but a multiplicative factor.
VASP defines RYTOEV=13.605826_q, which is significantly different from the value used by 
i-PI,  (0.036749326 eV/Ha, corresponding to ry2ev=13.605692). Given that energies have a 
large constant value with small fluctuations around them, this will probably show up as an
effective offset, for a single system. 

I don't know where the VASP value comes from, i-PI is close enough to the NIST value 
https://physics.nist.gov/cgi-bin/cuu/Value?rydhcev as well as to pretty much every reference I could find. 
Could you check if this is indeed the source of discrepancy? If that's the case, we could 
change the patch to use the i-PI conversion factor rather than VASP - this would not solve
the strange value used in the VASP codebase, but at least give consistent values.

Best,
Michele

Xu Heseri

unread,
Oct 27, 2025, 3:36:53 AMOct 27
to ipi-users
Dear Prof. Ceriotti,

Thank you very much for your detailed analysis and reply! Following your guidance, I changed the line EVTOHA = 1_q/(2_q*RYTOEV) in the patch file to EVTOHA = 1_q/(2_q*13.605692), and found that the potential energy values output by i-pi are sufficiently close to the “energy(sigma->0)” values output by VASP, e.g., -1.42220562e+01 vs. -14.22205629. The corresponding files are attached for your reference. I will also post this issue on the VASP Forum today, and will share any responses I receive here.

In addition, I am sorry to be annoying for another concern regarding the potential energy values output by i-pi. As far as I know, among the three potential energy values output by VASP, the “free  energy   TOTEN” value is consistent with the forces (similar to the potential energy in molecular mechanics), whereas “energy  without entropy” and “energy(sigma->0)” are not (as discussed previously in ASE: https://gitlab.com/ase/ase/-/issues/430). Specifically, when performing FPMD simulations at high temperatures, it is common practice to account for the electronic entropy using Fermi-Dirac smearing (ISMEAR=-1 in VASP) with the width SIGMA=kBT. I am not sure whether the “energy(sigma->0)” value appears only in the i-pi output file, or if it is actually used during the simulation (for example, when mixing potential energies from QM and MM; in such cases, using the “energy(sigma→0)” value may lead to inconsistencies as mentioned above). Thank you for your guidance!

Sincerely,
Xu

OUTCAR
OSZICAR
i-pi.out

Michele Ceriotti

unread,
Oct 27, 2025, 7:43:26 AMOct 27
to ipi-users
should definitely be the free energy value, I suspect you may be able to change this in the patch yourself. if you succeed, then please create a new patch file with these corrections targeting the most recent version of VASP and create a pull request, so this is fixed for everyone
Best
Michele

Xu Heseri

unread,
Oct 27, 2025, 10:40:37 AMOct 27
to ipi-users
Dear Prof. Ceriotti,

Thank you very much for your confirmation and kind encouragement. To be honest, I am just a user of i-pi and VASP and do not have experience with socket clients. Therefore, I am not able to create a new patch file myself. For practical purposes, I simply made two small modifications to the vasp.6.3.0-ipi.patch file:
(1) changing the line EVTOHA = 1_q/(2_q*RYTOEV) to EVTOHA = 1_q/(2_q*13.605692), and
(2) changing the line IPIPOT = (TOTEN-E%EENTROPY/(2+NORDER))*EVTOHA to IPIPOT = TOTEN*EVTOHA.

With these two small changes, the potential energy values output by i-pi are now sufficiently close to the “free energy TOTEN” values output by VASP, as shown in the attached files. However, these modifications only affect the output file. I am still unsure whether the forces (and thus the trajectories) are computed correctly without further changes.

In addition, after analyzing the files in the VASP installation package, my colleagues and I found that two different EVTOHA values are used in VASP. The recommended value (13.605692) is used to calculate the potential energy, so the values in the OUTCAR file are correct. However, the value communicated via the socket is not the recommended one, which causes the discrepancy when coupling VASP with i-pi.

Sincerely,
Xu

OUTCAR
OSZICAR
i-pi.out

Mariana Rossi

unread,
Oct 27, 2025, 10:45:02 AMOct 27
to ipi-users

Could you at least open an issue in the ipi code GitHub  and also create a pull request with your simple modifications to the current patch?

Thanks

Xu Heseri

unread,
Oct 27, 2025, 11:45:37 AMOct 27
to ipi-users
Dear Dr. Rossi,

Thank you for your encouragement. Following your suggestions, I have opened an issue on the i-pi GitHub and submitted a pull request with the current patch. Please feel free to review it if it may be useful.

Sincerely,
Xu

Reply all
Reply to author
Forward
0 new messages