cclib / cclib

Parsers and algorithms for computational chemistry logfiles
https://cclib.github.io/
BSD 3-Clause "New" or "Revised" License
330 stars 167 forks source link

Support for xTB within ORCA #808

Open schneiderfelipe opened 4 years ago

schneiderfelipe commented 4 years ago

Hi,

ORCA currently supports calling xtb from within it, which significantly increases the functionality of both codes. There's already an issue regarding the support of cclib for xtb (#789), so I thought about opening a new one about the ORCA+xtb use case.

The functionality works basically by calling xtb from inside ORCA and attaching the output of xtb within the "main" output:

...
[ORCA]
...
                        ORCA OPTIMIZATION COORDINATE SETUP
------------------------------------------------------------------------------

The optimization will be done in new redundant internal coordinates
Making redundant internal coordinates   ...  (new redundants) done
Evaluating the initial hessian          ...  (Almloef) done
Evaluating the coordinates              ...  done
Calculating the B-matrix                .... done
Calculating the G-matrix                .... done
Diagonalizing the G-matrix              .... done
The first mode is                       ....    0
The number of degrees of freedom        ....    1

    -----------------------------------------------------------------
                    Redundant Internal Coordinates

    -----------------------------------------------------------------
         Definition                    Initial Value    Approx d2E/dq
    -----------------------------------------------------------------
      1. B(H   1,H   0)                  1.0000         0.095955
    -----------------------------------------------------------------

Number of atoms                         .... 2
Number of degrees of freedom            .... 1

         *************************************************************
         *                GEOMETRY OPTIMIZATION CYCLE   1            *
         *************************************************************
      -----------------------------------------------------------
     |                   =====================                   |
     |                           x T B                           |
     |                   =====================                   |
     |                         S. Grimme                         |
     |          Mulliken Center for Theoretical Chemistry        |
     |                    University of Bonn                     |
      -----------------------------------------------------------

   * xtb version 6.3.0 (preview) compiled by 'ehlert@majestix' on 2019-12-12

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
...
[xtb]
...
           -------------------------------------------------
          | TOTAL ENERGY               -0.966523050218 Eh   |
          | GRADIENT NORM               0.089191857169 Eh/α |
          | HOMO-LUMO GAP               9.182896506924 eV   |
           -------------------------------------------------

------------------------------------------------------------------------
 * finished run on 2020/03/10 at 08:15:23.986
------------------------------------------------------------------------
 total:
 * wall-time:     0 d,  0 h,  0 min,  0.097 sec
 *  cpu-time:     0 d,  0 h,  0 min,  0.023 sec
 * ratio c/w:     0.235 speedup
 SCF:
 * wall-time:     0 d,  0 h,  0 min,  0.021 sec
 *  cpu-time:     0 d,  0 h,  0 min,  0.004 sec
 * ratio c/w:     0.172 speedup

-------------------------   --------------------
FINAL SINGLE POINT ENERGY        -0.966523050220
-------------------------   --------------------

------------------------------------------------------------------------------
                         ORCA GEOMETRY RELAXATION STEP
------------------------------------------------------------------------------
...
[ORCA again]
...

(The above was taken from this logfile.) The input is also simple and standard:

! XTB2 Opt NumFreq

*xyz 0 1
H 0 0 0
H 0 0 1
*

So we have a "hybrid" output. It seems to me that the complete output of xtb is being given, so it might be possible to cover this use case by calling the future xtb parser from within the parser for ORCA.

langner commented 4 years ago

Oh, that's interesting. So do you see cclib invoking a parser within another parser?

schneiderfelipe commented 4 years ago

Oh, that's interesting. So do you see cclib invoking a parser within another parser?

Yes. If we have a logfile with either XTB1 or XTB2 flags, I think the ORCA parser can safely retrieve the inner output lines and delegate them to the future XTB parser (I don't believe ORCA changes anything from what it receives from xtb). After that, there might be some post-processing as well, but that's it. I think ORCA calls xtb for energies and gradients only. Is it doable?

berquist commented 4 years ago

So do you see cclib invoking a parser within another parser?

I could also envision doing this for how Psi4 drives CFOUR.