Skip to content

Manual GFNFF neighbor list ignored by EEQ constraints #1216

Closed
@rasmusslothlundkvist

Description

@rasmusslothlundkvist

Describe the bug
The charge distribution is computed without using the neighbor list from the ffnb section in the input file. This is evident from the gfnff_charges file, but also in the output which reports #fragments for EEQ constrain: 1 although the bonds specified with ffnb give rise to two fragments.
The bug was seen with a build from March 5 2025 (xtb version 6.7.1 (04e5303))

To Reproduce
Steps to reproduce the behaviour:

  1. happens with input

example.xyz:

5
H2O and OH-
O      0.000000    0.000000    0.000000
H      0.757000    0.586000    0.000000
H     -0.757000    0.586000    0.000000
O      2.200000    1.400000    0.000000
H      1.500000    0.800000    0.000000

control.inp:

$ffnb
  nb = 1:2
  nb = 2:1
  nb = 3:4, 5
  nb = 4:3
  nb = 5:3
$end
  1. start xtb with example.xyz --gfnff --input control.inp --charge -1
  2. output showing the error:

Content of gfnff_charges:

   -0.63277778
    0.07228187
    0.08012365
   -0.79885588
    0.27922814

Full xtb output:

      -----------------------------------------------------------      
     |                   =====================                   |     
     |                           x T B                           |     
     |                   =====================                   |     
     |                         S. Grimme                         |     
     |          Mulliken Center for Theoretical Chemistry        |     
     |                    University of Bonn                     |     
      -----------------------------------------------------------      

   * xtb version 6.7.1 (04e5303) compiled by 'runner@fv-az1705-474' on 2025-03-05

   xtb is free software: you can redistribute it and/or modify it under
   the terms of the GNU Lesser General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.
   
   xtb 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.  See the
   GNU Lesser General Public License for more details.
   
   Cite this work as:
   * C. Bannwarth, E. Caldeweyher, S. Ehlert, A. Hansen, P. Pracht,
     J. Seibert, S. Spicher, S. Grimme, WIREs Comput. Mol. Sci., 2020, 11,
     e01493. DOI: 10.1002/wcms.1493
   
   for GFN2-xTB:
   * C. Bannwarth, S. Ehlert and S. Grimme., J. Chem. Theory Comput., 2019,
     15, 1652-1671. DOI: 10.1021/acs.jctc.8b01176
   for GFN1-xTB:
   * S. Grimme, C. Bannwarth, P. Shushkov, J. Chem. Theory Comput., 2017,
     13, 1989-2009. DOI: 10.1021/acs.jctc.7b00118
   for GFN0-xTB:
   * P. Pracht, E. Caldeweyher, S. Ehlert, S. Grimme, ChemRxiv, 2019, preprint.
     DOI: 10.26434/chemrxiv.8326202.v1
   for GFN-FF:
   * S. Spicher and S. Grimme, Angew. Chem. Int. Ed., 2020, 59, 15665-15673.
     DOI: 10.1002/anie.202004239
   
   for ALPB and GBSA implicit solvation:
   * S. Ehlert, M. Stahn, S. Spicher, S. Grimme, J. Chem. Theory Comput.,
     2021, 17, 4250-4261. DOI: 10.1021/acs.jctc.1c00471
   
   for ddCOSMO and CPCM-X implicit solvation:
   * M. Stahn, S. Ehlert, S. Grimme, J. Phys. Chem. A,
     2023, XX, XXXX-XXXX. DOI: 10.1021/acs.jpca.3c04382
   
   for DFT-D4:
   * E. Caldeweyher, C. Bannwarth and S. Grimme, J. Chem. Phys., 2017,
     147, 034112. DOI: 10.1063/1.4993215
   * E. Caldeweyher, S. Ehlert, A. Hansen, H. Neugebauer, S. Spicher,
     C. Bannwarth and S. Grimme, J. Chem. Phys., 2019, 150, 154122.
     DOI: 10.1063/1.5090222
   * E. Caldeweyher, J.-M. Mewes, S. Ehlert and S. Grimme, Phys. Chem. Chem. Phys.
     2020, 22, 8499-8512. DOI: 10.1039/D0CP00502A
   
   for sTDA-xTB:
   * S. Grimme and C. Bannwarth, J. Chem. Phys., 2016, 145, 054103.
     DOI: 10.1063/1.4959605
   
   in the mass-spec context:
   * V. Asgeirsson, C. Bauer and S. Grimme, Chem. Sci., 2017, 8, 4879.
     DOI: 10.1039/c7sc00601b
   * J. Koopman and S. Grimme, ACS Omega 2019, 4, 12, 15120-15133.
     DOI: 10.1021/acsomega.9b02011
   
   for metadynamics refer to:
   * S. Grimme, J. Chem. Theory Comput., 2019, 155, 2847-2862
     DOI: 10.1021/acs.jctc.9b00143
   
   for SPH calculations refer to:
   * S. Spicher and S. Grimme, J. Chem. Theory Comput., 2021, 17, 1701-1714
     DOI: 10.1021/acs.jctc.0c01306
   
   for ONIOM refer to:
   * C. Plett, A. Katbashev, S. Ehlert, S. Grimme, M. Bursch,
     Phys. Chem. Chem. Phys., 2023, 25, 17860-17868. DOI: 10.1039/D3CP02178E
   
   for DIPRO refer to:
   * J. Kohn, N. Gildemeister, S. Grimme, D. Fazzi, A. Hansen,
     J. Chem. Phys., 2023, just accepted.
   
   for PTB refer to:
   * S. Grimme, M. Mueller, A. Hansen, J. Chem. Phys., 2023, 158, 124111.
     DOI: 10.1063/5.0137838
   
   with help from (in alphabetical order)
   P. Atkinson, C. Bannwarth, F. Bohle, G. Brandenburg, E. Caldeweyher
   M. Checinski, S. Dohm, S. Ehlert, S. Ehrlich, I. Gerasimov, C. Hölzer
   A. Katbashev, J. Kohn, J. Koopman, C. Lavigne, S. Lehtola, F. März, M. Müller,
   F. Musil, H. Neugebauer, J. Pisarek, C. Plett, P. Pracht, F. Pultar,
   J. Seibert, P. Shushkov, S. Spicher, M. Stahn, M. Steiner, T. Strunk,
   J. Stückrath, T. Rose, and J. Unsleber
   
 * started run on 2025/03/12 at 13:08:50.166     
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
 CONSTRAINTS & SCANS: DEBUG SECTION
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
   ID    Z sym.   atoms
    1    8 O      1, 4
    2    1 H      2, 3, 5
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

           -------------------------------------------------
          |                Calculation Setup                |
           -------------------------------------------------

          program call               : xtb example.xyz --gfnff --input control.inp --charge -1 --verbose
          coordinate file            : example.xyz
          xtbhome directory          : /home/xxx
          path for xtb               : /home/xxx
          xcontrol input file        : control.inp
          omp threads                :                    16

 
          entering GFN-FF setup routine... 5
 
          ==================== Thresholds ====================
          CN  :   150.00000
          rep :   500.00000
          disp:  2500.00000
          HB1 :   250.00000
          HB2 :   450.00000
 
          Pauling EN used:
          Z : 1  EN :  2.20
          Z : 8  EN :  3.44
          electric field strengths (au): 0.000
 
           ------------------------------------------------- 
          |           Force Field Initialization            |
           ------------------------------------------------- 
 
          distances ...
          ----------------------------------------
          generating topology and atomic info file ...
 
 The neighborlist has been adjusted according to the input file.
 
          pair mat ...
          computing topology distances matrix with Floyd-Warshall algo ...
          making topology EEQ charges ...
          #fragments for EEQ constrain: 1
          ----------------------------------------
          generating topology and atomic info file ...
 
 The neighborlist has been adjusted according to the input file.
 
          pair mat ...
          computing topology distances matrix with Floyd-Warshall algo ...
          making topology EEQ charges ...
          #fragments for EEQ constrain: 1
          rings ...
          # BATM   0
          # H in HB   1
          doing iterative Hueckel for 2 subsystem(s) ...
          iterative Hueckel run to get P ...
 
  atom   neighbors  erfCN metchar sp-hybrid imet pi  qest     coordinates
    1  O       1    1.92   0.00         3    0    0  -0.637    0.000000    0.000000    0.000000
    2  H       1    1.77   0.07         1    0    0   0.170    1.430523    1.107380    0.000000
    3  H       2    0.97   0.00         0    0    0   0.354   -1.430523    1.107380    0.000000
    4  O       1    0.98   0.00         2    0    0  -0.668    4.157397    2.645617    0.000000
    5  H       1    1.78   0.07         1    0    0  -0.219    2.834589    1.511781    0.000000

