xtb icon indicating copy to clipboard operation
xtb copied to clipboard

Add explanation for translation entropy constants

Open TyBalduf opened this issue 1 year ago • 5 comments

Worked out the constants following the expressions for translation entropy given (among other places) here

TyBalduf avatar Aug 06 '24 17:08 TyBalduf

Would fix also https://github.com/grimme-lab/xtb/issues/649 and https://github.com/grimme-lab/xtb/issues/1052.

marcelmbn avatar Aug 07 '24 11:08 marcelmbn

So I rewrote the translation entropy equation and it gives approximately the same result (free energy differs by ~10^-5 kcal/mol)

If I work out the equivalent of magic4 and magic5, they come out to:

  • magic4 = 2.2879 (previously 2.2869)
  • magic5 = 2.3149 (previously 2.3135)

As best I can tell, these must have been originally been worked out with slightly different definitions of the constants. Not all the constants used in xTB correspond to their exact current value. For example in thermo, these values are defined:

   real(wp),parameter :: R = 1.98726D0    ! GAS CONSTANT IN CALORIES/(MOLE*K) (should be 1.9872*04*)

@marcelmbn Not sure if this is an acceptable difference and tests should be updated or this is too large a change and we just stick with the current magic constants, just providing some documentation on how they were likely calculated.

TyBalduf avatar Aug 08 '24 17:08 TyBalduf

Thanks for the correct implementation of the constant!

  1. Currently, the tests fail due to a ~10-5 value mismatch in the thermo unit tests, which is not very surprising.
  2. I've checked your point regarding the gas constant and came to the same result. The right way to do it would probably be to update all necessary constants (if necessary) to their most recent SotA value and then update the reference unit test results with the updated values. IMHO, there's no reason to stick with old fixed numbers based on slightly wrong fundamental constants. EDIT: Regarding the SotA fundamental constants: If we update them anyway, it is probably a good idea to give a reference for the value (paper, reference data collection, ...).
  3. Finally, we should move all constants from thermo.f90 into mctc/mctc_constants.f90 and just use them at the beginning of thermodyn. Moreover, I'd also delete the old code, i.e. magic4, magic5, s_tr_old, ... as people could still look it up in the git history and we don't need it in the active code base.

Thank you in advance for your work on this project!

marcelmbn avatar Aug 09 '24 07:08 marcelmbn

@TyBalduf Just wanted to ping you again on this topic. We'd be very grateful if you find the time to update the related points in the code to the SotA standard you suggested, including the correct ab initio constants, so that we can integrate everything into the main branch. 😊 If you are no longer working on it, a short note would also be nice.

marcelmbn avatar Sep 25 '24 09:09 marcelmbn

I've been a little preoccupied of late and won't have a chance to work on this too soon. I can probably get to it eventually, its mainly a matter of updating tests. But I'm not actively working on it so if someone else wanted to take this on, there wouldn't be conflicting work.

TyBalduf avatar Oct 04 '24 20:10 TyBalduf

I updated the necessary constants from CODATA 2018 to be consistent with mctc-lib and calculated all necessary quantities directly from the fundamental constants. The resulting corrections change by about 10e-5 but the new values are just more accurate. Therefore, I adapted the tests to the new values. Should now be ready.

thfroitzheim avatar Mar 13 '25 22:03 thfroitzheim