grimme-lab / xtb

Semiempirical Extended Tight-Binding Program Package
https://xtb-docs.readthedocs.io/
GNU Lesser General Public License v3.0
570 stars 144 forks source link

Some problems with the xTB PBC calculation #491

Open GliderHX opened 3 years ago

GliderHX commented 3 years ago

Describe the bug 1 xTB 6.3.0 version claims to support PBC calculation with GFN1 However, under version 6.4.0 (conda installation), I used xtb --gfn 1 molcrystal.vasp to calculate the periodic cell constructed with a molecule and reported the following error

########################################################################
[ERROR] Program stopped due to fatal error
-4- Single point calculation terminated
-3- xtb_calculator_singlepoint: Electronic structure method terminated
-2- scf: Halogen bond correction not available with PBC
-1- restart_readRestart: Version number missmatch in restart file.
########################################################################

To Reproduce Steps to reproduce the behaviour:

  1. xtb --gfn 1 molcrystal.vasp

Expected behaviour The unit cell containing halogen atoms can be calculated normally with xTB GFN 0 and CP2K GFN 1

  CP2K GFN1-xTB 
Core Hamiltonian energy:                                   -414.11299402957053
  Repulsive potential energy:                                   4.58992399818704
  Electronic energy:                                            1.01323274921783
  DFTB3 3rd order energy:                                       0.06169259363457
  Dispersion energy:                                           -0.45325555974422
  Correction for halogen bonding:                               0.00000000000000

  Total energy:                                              -408.90140024827531

Correction for halogen bonding is 0.0 a.u.

Describe the bug 2

When I use gfn 0 to calculate the same type of structure, it seems normal. But for one molecule, I constructed 634 different molecular crystals using force fields and recalculated their energies with xtb gfn 0.

620/634 structures are in the range of -2.55 ~ - 2.65 eV/atom ( They are composed of the same molecule and should have a small energy difference). But there are 4 structures with energy less than -4 eV/atom, the most absurd one is - 331.39 eV/atom (the structure named POSCAR, which has been uploaded). So I doubt the accuracy of xtb gfn 0 to calculate PBC structures.

         :::::::::::::::::::::::::::::::::::::::::::::::::::::
         ::                     SUMMARY                     ::
         :::::::::::::::::::::::::::::::::::::::::::::::::::::
         :: total energy          -21209.076122012499 Eh    ::
         :: gradient norm       51476836.712104469538 Eh/a0 ::
         :: HOMO-LUMO gap              0.807066282430 eV    ::
         ::.................................................::
         :: H0 energy             -21224.797211136152 Eh    ::
         :: repulsion energy           1.237769451650 Eh    ::
         :: electrostat energy        14.837068150127 Eh    ::
         :: -> Gsolv                   0.000000000000 Eh    ::
         ::    -> Gsasa                0.000000000000 Eh    ::
         ::    -> Gshift               0.000000000000 Eh    ::
         :: dispersion energy         -0.141538845511 Eh    ::
         :: short-range corr.         -0.212209632615 Eh    ::
         :: add. restraining           0.000000000000 Eh    ::
         :: total charge               0.000000000007 e     ::
         :::::::::::::::::::::::::::::::::::::::::::::::::::::

To Reproduce Steps to reproduce the behaviour:

  1. xtb --gfn 0 POSCAR

Expected behaviour This problem structure is calculated normally using CP2K GFN 1 and VASP

Additional context molcrystal.vasp POSCAR

awvwgk commented 3 years ago

Thanks for reporting. I'm currently working on a more stable and more complete PBC implementation at awvwgk/tblite, which is currently in the process of being interfaced with DFTB+. This implementation will at some point replace the current PBC implementation in xtb which is not particular robust yet.

Regarding the halogen bonding term in GFN1-xTB. The term is particular difficult since it is a topological term which can be somewhat ill-defined under PBCs. I haven't come around to check how a periodic version of this contribution would look like yet.

awvwgk commented 3 years ago

There is now a periodic halogen bonding correction implemented in the tblite library (https://github.com/awvwgk/tblite/commit/778f1c1623f52eca752f4fdeb1cbcb641e33ec76). I probably won't backport this to xtb but just continue working on a full integration of the library into xtb.