grimme-lab / xtb

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

Automatic UHF calculation for odd number of electrons #1107

Open gasevic opened 2 months ago

gasevic commented 2 months ago

Describe the bug If a system contains an odd number of electrons, xTB will automatically enforce a UHF calculation with one unpaired electron. However, this adjustment occurs without any warning, and the output incorrectly displays unpaired electrons = 0, which can be misleading. This becomes particularly problematic when the system is supposed to carry a charge, but the charge information is missing.

To Reproduce Steps to reproduce the behaviour:

  1. happens for systems with uneven electron count (e.g. H3O+, see input geometry)
  2. run xtb struc.xyz vs. xtb struc.xyz -uhf 1 yields the same result
Input Geometry ``` 4 energy: -5.088192529146 gnorm: 0.000115842525 xtb: 6.7.1 (edcfbbe) O 0.12705489143145 0.12705489143175 0.12705489142261 H 1.05992566989601 -0.09349028052419 -0.09349028080321 H -0.09349028052419 1.05992566988652 -0.09349028079401 H -0.09349028080327 -0.09349028079407 1.05992567017460 ```
Output without charge and UHF information ``` ----------------------------------------------------------- | ===================== | | x T B | | ===================== | | S. Grimme | | Mulliken Center for Theoretical Chemistry | | University of Bonn | ----------------------------------------------------------- * xtb version 6.7.1 (edcfbbe) compiled by 'albert@albert-system' on 2024-07-22 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 2024/09/20 at 14:00:03.258 ID Z sym. atoms 1 8 O 1 2 1 H 2-4 ------------------------------------------------- | Calculation Setup | ------------------------------------------------- program call : xtb struc.xyz hostname : fs7 coordinate file : struc.xyz omp threads : 16 ------------------------------------------------- | G F N 2 - x T B | ------------------------------------------------- Reference 10.1021/acs.jctc.8b01176 * Hamiltonian: H0-scaling (s, p, d) 1.850000 2.230000 2.230000 zeta-weighting 0.500000 * Dispersion: s8 2.700000 a1 0.520000 a2 5.000000 s9 5.000000 * Repulsion: kExp 1.500000 1.000000 rExp 1.000000 * Coulomb: alpha 2.000000 third order shell-resolved anisotropic true a3 3.000000 a5 4.000000 cn-shift 1.200000 cn-exp 4.000000 max-rad 5.000000 ................................................... : SETUP : :.................................................: : # basis functions 7 : : # atomic orbitals 7 : : # shells 5 : : # electrons 9 : : max. iterations 250 : : Hamiltonian GFN2-xTB : : restarted? false : : GBSA solvation false : : PC potential false : : electronic temp. 300.0000000 K : : accuracy 1.0000000 : : -> integral cutoff 0.2500000E+02 : : -> integral neglect 0.1000000E-07 : : -> SCF convergence 0.1000000E-05 Eh : : -> wf. convergence 0.1000000E-03 e : : Broyden damping 0.4000000 : : net charge 0 : : unpaired electrons 0 : ................................................... iter E dE RMSdq gap omega full diag 1 -5.3100896 -0.531009E+01 0.370E+00 7.10 0.0 T 2 -5.3139697 -0.388014E-02 0.205E+00 7.03 1.0 T 3 -5.3143846 -0.414920E-03 0.484E-01 6.97 1.0 T 4 -5.3144274 -0.427168E-04 0.194E-02 6.98 2.6 T 5 -5.3144277 -0.382685E-06 0.288E-03 6.99 17.3 T 6 -5.3144277 -0.366471E-08 0.700E-04 6.99 71.5 T 7 -5.3144277 -0.270234E-09 0.225E-06 6.99 22232.1 T *** convergence criteria satisfied after 7 iterations *** # Occupation Energy/Eh Energy/eV ------------------------------------------------------------- 1 2.0000 -0.7141239 -19.4323 2 2.0000 -0.5902729 -16.0621 3 2.0000 -0.5902729 -16.0621 4 2.0000 -0.5096717 -13.8689 5 1.0000 -0.0354997 -0.9660 (HOMO) 6 0.2212163 6.0196 (LUMO) 7 0.2212163 6.0196 ------------------------------------------------------------- HL-Gap 0.2567159 Eh 6.9856 eV Fermi-level -0.0898637 Eh -2.4453 eV SCC (total) 0 d, 0 h, 0 min, 0.025 sec SCC setup ... 0 min, 0.000 sec ( 0.825%) Dispersion ... 0 min, 0.000 sec ( 0.224%) classical contributions ... 0 min, 0.000 sec ( 0.093%) integral evaluation ... 0 min, 0.000 sec ( 1.462%) iterations ... 0 min, 0.023 sec ( 93.684%) molecular gradient ... 0 min, 0.000 sec ( 1.275%) printout ... 0 min, 0.001 sec ( 2.205%) ::::::::::::::::::::::::::::::::::::::::::::::::::::: :: SUMMARY :: ::::::::::::::::::::::::::::::::::::::::::::::::::::: :: total energy -5.272973255368 Eh :: :: gradient norm 0.401699536387 Eh/a0 :: :: HOMO-LUMO gap 6.985596493021 eV :: ::.................................................:: :: SCC energy -5.314427737259 Eh :: :: -> isotropic ES 0.014765319486 Eh :: :: -> anisotropic ES -0.002096930954 Eh :: :: -> anisotropic XC -0.000223642105 Eh :: :: -> dispersion -0.000321892002 Eh :: :: repulsion energy 0.041454481891 Eh :: :: add. restraining 0.000000000000 Eh :: :: total charge -0.000000000000 e :: ::::::::::::::::::::::::::::::::::::::::::::::::::::: ------------------------------------------------- | Property Printout | ------------------------------------------------- * Orbital Energies and Occupations # Occupation Energy/Eh Energy/eV ------------------------------------------------------------- 1 2.0000 -0.7141239 -19.4323 2 2.0000 -0.5902729 -16.0621 3 2.0000 -0.5902729 -16.0621 4 2.0000 -0.5096717 -13.8689 5 1.0000 -0.0354997 -0.9660 (HOMO) 6 0.2212163 6.0196 (LUMO) 7 0.2212163 6.0196 ------------------------------------------------------------- HL-Gap 0.2567159 Eh 6.9856 eV Fermi-level -0.0898637 Eh -2.4453 eV # Z covCN q C6AA α(0) 1 8 O 2.407 -0.428 21.345 6.240 2 1 H 0.802 0.143 1.469 1.904 3 1 H 0.802 0.143 1.469 1.904 4 1 H 0.802 0.143 1.469 1.904 Mol. C6AA /au·bohr⁶ : 67.533629 Mol. C8AA /au·bohr⁸ : 1105.504428 Mol. α(0) /au : 11.951096 Wiberg/Mayer (AO) data. largest (>0.10) Wiberg bond orders for each atom --------------------------------------------------------------------------- # Z sym total # sym WBO # sym WBO # sym WBO --------------------------------------------------------------------------- 1 8 O 2.150 -- 3 H 0.717 2 H 0.717 4 H 0.717 2 1 H 0.920 -- 1 O 0.717 4 H 0.102 3 H 0.102 3 1 H 0.920 -- 1 O 0.717 4 H 0.102 2 H 0.102 4 1 H 0.920 -- 1 O 0.717 2 H 0.102 3 H 0.102 --------------------------------------------------------------------------- Topologies differ in total number of bonds Writing topology from bond orders to xtbtopo.mol molecular dipole: x y z tot (Debye) q only: 0.133 0.133 0.133 full: 0.178 0.178 0.178 0.784 molecular quadrupole (traceless): xx xy yy xz yz zz q only: 0.000 -0.182 0.000 -0.182 -0.182 -0.000 q+dip: 0.000 -0.123 0.000 -0.123 -0.123 -0.000 full: 0.000 -0.284 0.000 -0.284 -0.284 -0.000 ------------------------------------------------- | TOTAL ENERGY -5.272973255368 Eh | | GRADIENT NORM 0.401699536387 Eh/α | | HOMO-LUMO GAP 6.985596493021 eV | ------------------------------------------------- ------------------------------------------------------------------------ * finished run on 2024/09/20 at 14:00:03.301 ------------------------------------------------------------------------ total: * wall-time: 0 d, 0 h, 0 min, 0.042 sec * cpu-time: 0 d, 0 h, 0 min, 0.578 sec * ratio c/w: 13.870 speedup SCF: * wall-time: 0 d, 0 h, 0 min, 0.025 sec * cpu-time: 0 d, 0 h, 0 min, 0.382 sec * ratio c/w: 15.043 speedup ```
Output with given UHF information ``` ----------------------------------------------------------- | ===================== | | x T B | | ===================== | | S. Grimme | | Mulliken Center for Theoretical Chemistry | | University of Bonn | ----------------------------------------------------------- * xtb version 6.7.1 (edcfbbe) compiled by 'albert@albert-system' on 2024-07-22 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 2024/09/20 at 14:00:17.801 ID Z sym. atoms 1 8 O 1 2 1 H 2-4 ------------------------------------------------- | Calculation Setup | ------------------------------------------------- program call : xtb struc.xyz --uhf 1 hostname : fs7 coordinate file : struc.xyz omp threads : 16 ------------------------------------------------- | G F N 2 - x T B | ------------------------------------------------- Reference 10.1021/acs.jctc.8b01176 * Hamiltonian: H0-scaling (s, p, d) 1.850000 2.230000 2.230000 zeta-weighting 0.500000 * Dispersion: s8 2.700000 a1 0.520000 a2 5.000000 s9 5.000000 * Repulsion: kExp 1.500000 1.000000 rExp 1.000000 * Coulomb: alpha 2.000000 third order shell-resolved anisotropic true a3 3.000000 a5 4.000000 cn-shift 1.200000 cn-exp 4.000000 max-rad 5.000000 ................................................... : SETUP : :.................................................: : # basis functions 7 : : # atomic orbitals 7 : : # shells 5 : : # electrons 9 : : max. iterations 250 : : Hamiltonian GFN2-xTB : : restarted? false : : GBSA solvation false : : PC potential false : : electronic temp. 300.0000000 K : : accuracy 1.0000000 : : -> integral cutoff 0.2500000E+02 : : -> integral neglect 0.1000000E-07 : : -> SCF convergence 0.1000000E-05 Eh : : -> wf. convergence 0.1000000E-03 e : : Broyden damping 0.4000000 : : net charge 0 : : unpaired electrons 1 : ................................................... iter E dE RMSdq gap omega full diag 1 -5.3100896 -0.531009E+01 0.370E+00 7.10 0.0 T 2 -5.3139697 -0.388014E-02 0.205E+00 7.03 1.0 T 3 -5.3143846 -0.414920E-03 0.484E-01 6.97 1.0 T 4 -5.3144274 -0.427168E-04 0.194E-02 6.98 2.6 T 5 -5.3144277 -0.382685E-06 0.288E-03 6.99 17.3 T 6 -5.3144277 -0.366471E-08 0.700E-04 6.99 71.5 T 7 -5.3144277 -0.270234E-09 0.225E-06 6.99 22232.1 T *** convergence criteria satisfied after 7 iterations *** # Occupation Energy/Eh Energy/eV ------------------------------------------------------------- 1 2.0000 -0.7141239 -19.4323 2 2.0000 -0.5902729 -16.0621 3 2.0000 -0.5902729 -16.0621 4 2.0000 -0.5096717 -13.8689 5 1.0000 -0.0354997 -0.9660 (HOMO) 6 0.2212163 6.0196 (LUMO) 7 0.2212163 6.0196 ------------------------------------------------------------- HL-Gap 0.2567159 Eh 6.9856 eV Fermi-level -0.0898637 Eh -2.4453 eV SCC (total) 0 d, 0 h, 0 min, 0.025 sec SCC setup ... 0 min, 0.000 sec ( 1.855%) Dispersion ... 0 min, 0.000 sec ( 1.729%) classical contributions ... 0 min, 0.000 sec ( 0.455%) integral evaluation ... 0 min, 0.000 sec ( 1.701%) iterations ... 0 min, 0.023 sec ( 91.178%) molecular gradient ... 0 min, 0.000 sec ( 1.322%) printout ... 0 min, 0.000 sec ( 1.511%) ::::::::::::::::::::::::::::::::::::::::::::::::::::: :: SUMMARY :: ::::::::::::::::::::::::::::::::::::::::::::::::::::: :: total energy -5.272973255368 Eh :: :: gradient norm 0.401699536387 Eh/a0 :: :: HOMO-LUMO gap 6.985596493021 eV :: ::.................................................:: :: SCC energy -5.314427737259 Eh :: :: -> isotropic ES 0.014765319486 Eh :: :: -> anisotropic ES -0.002096930954 Eh :: :: -> anisotropic XC -0.000223642105 Eh :: :: -> dispersion -0.000321892002 Eh :: :: repulsion energy 0.041454481891 Eh :: :: add. restraining 0.000000000000 Eh :: :: total charge -0.000000000000 e :: ::::::::::::::::::::::::::::::::::::::::::::::::::::: ------------------------------------------------- | Property Printout | ------------------------------------------------- * Orbital Energies and Occupations # Occupation Energy/Eh Energy/eV ------------------------------------------------------------- 1 2.0000 -0.7141239 -19.4323 2 2.0000 -0.5902729 -16.0621 3 2.0000 -0.5902729 -16.0621 4 2.0000 -0.5096717 -13.8689 5 1.0000 -0.0354997 -0.9660 (HOMO) 6 0.2212163 6.0196 (LUMO) 7 0.2212163 6.0196 ------------------------------------------------------------- HL-Gap 0.2567159 Eh 6.9856 eV Fermi-level -0.0898637 Eh -2.4453 eV # Z covCN q C6AA α(0) 1 8 O 2.407 -0.428 21.345 6.240 2 1 H 0.802 0.143 1.469 1.904 3 1 H 0.802 0.143 1.469 1.904 4 1 H 0.802 0.143 1.469 1.904 Mol. C6AA /au·bohr⁶ : 67.533629 Mol. C8AA /au·bohr⁸ : 1105.504428 Mol. α(0) /au : 11.951096 Wiberg/Mayer (AO) data. largest (>0.10) Wiberg bond orders for each atom --------------------------------------------------------------------------- # Z sym total # sym WBO # sym WBO # sym WBO --------------------------------------------------------------------------- 1 8 O 2.150 -- 3 H 0.717 2 H 0.717 4 H 0.717 2 1 H 0.920 -- 1 O 0.717 4 H 0.102 3 H 0.102 3 1 H 0.920 -- 1 O 0.717 4 H 0.102 2 H 0.102 4 1 H 0.920 -- 1 O 0.717 2 H 0.102 3 H 0.102 --------------------------------------------------------------------------- Topologies differ in total number of bonds Writing topology from bond orders to xtbtopo.mol molecular dipole: x y z tot (Debye) q only: 0.133 0.133 0.133 full: 0.178 0.178 0.178 0.784 molecular quadrupole (traceless): xx xy yy xz yz zz q only: 0.000 -0.182 0.000 -0.182 -0.182 -0.000 q+dip: 0.000 -0.123 0.000 -0.123 -0.123 -0.000 full: 0.000 -0.284 0.000 -0.284 -0.284 -0.000 ------------------------------------------------- | TOTAL ENERGY -5.272973255368 Eh | | GRADIENT NORM 0.401699536387 Eh/α | | HOMO-LUMO GAP 6.985596493021 eV | ------------------------------------------------- ------------------------------------------------------------------------ * finished run on 2024/09/20 at 14:00:17.887 ------------------------------------------------------------------------ total: * wall-time: 0 d, 0 h, 0 min, 0.085 sec * cpu-time: 0 d, 0 h, 0 min, 1.220 sec * ratio c/w: 14.362 speedup SCF: * wall-time: 0 d, 0 h, 0 min, 0.026 sec * cpu-time: 0 d, 0 h, 0 min, 0.391 sec * ratio c/w: 14.900 speedup ```
Output with given charge information ``` ----------------------------------------------------------- | ===================== | | x T B | | ===================== | | S. Grimme | | Mulliken Center for Theoretical Chemistry | | University of Bonn | ----------------------------------------------------------- * xtb version 6.7.1 (edcfbbe) compiled by 'albert@albert-system' on 2024-07-22 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 2024/09/20 at 14:05:38.957 ID Z sym. atoms 1 8 O 1 2 1 H 2-4 ------------------------------------------------- | Calculation Setup | ------------------------------------------------- program call : xtb struc.xyz --chrg 1 hostname : fs7 coordinate file : struc.xyz omp threads : 16 ------------------------------------------------- | G F N 2 - x T B | ------------------------------------------------- Reference 10.1021/acs.jctc.8b01176 * Hamiltonian: H0-scaling (s, p, d) 1.850000 2.230000 2.230000 zeta-weighting 0.500000 * Dispersion: s8 2.700000 a1 0.520000 a2 5.000000 s9 5.000000 * Repulsion: kExp 1.500000 1.000000 rExp 1.000000 * Coulomb: alpha 2.000000 third order shell-resolved anisotropic true a3 3.000000 a5 4.000000 cn-shift 1.200000 cn-exp 4.000000 max-rad 5.000000 ................................................... : SETUP : :.................................................: : # basis functions 7 : : # atomic orbitals 7 : : # shells 5 : : # electrons 8 : : max. iterations 250 : : Hamiltonian GFN2-xTB : : restarted? false : : GBSA solvation false : : PC potential false : : electronic temp. 300.0000000 K : : accuracy 1.0000000 : : -> integral cutoff 0.2500000E+02 : : -> integral neglect 0.1000000E-07 : : -> SCF convergence 0.1000000E-05 Eh : : -> wf. convergence 0.1000000E-03 e : : Broyden damping 0.4000000 : : net charge 1 : : unpaired electrons 0 : ................................................... iter E dE RMSdq gap omega full diag 1 -5.1294864 -0.512949E+01 0.378E+00 13.78 0.0 T 2 -5.1296062 -0.119726E-03 0.221E+00 13.81 1.0 T 3 -5.1296411 -0.349585E-04 0.108E-01 13.80 1.0 T 4 -5.1296460 -0.490727E-05 0.500E-02 13.82 1.0 T 5 -5.1296469 -0.864700E-06 0.126E-02 13.84 4.0 T 6 -5.1296470 -0.124465E-06 0.107E-03 13.84 46.8 T 7 -5.1296470 -0.540671E-09 0.657E-04 13.84 76.1 T 8 -5.1296470 -0.320446E-09 0.115E-07 13.84 100000.0 T *** convergence criteria satisfied after 8 iterations *** # Occupation Energy/Eh Energy/eV ------------------------------------------------------------- 1 2.0000 -1.0373177 -28.2269 2 2.0000 -0.9196723 -25.0256 3 2.0000 -0.9196723 -25.0256 4 2.0000 -0.8447081 -22.9857 (HOMO) 5 -0.3361102 -9.1460 (LUMO) 6 -0.0811680 -2.2087 7 -0.0811680 -2.2087 ------------------------------------------------------------- HL-Gap 0.5085979 Eh 13.8397 eV Fermi-level -0.5904091 Eh -16.0659 eV SCC (total) 0 d, 0 h, 0 min, 0.022 sec SCC setup ... 0 min, 0.001 sec ( 2.562%) Dispersion ... 0 min, 0.000 sec ( 0.264%) classical contributions ... 0 min, 0.000 sec ( 0.108%) integral evaluation ... 0 min, 0.000 sec ( 0.855%) iterations ... 0 min, 0.021 sec ( 93.156%) molecular gradient ... 0 min, 0.001 sec ( 2.266%) printout ... 0 min, 0.000 sec ( 0.551%) ::::::::::::::::::::::::::::::::::::::::::::::::::::: :: SUMMARY :: ::::::::::::::::::::::::::::::::::::::::::::::::::::: :: total energy -5.088192529146 Eh :: :: gradient norm 0.000115842468 Eh/a0 :: :: HOMO-LUMO gap 13.839654468085 eV :: ::.................................................:: :: SCC energy -5.129647011038 Eh :: :: -> isotropic ES 0.148431073889 Eh :: :: -> anisotropic ES -0.007425341924 Eh :: :: -> anisotropic XC 0.000904262657 Eh :: :: -> dispersion -0.000146840883 Eh :: :: repulsion energy 0.041454481891 Eh :: :: add. restraining 0.000000000000 Eh :: :: total charge 1.000000000000 e :: ::::::::::::::::::::::::::::::::::::::::::::::::::::: ------------------------------------------------- | Property Printout | ------------------------------------------------- * Orbital Energies and Occupations # Occupation Energy/Eh Energy/eV ------------------------------------------------------------- 1 2.0000 -1.0373177 -28.2269 2 2.0000 -0.9196723 -25.0256 3 2.0000 -0.9196723 -25.0256 4 2.0000 -0.8447081 -22.9857 (HOMO) 5 -0.3361102 -9.1460 (LUMO) 6 -0.0811680 -2.2087 7 -0.0811680 -2.2087 ------------------------------------------------------------- HL-Gap 0.5085979 Eh 13.8397 eV Fermi-level -0.5904091 Eh -16.0659 eV # Z covCN q C6AA α(0) 1 8 O 2.407 -0.314 19.201 5.918 2 1 H 0.802 0.438 0.421 1.019 3 1 H 0.802 0.438 0.421 1.019 4 1 H 0.802 0.438 0.421 1.019 Mol. C6AA /au·bohr⁶ : 39.727751 Mol. C8AA /au·bohr⁸ : 694.720396 Mol. α(0) /au : 8.975319 Wiberg/Mayer (AO) data. largest (>0.10) Wiberg bond orders for each atom --------------------------------------------------------------------------- # Z sym total # sym WBO # sym WBO # sym WBO --------------------------------------------------------------------------- 1 8 O 2.424 -- 3 H 0.808 2 H 0.808 4 H 0.808 2 1 H 0.808 -- 1 O 0.808 3 1 H 0.808 -- 1 O 0.808 4 1 H 0.808 -- 1 O 0.808 --------------------------------------------------------------------------- Topologies differ in total number of bonds Writing topology from bond orders to xtbtopo.mol molecular dipole: x y z tot (Debye) q only: 0.647 0.647 0.647 full: 0.761 0.761 0.761 3.349 molecular quadrupole (traceless): xx xy yy xz yz zz q only: -0.000 -0.472 -0.000 -0.472 -0.472 0.000 q+dip: -0.000 -0.620 -0.000 -0.620 -0.620 0.000 full: -0.000 -0.650 -0.000 -0.650 -0.650 0.000 ------------------------------------------------- | TOTAL ENERGY -5.088192529146 Eh | | GRADIENT NORM 0.000115842468 Eh/α | | HOMO-LUMO GAP 13.839654468085 eV | ------------------------------------------------- ------------------------------------------------------------------------ * finished run on 2024/09/20 at 14:05:39.036 ------------------------------------------------------------------------ total: * wall-time: 0 d, 0 h, 0 min, 0.078 sec * cpu-time: 0 d, 0 h, 0 min, 0.980 sec * ratio c/w: 12.601 speedup SCF: * wall-time: 0 d, 0 h, 0 min, 0.023 sec * cpu-time: 0 d, 0 h, 0 min, 0.340 sec * ratio c/w: 15.090 speedup ```

