Page 1 of 1

Does the result of thermodynamic integration using VCAIMAGES include the energy difference of the ideal gas?

Posted: Wed Oct 09, 2024 12:12 pm
by Yicheng

Dear VASP developers,

I plan to investigate the free energy difference between two aqueous systems containing NaCl and KCl (i.e., NaCl+63H2O and KCl+63H2O) through thermodynamic integration, using the VCAIMAGES tag to gradually transition Na(+) into K(+) by employing two different POTCAR files. Under the same VCAIMAGES value, the masses of Na and K in the two POTCAR files are set to be the same; as the VCAIMAGES value changes from 1.0 to 0.0, the mass gradually transitions from the atom mass of Na to that of K.

By performing thermodynamic integration on the derived potential energy differences, I obtain a free energy difference value. However, I am uncertain whether this value includes the ideal gas energy difference between these two systems. In other words, if I wish to calculate the free energy difference between the NaCl+63H2O and KCl+63H2O systems, should the energy difference between the ideal gas corresponding to these two systems (which is equal to the free energy difference between gaseous Na and K in these two systems) be added to the thermodynamic integration result?

I hope my question is clearly stated, and I greatly appreciate your time and patience.
Sincerely,
Yicheng


Re: Does the result of thermodynamic integration using VCAIMAGES include the energy difference of the ideal gas?

Posted: Wed Oct 09, 2024 1:15 pm
by fabien_tran1

Hi,

I have just discussed with a colleague who is more expert than me on this topic. Here are two important points:

-You are setting the masses of the atoms equal, which results in the same ideal gas free energy for both NaCl and KCl. Therefore, when the difference between NaCl and KCl is computed this term will factor out and won't affect the free energy difference.

-Does it really make sense to think about ideal gases here? There are cases where you express the free energy of a system relative to the ideal gas. But in this case you wants to express the free energy difference with respect to each other. And not to some third artificial system.


Re: Does the result of thermodynamic integration using VCAIMAGES include the energy difference of the ideal gas?

Posted: Wed Oct 09, 2024 1:43 pm
by Yicheng

Dear Dr. Tran,
Thank you for your attention and effort regarding my question.

Indeed, there is another method to calculate the free energy difference between the NaCl+63H2O and KCl+63H2O systems using the ideal gas reference. In this method, we need to calculate the free energy of each system, which is equal to the sum of the free energy of the corresponding ideal gas system (denoted as F(IG)) and the free energy difference between the “realistic” system and the ideal gas reference (denoted as ΔF). It is this method that causes my confusion regarding the alchemical change using VCAIMAGES. I am uncertain whether the thermodynamic integration result using VCAIMAGES is equal to:
(1) ΔF(KCl+63H2O) - ΔF(NaCl+63H2O)
(2) ΔF(KCl+63H2O) - ΔF(NaCl+63H2O) + F(IG, KCl+63H2O) - F(IG, NaCl+63H2O)
Could you please clarify this question again?

Additionally, I would like to clarify that the set masses of Na and K change with the VCAIMAGES values, e.g., 22.990 when VCAIMAGES=1.0, 31.044 when VCAIMAGES=0.5, and 39.098 when VCAIMAGES=0.0.

Thank you for your time and I am looking forward to your reply.
Sincerely,
Yicheng

fabien_tran1 wrote: Wed Oct 09, 2024 1:15 pm

Hi,

I have just discussed with a colleague who is more expert than me on this topic. Here are two important points:

-You are setting the masses of the atoms equal, which results in the same ideal gas free energy for both NaCl and KCl. Therefore, when the difference between NaCl and KCl is computed this term will factor out and won't affect the free energy difference.

-Does it really make sense to think about ideal gases here? There are cases where you express the free energy of a system relative to the ideal gas. But in this case you wants to express the free energy difference with respect to each other. And not to some third artificial system.


Re: Does the result of thermodynamic integration using VCAIMAGES include the energy difference of the ideal gas?

Posted: Wed Oct 09, 2024 2:40 pm
by fabien_tran1

With the method that you are using you do not get a relative energy to the ideal gas. If you want to know if the method you are using and the ideal gas reference give the same results you have to try what is explained at Thermodynamic integration with harmonic reference and SCALEE. Actually, using the harmonic solid instead of the ideal gas is in principle easier.

For more information about thermodynamic integration and perturbation theory you should read these papers:
https://journals.aps.org/prl/abstract/1 ... 121.195701
https://journals.aps.org/prb/abstract/1 ... .99.184103

On the page SCALEE you can also find an equation how to compute the free energy of the ideal gas. You can obtain the de Broglie wavelength from the canonical momentum computed from the partition function of the ideal gas and the de Broglie relation.

But if these two methods will give the same result I doubt. Nevertheless they should be very close to each other.


Re: Does the result of thermodynamic integration using VCAIMAGES include the energy difference of the ideal gas?

Posted: Wed Oct 09, 2024 2:57 pm
by Yicheng

Dear Dr. Tran,

