hackingmaterials / atomate

atomate is a powerful software for computational materials science and contains pre-built workflows.
https://hackingmaterials.github.io/atomate
Other
245 stars 175 forks source link

QChemDrone: fix Frequency parsing for single atoms #761

Closed rkingsbury closed 2 years ago

rkingsbury commented 2 years ago

Summary

Frequency calculations for single atoms may not have a frequency_mode_vectors key in their output, which was causing the Drone to fail parsing these calculations.

rkingsbury commented 2 years ago

OK, on further testing, the fix here allows task docs to be parsed successfully; however it does NOT populate the entropy, enthalpy or other fields as expected.

Below are the relevant sections of two output files at the same level of theory and solvent model - one single point and one frequency calc, both for a K+ ion in water. It isn't clear to me what the Freq calc is doing here that the single point is not. It appears to compute the Hessian at the end but it does not output any other quantities (no ZPE, enthalpy, etc.). Maybe this is to be expected?

Frequency Calc

  -----------------------------------------------------------------------
 Exchange:     0.2220 Hartree-Fock + 1.0000 wB97X-D + LR-HF
 Correlation:  1.0000 wB97X-D
 Using SG-3 standard quadrature grid
 Dispersion:   Grimme D
 using 40 threads for integral computing
 -------------------------------------------------------
 OpenMP Integral computing Module
 Release: version 1.0, May 2013, Q-Chem Inc. Pittsburgh
 -------------------------------------------------------
 A restricted SCF calculation will be
 performed using DIIS
 SCF converges when DIIS error is below 1.0e-08
 ---------------------------------------
  Cycle       Energy         DIIS error
 ---------------------------------------
    1    -599.7959138013      2.71e-03
    2    -599.8023552186      1.53e-03
    3    -599.8027737437      4.63e-04
    4    -599.8028176598      1.82e-05
    5    -599.8028177179      2.01e-06
    6    -599.8028177187      1.17e-07
    7    -599.8028177187      2.10e-08
    8    -599.8028177187      1.02e-09  Convergence criterion met
 ---------------------------------------
 SCF time:   CPU 71.94s  wall 1.00s

************** Final PCM Free Energy Summary **************
 G_electrostatic  =      -0.12480190 hartree =     -78.31437434 kcal/mol
 G_cavitation     =       0.00000000 hartree =       0.00000000 kcal/mol
 G_dispersion     =       0.00000000 hartree =       0.00000000 kcal/mol
 G_repulsion      =       0.00000000 hartree =       0.00000000 kcal/mol
 --------------------------------------------------
 Non-electrostatic Free Energy =       0.00000000 hartree =       0.00000000 kcal/mol
 Total                         =      -0.12480190 hartree =     -78.31437434 kcal/mol
 --------------------------------------------------
 SCF Energy (H0 + V/2)                       =    -599.80281772
 Solute Internal Energy (H0)                 =    -599.67801582
 Total Free Energy (H0 + V/2 + non-elec)     =    -599.80281772 hartree
                                             = -376381.94885096 kcal/mol
***********************************************************

 SCF   energy in the final basis set =     -599.8028177187
 Total energy in the final basis set =     -599.8028177187

...

 Calculating analytic Hessian of the SCF energy
 Polarizability Matrix (a.u.)
            1           2           3
    1  -5.1599622   0.0000000  -0.0000000
    2   0.0000000  -5.1599622   0.0000000
    3  -0.0000000   0.0000000  -5.1599622
 Call libqints based aoints job 221
atom: 0 element: 19

 Direct stationary perturbation theory relativistic correction:

 rels  =       1.257707892178
 relv  =      -4.320573343132
 rel2e =       0.000000000000
 E_rel =      -3.062865450954

 Computing fast CPCM-SWIG hessian
 Gradient time:  CPU 71.29 s  wall 1.79 s
 Total job time:  3.99s(wall), 156.13s(cpu)
 Mon Aug  8 13:59:57 2022

        *************************************************************
        *                                                           *
        *  Thank you very much for using Q-Chem.  Have a nice day.  *
        *                                                           *
        *************************************************************

Single Point

 -------------------------------------------------------
 OpenMP Integral computing Module
 Release: version 1.0, May 2013, Q-Chem Inc. Pittsburgh
 -------------------------------------------------------
 A restricted SCF calculation will be
 performed using DIIS
 SCF converges when DIIS error is below 1.0e-05
 ---------------------------------------
  Cycle       Energy         DIIS error
 ---------------------------------------
    1    -599.7959138013      2.71e-03
    2    -599.8023552186      1.53e-03
    3    -599.8027737437      4.63e-04
    4    -599.8028176598      1.82e-05
    5    -599.8028177179      2.01e-06  Convergence criterion met
 ---------------------------------------
 SCF time:   CPU 43.36s  wall 1.00s

************** Final PCM Free Energy Summary **************
 G_electrostatic  =      -0.12480191 hartree =     -78.31437884 kcal/mol
 G_cavitation     =       0.00000000 hartree =       0.00000000 kcal/mol
 G_dispersion     =       0.00000000 hartree =       0.00000000 kcal/mol
 G_repulsion      =       0.00000000 hartree =       0.00000000 kcal/mol
 --------------------------------------------------
 Non-electrostatic Free Energy =       0.00000000 hartree =       0.00000000 kcal/mol
 Total                         =      -0.12480191 hartree =     -78.31437884 kcal/mol
 --------------------------------------------------
 SCF Energy (H0 + V/2)                       =    -599.80281772
 Solute Internal Energy (H0)                 =    -599.67801581
 Total Free Energy (H0 + V/2 + non-elec)     =    -599.80281772 hartree
                                             = -376381.94885045 kcal/mol
***********************************************************

 SCF   energy in the final basis set =     -599.8028177179
 Total energy in the final basis set =     -599.8028177179
rkingsbury commented 2 years ago

Thanks to @espottesmith we have confirmed that Q-Chem 5.4.2 no longer includes enthalpy and entropy in single-atom freq calculations, whereas previous version of Q-Chem did. They are investigating when this was dropped; once we have a better understanding we can decide the best course of action here.

rkingsbury commented 2 years ago

OK, Q-Chem only prints enthalpy and entropy (and other such info) for calculations run in vacuum, not those run with explicit solvent. I can confirm that this fix DOES result in a correctly-parsed task doc for a vacuum, single atom frequency calculation. For calculations in solvent, the Drone still completes successfully and generates a task doc, but enthalpy and entropy are null values since that output is not present.

rkingsbury commented 2 years ago

FYI @samblau. @Zhuoying it appears the CI test failures are unrelated to this PR. Can you please review soon?

samblau commented 2 years ago

Looks good to me!

Zhuoying commented 2 years ago

@rkingsbury Thanks for fixing the single atom frequency parse of Q-Chem. It looks nice and I am merging it now.