Expected behaviour I would at least expect that the number of unpaired electrons is adjusted in the output and ideally a warning should be printed. In ORCA these calculations would immediately crash so that users do not obtain misleading results.

marcelmbn commented 1 month ago

Just tested the example case and can confirm.

IMHO, there are two ways to proceed here:

In general (for both approaches): Fix the output for unpaired electrons so that it corresponds to what is actually happening during the calculation (here: 1).

  1. Raise an error if either the assigned UHF number cannot agree with the total number of electrons (from geometry and net charge), and exit the calculation.
  2. Just raise a big warning and proceed with the best assumption (if a UHF information is not given), and start the calculation (here with UHF=1). If UHF is explicitly given and it does not match to the total number of electrons, raise an error (and stop) anyway.

What's your take on this, @gasevic @cplett @Albkat? Just mentioned some names to detect potential errors with typical applications if we change the procedure of such a fundamental functionality.

gasevic commented 1 month ago

It is probably more user-friendly to stop the calculation as a faulty input is given but I am fine with both approaches.

marcelmbn commented 1 month ago

After discussing this issue again with @cplett, we have decided to correct the unpaired electrons printout, and additionally raise and print a big warning to alert the user of a (possibly unintentional) changed calculation setup. Justification:

awvwgk commented 1 month ago

In the tblite we decided to stop a calculation in case we discover a mismatch regarding unpaired electrons and total number of electrons:

https://github.com/tblite/tblite/blob/36ff0cd9064138fe5e59e45190710522865a4c3a/src/tblite/xtb/singlepoint.f90#L145-L150