molecular fragment  # atoms  topo charge
       1             5            -1.000
 
 
          #atoms :   5
          #bonds :   3
 
 bond atoms        type  in ring    R      R0    piBO    fqq  kbond(tot)  alp
O  H      1    2      1    0     0.957   0.922   0.000   1.047  -0.041   0.583
H  O      3    4      1    0     3.067   0.728   0.000   1.047  -0.149   0.657
H  H      3    5      1    0     2.267   0.840   0.000   1.047  -0.055   0.402
          #angl  :   1
 
 angle atoms        phi0    phi      FC  pi rings
    3    5    4   100.000   9.975   0.148 F   0
 torsion atoms        nrot   rings    phi0    phi      FC
 out-of-plane atoms          phi0    phi      FC
          #tors  :   0
          #nmol  :   1
          #optfrag :   1
 
 GFN-FF setup done.
 
           ------------------------------------------------- 
          |                   G F N - F F                   |
          |          A general generic force-field          |
          |                  Version 1.0.3                  | 
           ------------------------------------------------- 
          Number of HB bonds (bound hydrogen)     0
          Number of HB bonds (unbound hydrogen)   6
          Number of XB bonds                      0

 E+G (total)                   0 d,  0 h,  0 min,  0.002 sec
 distance/D3 list               ...        0 min,  0.000 sec (  0.496%)
 non bonded repulsion           ...        0 min,  0.000 sec ( 13.224%)
 dCN                            ...        0 min,  0.000 sec (  0.416%)
 EEQ energy and q               ...        0 min,  0.000 sec ( 11.221%)
 D3                             ...        0 min,  0.000 sec ( 11.182%)
 EEQ gradient                   ...        0 min,  0.000 sec (  7.276%)
 bonds                          ...        0 min,  0.001 sec ( 27.647%)
 bend and torsion               ...        0 min,  0.000 sec ( 12.103%)
 bonded ATM                     ...        0 min,  0.000 sec (  0.169%)
 HB/XB (incl list setup)        ...        0 min,  0.000 sec ( 13.144%)

         :::::::::::::::::::::::::::::::::::::::::::::::::::::
         ::                     SUMMARY                     ::
         :::::::::::::::::::::::::::::::::::::::::::::::::::::
         :: total energy              -0.769440140696 Eh    ::
         :: gradient norm              0.790955614087 Eh/a0 ::
         ::.................................................::
         :: bond energy               -0.044340515347 Eh    ::
         :: angle energy               0.000014258410 Eh    ::
         :: torsion energy             0.000000000000 Eh    ::
         :: repulsion energy           0.545844072303 Eh    ::
         :: electrostat energy        -1.270171709235 Eh    ::
         :: dispersion energy         -0.000786246826 Eh    ::
         :: HB energy                  0.000000000000 Eh    ::
         :: XB energy                  0.000000000000 Eh    ::
         :: bonded atm energy          0.000000000000 Eh    ::
         :: external energy            0.000000000000 Eh    ::
         :: add. restraining           0.000000000000 Eh    ::
         :: total charge              -1.000000000000 e     ::
         ::.................................................::
         :: atomisation energy         0.000000000000 Eh    ::
         :::::::::::::::::::::::::::::::::::::::::::::::::::::

           -------------------------------------------------
          |                Property Printout                |
           -------------------------------------------------