Thank you for your reply. I understanding that the thermodynamic integration using the VCAIMAGES tag can only obtain the free energy difference between two systems, but cannot determine the free energy of a single system. On the other hand, thermodynamic integration using the ideal gas reference (i.e., the SCALEE tag) can provide the free energy of a single system, and therefore, it also can be used to calculate the free energy difference between two systems.

There should be a corresponding relation (this is what I want to know) between the free energy difference (between two systems) calculated from these two methods. This is why I am wondering whether the thermodynamic integration result using VCAIMAGES is equal to:
(1) ΔF(KCl+63H2O) - ΔF(NaCl+63H2O)
(2) ΔF(KCl+63H2O) - ΔF(NaCl+63H2O) + F(IG, KCl+63H2O) - F(IG, NaCl+63H2O)
where the ΔF values are the results calculated with the SCALEE tag. The thermodynamic integration result using the VCAIMAGES tag, and equations (1) and (2) calculated with the SCALEE tag, all represent the free energy difference between two systems (with or without the contribution of the ideal gas free energy).

Sincerely,
Yicheng

fabien_tran1 wrote: Wed Oct 09, 2024 2:40 pm

With the method that you are using you do not get a relative energy to the ideal gas. If you want to know if the method you are using and the ideal gas reference give the same results you have to try what is explained at Thermodynamic integration with harmonic reference and SCALEE. Actually, using the harmonic solid instead of the ideal gas is in principle easier.

For more information about thermodynamic integration and perturbation theory you should read these papers:
https://journals.aps.org/prl/abstract/1 ... 121.195701
https://journals.aps.org/prb/abstract/1 ... .99.184103

On the page SCALEE you can also find an equation how to compute the free energy of the ideal gas. You can obtain the de Broglie wavelength from the canonical momentum computed from the partition function of the ideal gas and the de Broglie relation.

But if these two methods will give the same result I doubt. Nevertheless they should be very close to each other.


Re: Does the result of thermodynamic integration using VCAIMAGES include the energy difference of the ideal gas?

Posted: Thu Oct 10, 2024 6:49 pm
by jonathan_lahnsteiner2

Dear Yicheng,

Regarding your initial question

However, I am uncertain whether this value includes the ideal gas energy difference between these two systems. In other words, if I wish to calculate the free energy difference between the NaCl+63H2O and KCl+63H2O systems, should the energy difference between the ideal gas corresponding to these two systems (which is equal to the free energy difference between gaseous Na and K in these two systems) be added to the thermodynamic integration result?

The method of thermodynamic integration with VCAIMAGES will give you the free energy difference between your two states aqueous NaCl and KCl. There is no need to add the free energy difference between the ideal gas states of NaCl and KCl. For your purpose the VCAIMAGES method in VASP is the appropriate method because it directly determines the free energy difference for your states of interest.

Another possibility would be to first determine the free energy for the aqueous NaCl system with respect to some reference system as the ideal gas or the Einstein crystal (harmonic solid). Both are valid reference systems. But in principle you could also use any other reference potential for which you can write down the free energy analytically. Next you would have to obtain the free energy for your aqueous KCl system with respect to the same reference potential and determine its free energy as well. Like this you would have obtained the free energies of NaCl and of KCl with respect to some artificial reference potential. The next step is now to compute the free energy difference between NaCl and KCl.

So to summarize, in the first method you directly obtain the free energy difference between your states. And in the second case you obtain the free energy difference by doing a detour by first computing the free energies of NaCl and KCl wrt to an artificial reference system and then compute the free energy difference. In theory these methods give the same answer because thermodynamic free energy differences only depend on the initial and the final state. They are independent of the path which was taken two reach from the initial to the final state. For more information I would recommend to take a look in the book Thermodynamics and an introduction to thermostatistics by Herbert Callen.

Because both methods are only exact in the adiabatic limit, you would have to make infinitely many images with the VCAIMAGES method. And you would have to varySCALEE for the reference system method infinitely slow. In practice this is not possible and therefore I would suspect the methods to give slightly different answers. But qualitatively the two approaches will yield the same result.

There is also a nice chapter in Daan Frenkels book Understanding Molecular Simulation about thermodynamic integration which I highly recommend. Also the references my colleague sent are very helpful. In your case, especially the second paper will be interesting.

If you are interested in how strong the two approaches deviate you are very welcome to try. It is definitely interesting to look into this. But there is no simple relation between the two methods because in principle they should give the same results.

I hope this is of help, all the best

Jonathan


Re: Does the result of thermodynamic integration using VCAIMAGES include the energy difference of the ideal gas?

Posted: Fri Oct 11, 2024 12:52 pm
by Yicheng

Dear Dr. Lahnsteiner,

Thank you very much for your detailed response! I have greatly benefited from both your and Dr. Tran’s guidance, not only on my initial question but also on the thermodynamic integration method. Regarding the discrepancy between the free energy differences calculated from these two method, I have to say that, at least for my systems, as you mentioned, the free energy calculated from thermodynamic integration using the ideal gas reference has poor convergence with a large error. Perhaps this method is more suitable for systems with repetitive units. I will continue to explore this issue.
Thank you again for your guidance and time regarding my question.

Sincerely,
Yicheng