8000 Parse empirical dispersion corrections by berquist · Pull Request #745 · cclib/cclib · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Parse empirical dispersion corrections #745

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Aug 3, 2020
Merged

Conversation

berquist
Copy link
Member

Extends #418 to all parsers. Closes #660. Closes #664.

@berquist berquist added this to the v1.6.2 milestone May 26, 2019
@langner langner modified the milestones: v1.6.2, v1.6.3 Sep 5, 2019
@berquist berquist force-pushed the 664-dispersion branch 2 times, most recently from d4119fd to c5d2959 Compare February 17, 2020 21:05
@berquist
Copy link
Member Author

Comment to myself: this is still draft while the following issues exist

********* SUMMARY OF ERRORS *********

basicPsi4-1.2.1/dvb_dispersion_bp86_d3zero.out: None
testdispersionenergies (test.data.testSP.GenericDispersionTest)Traceback (most recent call last):
  File "/home/eric/development/cclib_berquist/test/data/testSP.py", line 400, in testdispersionenergies
    self.assertTrue(len(self.data.dispersionenergies), 1)
  File "/home/eric/development/cclib_berquist/test/test_data.py", line 124, in ccdata_getattribute_with_coverage
    return object.__getattribute__(self, attr)
AttributeError: 'ccData' object has no attribute 'dispersionenergies'


********* SUMMARY OF FAILURES *********

basicFirefly8.1/dvb_dispersion_bp86_d3zero.out: None
testdispersionenergies (test.data.testSP.GenericDispersionTest)Traceback (most recent call last):
  File "/home/eric/development/cclib_berquist/test/data/testSP.py", line 401, in testdispersionenergies
    self.assertAlmostEquals(self.data.dispersionenergies[0], -0.40407836521053214)
AssertionError: -0.42998210046822655 != -0.40407836521053214 within 7 places (0.025903735257694405 difference)

basicGAMESS-US2018/dvb_dispersion_bp86_d3zero.out: None
testdispersionenergies (test.data.testSP.GenericDispersionTest)Traceback (most recent call last):
  File "/home/eric/development/cclib_berquist/test/data/testSP.py", line 401, in testdispersionenergies
    self.assertAlmostEquals(self.data.dispersionenergies[0], -0.40407836521053214)
AssertionError: -0.40054977293661714 != -0.40407836521053214 within 7 places (0.003528592273914999 difference)

basicGaussian16/dvb_dispersion_bp86_d3zero.out: None
testdispersionenergies (test.data.testSP.GenericDispersionTest)Traceback (most recent call last):
  File "/home/eric/development/cclib_berquist/test/data/testSP.py", line 401, in testdispersionenergies
    self.assertAlmostEquals(self.data.dispersionenergies[0], -0.40407836521053214)
AssertionError: -0.40054946000568914 != -0.40407836521053214 within 7 places (0.0035289052048430025 difference)

basicNWChem6.8/dvb_dispersion_bp86_d3zero.out: None
testdispersionenergies (test.data.testSP.GenericDispersionTest)Traceback (most recent call last):
  File "/home/eric/development/cclib_berquist/test/data/testSP.py", line 401, in testdispersionenergies
    self.assertAlmostEquals(self.data.dispersionenergies[0], -0.40407836521053214)
AssertionError: -0.4005497099422608 != -0.40407836521053214 within 7 places (0.0035286552682713412 difference)

basicORCA4.1/dvb_dispersion_bp86_d3zero.out: None
testdispersionenergies (test.data.testSP.GenericDispersionTest)Traceback (most recent call last):
  File "/home/eric/development/cclib_berquist/test/data/testSP.py", line 401, in testdispersionenergies
    self.assertAlmostEquals(self.data.dispersionenergies[0], -0.40407836521053214)
AssertionError: -0.4005497375618166 != -0.40407836521053214 within 7 places (0.003528627648715532 difference)

basicQChem5.1/dvb_dispersion_bp86_d3zero.out: None
testdispersionenergies (test.data.testSP.GenericDispersionTest)Traceback (most recent call last):
  File "/home/eric/development/cclib_berquist/test/data/testSP.py", line 401, in testdispersionenergies
    self.assertAlmostEquals(self.data.dispersionenergies[0], -0.40407836521053214)