molecular dipole:
                 x           y           z       tot (Debye)
 q only:       -2.541      -1.523       0.000       7.529

           -------------------------------------------------
          | TOTAL ENERGY               -0.769440140696 Eh   |
          | GRADIENT NORM               0.790955614087 Eh/α |
           -------------------------------------------------
########################################################################
[WARNING] Runtime exception occurred
-1- gfnff_setup: Could not read topology file.
########################################################################

------------------------------------------------------------------------
 unit  open   action     filename
  129 false : read       control.inp
  130  true : read       control.inp
  129 false : read       example.xyz
  129 false : read       control.inp
  129 false : written    gfnff_topo
  129 false : replaced   gfnff_charges

------------------------------------------------------------------------
 * finished run on 2025/03/12 at 13:08:50.187     
------------------------------------------------------------------------
 total:
 * wall-time:     0 d,  0 h,  0 min,  0.021 sec
 *  cpu-time:     0 d,  0 h,  0 min,  0.029 sec
 * ratio c/w:     1.423 speedup
 SCF:
 * wall-time:     0 d,  0 h,  0 min,  0.004 sec
 *  cpu-time:     0 d,  0 h,  0 min,  0.008 sec
 * ratio c/w:     2.043 speedup

Expected behaviour
The EEQ constraints are expected to respect the bonds that have been provided such that the bonds used and the charges assigned are consistent.

Input files
The files have been renamed to .txt files for uploading.
example.txt
control.txt

Metadata

Metadata

Assignees

Labels

method: GFN-FFRelated to the GFN-FF method

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions