Units and printing

Someone made the mistake of bringing units to my attention, so I’m conducting some printing renovations.

  • equal treatment for kcal & kJ
  • Hartree
    • has official abbreviations E_h and Ha (https://en.wikipedia.org/wiki/Hartree)
    • psi4 has usually used H, which isn’t an official abbreviation, though Molpro uses it, too
    • propose that psi4 use [Eh]
  • Propose that units always be in brackets so they have recognized delimiters even when spaces present like [cal/(mol K)]
  • I know some are very attached to kcal mol^-1 but this does use extra characters. Should we switch to kcal/mol?

Before and after of proposed changes: (net increase: 1 column)

      Ind20,r                      -1.17961920 mH      -0.74022226 kcal mol^-1      -3.09709022 kJ mol^-1
      Ind30,r                      -1.12625025 [mEh]      -0.70673273 [kcal/mol]      -2.95697004 [kJ/mol]
  • Also in physconst, one can do math in #define statements, so should we define only the fundamental ones, then compute the derived ones in terms of those to avoid errors? Ignore the documentation complication for now.

FWIW I like the new version.

I don’t see a huge plus in deriving the variables at the moment. Might be worth flagging as a TODO when these variables actually change.

Another upvote for the new version. I think it is important to at some point make the constants derive from one another (it increases that odds that floating point equalities like 2*pc_pi==pc_twopi actually work), but I also see it as a low priority TODO.

While we are on the topic of units and stuff, I also would like to bring to people’s attention C++11 SI-Prefixes and suggest that we start using built-in language constructs for such matters (when C-side). And if we really want to go nuts C++11 literals (“units”) a simple application to radians/degrees, but I will admit that this does add to the interface.

I like the printing update proposal. I also like the physical constant update proposed, but that can be done later.

I think wrapping units in brackets is a good idea. I would say that it is easier to write scripts that extract both energies and units from the output files if there are fewer special characters and no spaces (e.g. [kcal/molK] instead of [kcal/mol K] or [kcal mol^-1 K^-1]). I usually prefer [au] for Hartrees, but [Ha]/[mHa] is probably best since SAPT uses milliHartrees. Using [Eh] seems ambiguous to me since E with a subscript is often used for a component of the total energy. For instance, if you label data as “Energy (Eh)”, it could look like either a unit or a type of energy.

If you need people to help with the formatting updates, I would volunteer some of my time.

Ha (up to capitilatization) is the abbreviation for a hectare

Oh, Henry is capital H so that’s off the table too

How is the below for thermo printing that

  • equally includes kcal/mol & kJ/mol
  • keeps same quantity with multiple units on same line to avoid reprinting blocks w/diff units
  • tries to be clear on how all these numbers interrelate

Notes:

  • we don’t calculate Cp, but gamess does, so potentially possible
  • everyone uses different terminology, here’s a few to choose from if you’d like to comment
    << ZPE >>
        Zero-point correction to Energy
        Electronic Energy at 0 [K]
        Sum of electronic and zero point energies
    << U >>
        Thermal energy
        Thermal correction to Energy
        Internal energy
        Sum of electronic and thermal energies
        Electronic Energy at 298.15 [K]
    << H >>
        thermal correction to Enthalpy
        Sum of electronic and thermal Enthalpies
        Enthalpy at 298.15 [K]
    << G >>
        thermal correction to Gibbs Free Energy
        Sum of electronic and thermal Free Energies
        Free Enthalpy at 298.15 [K]
  • next post will have samples from other programs for comparison
  • so what comments/approval/disapproval do you have for the below?
==> Components <==

    Entropy, S
      Electronic S          0.000 [cal/(mol K)]       0.000 [J/(mol K)]      0.00000000 [mEh/K] (multiplicity = 1)
      Translational S      38.979 [cal/(mol K)]     163.089 [J/(mol K)]      0.06211698 [mEh]K] (mol. weight = 16.0400)
      Rotational S         22.945 [cal/(mol K)]      96.003 [J/(mol K)]      0.03656518 [mEh/K] (rotational # = 12)
      Vibrational S         4.460 [cal/(mol K)]      18.661 [J/(mol K)]      0.00710746 [mEh/K]
    Total S                66.385 [cal/(mol K)]     277.753 [J/(mol K)]      0.10579120 [mEh/K]

    Constant volume heat capacity, Cv
      Electronic Cv         0.000 [cal/(mol K)]       0.000 [J/(mol K)]      0.00000000 [mEh/K]
      Translational Cv      2.981 [cal/(mol K)]      12.472 [J/(mol K)]      0.00475052 [mEh/K]
      Rotational Cv         2.981 [cal/(mol K)]      12.472 [J/(mol K)]      0.00475052 [mEh/K]
      Vibrational Cv       11.351 [cal/(mol K)]      47.494 [J/(mol K)]      0.01808897 [mEh/K]
    Total Cv               17.313 [cal/(mol K)]      72.437 [J/(mol K)]      0.02759002 [mEh/K]

    Constant pressure heat capacity, Cp
      Electronic Cp         0.000 [cal/(mol K)]       0.000 [J/(mol K)]      0.00000000 [mEh/K]
      Translational Cp                                                            
      Rotational Cp         2.981 [cal/(mol K)]      12.472 [J/(mol K)]      0.00475052 [mEh/K]
      Vibrational Cp       11.351 [cal/(mol K)]      47.494 [J/(mol K)]      0.01808897 [mEh/K]
    Total Cp

 ==> Energy Analysis <== 

    Raw electronic energy, E0
    Total E0, Electronic energy at well bottom at 0 [K]             -229.41921654 [Eh]

    Zero-point energy, ZPE = Sum_i nu_i / 2
      Electronic ZPE        0.000 [kcal/mol]       0.000 [kJ/mol]      0.00000000 [Eh]
      Translational ZPE     0.000 [kcal/mol]       0.000 [kJ/mol]      0.00000000 [Eh]
      Rotational ZPE        0.000 [kcal/mol]       0.000 [kJ/mol]      0.00000000 [Eh]
      Vibrational ZPE      63.053 [kcal/mol]     263.813 [kJ/mol]      0.10048094 [Eh]   22053.013 [cm^-1]
    Correction ZPE         63.053 [kcal/mol]     263.813 [kJ/mol]      0.10048094 [Eh]   22053.013 [cm^-1]
    Total ZPE, Electronic energy at 0 [K]                           -229.31873560 [Eh]
                                                                 
    Thermal Energy, E (includes ZPE)                             
      Electronic E          0.000 [kcal/mol]       0.000 [kJ/mol]      0.00000000 [Eh]
      Translational E       0.889 [kcal/mol]       3.718 [kJ/mol]      0.00141671 [Eh]
      Rotational E          0.889 [kcal/mol]       3.718 [kJ/mol]      0.00141671 [Eh]
      Vibrational E        64.046 [kcal/mol]     267.970 [kJ/mol]      0.10206380 [Eh]
    Correction E           65.824 [kcal/mol]     275.407 [kJ/mol]      0.10489696 [Eh]
    Total E, Electronic energy at  298.15 [K]                       -229.31431957 [Eh]
                                                                 
    Enthalpy, H = E + k_b * T                                    
      Electronic H          0.000 [kcal/mol]       0.000 [kJ/mol]      0.00000000 [Eh]
      Translational H       0.889 [kcal/mol]       3.718 [kJ/mol]      0.00141671 [Eh]
      Rotational H          0.889 [kcal/mol]       3.718 [kJ/mol]      0.00141671 [Eh]
      Vibrational H        64.639 [kcal/mol]     270.448 [kJ/mol]      0.10300799 [Eh]
    Correction H           66.416 [kcal/mol]    277.8860 [kJ/mol]      0.10584115 [Eh]
    Total H, Enthalpy at  298.15 [K]                                -229.31337538 [Eh]
                                                                 
    Gibbs free energy, G = H - T * S                             
      Electronic G          0.000 [kcal/mol]       0.000 [kJ/mol]      0.00000000 [Eh]
      Translational G     -10.733 [kcal/mol]     -44.905 [kJ/mol]     -0.01710346 [Eh]
      Rotational G         -5.952 [kcal/mol]     -24.903 [kJ/mol]     -0.00948520 [Eh]
      Vibrational G        63.308 [kcal/mol]     264.882 [kJ/mol]      0.10088809 [Eh]
    Correction G           46.624 [kcal/mol]     195.074 [kJ/mol]      0.07429966 [Eh]
    Total G, Free enthalpy at  298.15 [K]                           -229.34491687 [Eh]

For comparison:

GAMESS

### http://www.msg.ameslab.gov/tutorials/nh3.hess.log.pdf

 -------------------------------
 THERMOCHEMISTRY AT T= 298.15 K
 -------------------------------
 USING IDEAL GAS, RIGID ROTOR, HARMONIC NORMAL MODE APPROXIMATIONS.
 P= 1.01325E+05 PASCAL.
 ALL FREQUENCIES ARE SCALED BY 1.00000
 THE MOMENTS OF INERTIA ARE (IN AMU*BOHR**2)
 6.38706 6.38706 9.55178
 THE ROTATIONAL SYMMETRY NUMBER IS 3.0
 THE ROTATIONAL CONSTANTS ARE (IN GHZ)
 282.30345 282.30345 188.76982

 THE HARMONIC ZERO POINT ENERGY IS (SCALED BY 1.000)
 .040127 HARTREE/MOLECULE 8806.922200 CM**-1/MOLECULE
 25.180279 KCAL/MOL 105.354289 KJ/MOL

        Q              LN Q
 ELEC.  1.00000E+00   .000000
 TRANS. 2.76149E+06 14.831281
 ROT.   7.44840E+01  4.310585
 VIB.   1.00119E+00   .001190
 TOT.   2.05932E+08 19.143056

              E       H       G      CV      CP       S
         KJ/MOL  KJ/MOL  KJ/MOL J/MOL-K J/MOL-K J/MOL-K
 ELEC.     .000    .000    .000    .000    .000    .000
 TRANS.   3.718   6.197 -36.766  12.472  20.786 144.099
 ROT.     3.718   3.718 -10.686  12.472  12.472  48.312
 VIB.   105.375 105.375 105.351    .500    .500    .080
 TOTAL  112.812 115.291  57.900  25.443  33.757 192.491

              E        H        G        CV        CP         S
       KCAL/MOL KCAL/MOL KCAL/MOL CAL/MOL-K CAL/MOL-K CAL/MOL-K
 ELEC.     .000     .000     .000      .000      .000      .000
 TRANS.    .889    1.481   -8.787     2.981     4.968    34.441
 ROT.      .889     .889   -2.554     2.981     2.981    11.547
 VIB.    25.185   25.185   25.180      .119      .119      .019
 TOTAL   26.963   27.555   13.838     6.081     8.068    46.006

 ......END OF NORMAL COORDINATE ANALYSIS......
 STEP CPU TIME = .15 TOTAL CPU TIME = 3.0 ( .0 MIN)
 TOTAL WALL CLOCK TIME= 3.0 SECONDS, CPU 

Molpro

 FREQUENCIES * CALCULATION OF THERMODYNAMICAL PROPERTIES

 Temperature   298.150 [K]  Pressure   1.00000 [atm]
 Atom  1: C         Mass  12.01100
 Atom  2: H         Mass   1.00794
 Atom  3: H         Mass   1.00794
 Atom  4: H         Mass   1.00794
 Atom  5: H         Mass   1.00794

 Molecular Mass:    16.04276 [a.u.]
 Moments of Inertia          11.25587    11.25587    11.25587 [a.u.]
 Point Group C2V   Order of principal axis 2
 Rotational Symmetry factor  2.0
 Rotational Temperatures      7.69484     7.69484     7.69484 [K]
 Rotational Constants       160.33541   160.33541   160.33541 [GHz]

 Vibrational Temperatures [K]   2187.11  2187.11  2187.11  2502.98  2502.98
                                4584.72  4718.87  4718.87  4718.87

 Zero-Point vibrational Energy      126.001 [kJ/Mol]
                                     30.115 [kcal/Mol]

 Electronic Energy at 0 [K]:                       -39.976878 [H]
 Electronic Energy + Zero-Point correction:        -39.928886 [H]
 Electronic Energy at     298.150 [K]:             -39.926037 [H]
 Enthalpy H at            298.150 [K]:             -39.925093 [H]
 Free Enthalpy G at       298.150 [K]:             -39.947873 [H]

 Partition Function  Z                 log10(Z)          ln(Z)
 Electronic      0.100000D+01          0.000000          0.000000
 Translation     0.252574D+07          6.402389         14.742046
 Rotation        0.213746D+03          2.329898          5.364787
 Vibration       0.100241D+01          0.001046          0.002409
 Total           0.541169D+09          8.733333         20.106833

                       H(T)-H(0)              Cv                 S
                       [kJ/Mol]          [J/Mol K]          [J/Mol K] 
 Electronic               0.000              0.000              0.000
 Translation              3.718             12.472            143.359
 Rotation                 3.718             12.472             57.077
 Vibration                0.045              1.142              0.171
 Volume (RT)              2.479              0.000              0.000
 Total                    9.961             26.086            200.608

 Thermal energies including ZPE:

 H(T)-E(0)              135.962 kJ/Mol
 U(T)-E(0)              133.483 kJ/Mol

                       H(T)-H(0)              Cv                 S
                       [kcal/Mol]        [cal/Mol K]        [cal/Mol K] 
 Electronic               0.000              0.000              0.000
 Translation              0.889              2.981             34.264
 Rotation                 0.889              2.981             13.642
 Vibration                0.011              0.273              0.041
 Volume (RT)              0.592              0.000              0.000
 Total                    2.381              6.235             47.946

 Thermal energies including ZPE:

 H(T)-E(0)               32.496 kcal/Mol
 U(T)-E(0)               31.903 kcal/Mol

NW-Chem

### example from http://institute.loni.org/NWChem2012/documents/mp2-session.pdf

Temperature = 298.15K

 Zero-Point correction to Energy    = 63.088 kcal/mol ( 0.100537 au)
 Thermal correction to Energy       = 65.855 kcal/mol ( 0.104947 au)
 Thermal correction to Enthalpy     = 66.447 kcal/mol ( 0.105891 au)

 Total Entropy                      = 64.162 cal/mol-K
   - Translational                  = 38.962 cal/mol-K (mol. weight = 78.0469)
   - Rotational                     = 20.753 cal/mol-K (symmetry # = 12)
   - Vibrational                    =  4.448 cal/mol-K

 Cv (constant volume heat capacity) = 17.280 cal/mol-K
   - Translational                  =  2.979 cal/mol-K
   - Rotational                     =  2.979 cal/mol-K
   - Vibrational                    = 11.321 cal/mol-K

Q-Chem

 STANDARD THERMODYNAMIC QUANTITIES AT   298.15 K  AND     1.00 ATM

   This Molecule has  0 Imaginary Frequencies
   Zero point vibrational energy:       30.118 kcal/mol

   Atom    1 Element C  Has Mass   12.00000
   Atom    2 Element H  Has Mass    1.00783
   Atom    3 Element H  Has Mass    1.00783
   Atom    4 Element H  Has Mass    1.00783
   Atom    5 Element H  Has Mass    1.00783
   Molecular Mass:    16.031320 amu
   Principal axes and moments of inertia in amu*Bohr^2:
                             1           2           3
    Eigenvalues --       11.25464    11.25464    11.25464
          X               1.00000     0.00000     0.00000
          Y               0.00000     1.00000     0.00000
          Z               0.00000     0.00000     1.00000
   Rotational Symmetry Number is   1
   The Molecule is a Spherical Top
   Translational Enthalpy:        0.889 kcal/mol
   Rotational Enthalpy:           0.889 kcal/mol
   Vibrational Enthalpy:         30.129 kcal/mol
   gas constant (RT):             0.592 kcal/mol
   Translational Entropy:        34.261  cal/mol.K
   Rotational Entropy:           15.019  cal/mol.K
   Vibrational Entropy:           0.041  cal/mol.K

   Total Enthalpy:               32.498 kcal/mol
   Total Entropy:                49.321  cal/mol.K

G*
http://www.gaussian.com/g_whitepap/thermo/thermo.pdf