AssertionError: -0.4005494953804897 != -0.40407836521053214 within 7 places (0.0035288698300424692 difference)

@ghutchis
Copy link
Contributor
ghutchis commented Jun 9, 2020

Is this a difference between D3 "zero" and D3BJ?

@berquist
Copy link
Member Author
berquist commented Jun 9, 2020

@ghutchis if I remember correctly, it's mostly that, but there may have been something else. I started switching from D3(0) to D3(BJ) since not all programs I have access to can do D3(0), strangely. I'll check tonight, also to make sure I don't have changes in a stash.

@ghutchis
Copy link
Contributor
ghutchis commented Jun 9, 2020

The Firefly example seems totally out of left field.. You can always check with dftd3 to get the 'authentic' numbers:
https://anaconda.org/psi4/dftd3

That's the Psi4 modified version, but IIRC Lori didn't change anything (https://github.com/loriab/dftd3)

Uh oh!

There was an error while loading. Please reload this page.

@berquist
Copy link
Member Author

Here's the current state of this PR. Some of these might just be stray untracked outputs in my work directories. All calculations using BP86.

program version D3 damping energy
DALTON 2018 BJ -0.89908282
DALTON 2018 zero -0.40407837
Firefly 8.1 ? -0.4299821
GAMESS 2018 BJ -0.90884967
GAMESS 2018 zero -0.40054977
GAMESS 2018 ? -0.97852033
Gaussian 16 zero -0.40054946
Molpro 2018 zero mocoeffs parsing broken
NWChem 6.8 zero -0.40054971
ORCA 4.0 ? -4.24985755
ORCA 4.1 zero -0.40054974
Psi4 1.2.1 zero can't parse yet?
Q-Chem 5.1 zero -0.4005495

Filtered just for D3(0) and working,

program version energy
DALTON 2018 -0.40407837
Firefly 8.1 -0.4299821
GAMESS 2018 -0.40054977
Gaussian 16 -0.40054946
NWChem 6.8 -0.40054971
ORCA 4.1 -0.40054974
Q-Chem 5.1 -0.4005495

It looks like the next reasonable tasks are:

  • Get BP86/D3(0) corrections for the geometries in the DALTON and Firefly inputs.
    • If dftd3 is consistent with DALTON and Firefly, then the geometries are different; update the geometries and rerun. Consistent geometries is already a known issue: Using standardized inputs for testing #407
    • If dftd3 is consistent with every other package, then there is something up with the Firefly and DALTON settings or implementations; make specific unit tests and link to this comment.
  • Run the ORCA 4.2 calculation.
  • Implement for Psi4.

Anything for Molpro will have to wait until #872 is done, which will take more time.

@berquist
Copy link
Member Author

The Q-Chem and Firefly results with dftd3 are identical, but comparing against the DALTON geometry:

program's input geometry energy (a.u.) energy (eV) using cclib converter
Q-Chem -0.01471993 -0.40054968313904654
DALTON -0.01484961 -0.40407845555233046

This indicates that

  • the geometries we use with DALTON are inconsistent, and
  • something else is going on with Firefly.

@berquist berquist changed the title [WIP] Parse empirical dispersion corrections Parse empirical dispersion corrections Jun 11, 2020
@berquist
Copy link
Member Author

I've updated the geometry for the DALTON calculation and now the results are identical. To take a look at the raw outputs, we can see that at least part of the Firefly parameters are different from DALTON and Q-Chem:

param DALTON Q-Chem Firefly
s6 1.000 1.000 1.000
s8 1.683 1.683 1.682
sr6 1.139 1.139 1.094
sr8 1.000 1.000 1.000
alpha 14.000 ? ?
k1 ? ? 16
k2 ? ? 1.333
k3 ? ? -4
rthr 20000
rthr2 ? ? 1600

The nuclear repulsion energy is also wrong, even before adding the dispersion correction.

DALTON:

                      DFT-D Empirical Dispersion Correction
                      -------------------------------------

       Running DFT-D Version :     3
                   Reference : S. Grimme, J. Antony, S. Ehrlich and H. Krieg, 
                               J. Chem. Phys. 132 (2010), 154104
       Becke-Johnson Damping :    F
                3-body terms :    F


                      DFT-D3 Functional Dependent Parameters
                      --------------------------------------

      s_6 =       1.000000000000     sr_6 =       1.139000000000
      s_8 =       1.683000000000     sr_8 =       1.000000000000
      alp =      14.000000000000


                          +------------------------------+
                          ! Dispersion Energy Correction !
                          +------------------------------+

                      E_disp :         -0.014719923805

Q-Chem:

 Adding empirical dispersion correction 
 ----------------------------------------------------------------
 Doing -D3(0) with
 s6  =   1.00000
 s8  =   1.68300
 rs6 =   1.13900
 rs8 =   1.00000
 -D3 energy without 3body term =     -0.0147199231 hartrees

Firefly:

Loading Firefly/DFT-D extension... loaded successfully (version  1.0001).

 Firefly/DFT-D extension capabilities:
 Minimum supported DFT-D version is   2
 Maximum supported DFT-D version is   4
 For DFT-D version   2, max supported atomic no. is  86
 For DFT-D version   3, max supported atomic no. is  94
 For DFT-D version   4, max supported atomic no. is  94

 Using DFT-D version  3
 Cite DFT-D3 as:
 S. Grimme, J. Antony, S. Ehrlich and H. Krieg,
 J. Chem. Phys. 132 (2010), 154104

 Initializing DFT-D extension... initialized successfully!

     ---------------------------------------------
         Parameters controlling DFT-D run are:
     ----
8000
-----------------------------------------
     VERSN =             3   S6    = 1.0000000E+00
     RS6   = 1.0940000E+00   S18   = 1.6820000E+00
     RS18  = 1.0000000E+00   ALP   = 1.4000000E+01
     K1    = 1.6000000E+01   K2    = 1.3333333E+00
     K3    =-4.0000000E+00   RTHR  = 2.0000000E+04
     RTHR2 = 1.6000000E+03   NUMGRD=             F
     ABC   =             F   TZ    =             F

@berquist berquist marked this pull request as ready for review June 29, 2020 13:58
@berquist berquist requested review from langner and shivupa June 29, 2020 13:59
@berquist
Copy link
Member Aut 8000 hor

Molpro is implemented, but not tested, since there are bigger problems with parsing MO coefficients from the latest version (#872).

@shivupa
Copy link
Member
shivupa commented Aug 3, 2020

Sorry for the delay. This looks good to me, and I'm in favor of merging. I just have a question:

The nuclear repulsion energy is also wrong, even before adding the dispersion correction.
The firefly nuclear repulsion energy? Can this and the difference in parameters be reported upstream?

# However, they vary wildly in form and number, making parsing problematic
line = next(inputfile)
while 'Dispersion correction' not in line:
line = next(inputfile)
Copy link
Member
@shivupa shivupa Aug 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we do self.skip_lines(inputfile,["Dispersion parameters"])

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't clear if the number of lines to skip is fixed, and we (I?) do this in other places.

Copy link
Member
@langner langner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's some details to fill in here. But given the magnitude of this change, I think Shiv is right and I'm going to merge. We can clean up anything that's left later.

@langner langner merged commit 027d462 into cclib:master Aug 3, 2020
@berquist berquist deleted the 664-dispersion branch August 5, 2020 01:27
@berquist
Copy link
Member Author
berquist commented Aug 5, 2020

Can this and the difference in parameters be reported upstream?

I see in the 8.2.0 (latest version) changelog

  1. Changes to use newer, more precise value of Bohr radius, namely
    0.52917721067 Angstrom, throughout all the code. Previous versions
    of Firefly used older, less precise value of 0.52917724924 Angstrom.
    Note: this transition causes minor differences in computed energies and
    other properties as compared to older Firefly versions when initial
    geometry is specified using Angstroms.

which may account for this (I used 8.1.1). It's possible that 8.2.0 has fixed this. I have the 8.2.0 archive, but never registered it to get the password.

@berquist
Copy link
Member Author
berquist commented Aug 5, 2020

I think there's some details to fill in here.

I can't think of anything off the top of my head. What do you think is missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure dispersion correction is added to scfenergies for all packages ORCA parser does not include dispersion correction in scfenergies
5 participants
0