Multiwfn forum

Multiwfn official website: //www.umsyar.com/multiwfn. Multiwfn forum in Chinese: http://bbs.keinsci.com/wfn

You are not logged in.

#12022-02-23 13:36:16

clemens
Member
Registered: 2022-01-25
Posts: 9

Discrepancy in density cube files generated by xTB & Multiwfn

I noticed a discrepancy in the density cube files generated either directly with GFN2-xTB or with Multiwfn from the xtb-created molden.input file. I have provided a detailed description with input files and steps to reproduce on xTB's Github page, since I am not sure on which side (xTB or Multiwfn) this discrepancy originates:
https://github.com/grimme-lab/xtb/issues/586

I'd be thankful for any suggestions as to why this might be happening.

Offline

#22022-02-23 15:30:41

sobereva
Tian Lu (Multiwfn developer)
From: Beijing
Registered: 2017-09-11
Posts: 1,773
Website

Re: Discrepancy in density cube files generated by xTB & Multiwfn

Please use latest version of Multiwfn. Multiwfn 3.7 is already very old, and numerous improvements have been made since its release on 2020-Aug-14.

I checked your molden file, it can be normally loaded into Multiwfn (at least for latest version of Multiwfn). It is important to notice that there is an EDF library embedded in Multiwfn (see Appendix 4 of Multiwfn manual and original paper of EDF library J. Comput. Chem. DOI: 10.1002/jcc.25214 for detail). GFN-xTB calculation doesn't take core electrons into account (like pseudopotential calculations), in this Multiwfn automatically supplies core density represented by a few GTFs based on the EDF library, this is why you can see the following information when Multiwfn loads your file:

Loading electron density functions (EDF) information from built-in EDF library. .. The library is freely available at https://github.com/zorkzou/Molden2AIM O ( 1) Core electrons: 2 EDF primitive GTFs: 19 The number of total inner-core electrons: 2 The number of total EDF primitive GTFs: 19 Loading EDF library finished!

Use of EDF library should be one of the most likely reasons of the discrepancy. If you want to disable this treatment and see if then the discrepancy could be eliminated, you can set "isupplyEDF" in settings.ini of Multiwfn to 0.

BTW: To check if wavefunction has been normally loaded into Multiwfn, you can follow the methods described in Appendix 5 in Multiwfn manual.

Offline

#32022-07-06 12:10:15

clemens
Member
Registered: 2022-01-25
Posts: 9

Re: Discrepancy in density cube files generated by xTB & Multiwfn

Thank you very much for the detailed answer, and apologies for my late reply. I have now tried the suggested steps (using latest version of Multiwfn, 3.8). Interestingly, the difference between xTB and Multiwfn persists also when I set isupplyEDF=0 in settings.ini ("Loading electron density functions..." isn't shown anymore during startup of Multiwfn).

Also, I get the same cube files from Multiwfn independent of whether I set isupplyEDF to 0 or 2 (though the message during startup changes, so the settings.ini file is read correctly). In each case it says that "This file is found to be generated by xtb! Special treatment is applied...", though only if isupplyEDF = 2 it also says "Loading electron density functions (EDF) information from built-in EDF library".

Perhaps the discrepancy is indeed on the xTB side for generating the cube files.

Offline

#42022-07-07 02:46:18

sobereva
Tian Lu (Multiwfn developer)
From: Beijing
Registered: 2017-09-11
Posts: 1,773
Website

Re: Discrepancy in density cube files generated by xTB & Multiwfn

By the way, in Appendix 5 of Multiwfn manual, I described how to check if wavefunction information has been correctly loaded into Multiwfn. If the xtb wavefunction can pass the check (it should be), then the electron density produced by Multiwfn should be 100% correct.

Offline

#52023-01-23 13:56:11

clemens
Member
Registered: 2022-01-25
Posts: 9

Re: Discrepancy in density cube files generated by xTB & Multiwfn

The wavefunction is loaded correctly, according to the checks in Appendix 5.

I noticed that I cannot find all (3, -3) critical points in water following an xTB calculation (starting the search at the atom positions). Looking at the density isosurfaces generated from the cubes files from xTB and Multiwfn respectively (both with isovalue 0.082 in VMD), it seems that the Multiwfn-generated cube file does indeed not have a maximum at the hydrogen nuclei which seems counterintuitive to me (while the xTB-generated one shows maxima). Could search for those (3, -3) critical points with other search parameters be more successful?
Screenshot-2023-01-23-at-14-52-11.png

Last edited by clemens (2023-01-23 13:56:37)

Offline

#62023-01-25 07:12:17

sobereva
Tian Lu (Multiwfn developer)
From: Beijing
Registered: 2017-09-11
Posts: 1,773
Website

Re: Discrepancy in density cube files generated by xTB & Multiwfn

How did you generate electron density .cub file via xtb? I cannot generate it after many attempts using xtb 6.5.1.

Offline

#72023-01-25 10:09:38

clemens
Member
Registered: 2022-01-25
Posts: 9

Re: Discrepancy in density cube files generated by xTB & Multiwfn

I'm using the command "xtb water.sdf --input xtb.inp --molden --verbose" where the xtb.inp file contains a line "density=true" in the "$write" block. A step-by-step procedure is shown here:https://github.com/grimme-lab/xtb/issues/586(the issue I opened in the xTB repo).

Offline

#82023-01-25 10:26:17

sobereva
Tian Lu (Multiwfn developer)
From: Beijing
Registered: 2017-09-11
Posts: 1,773
Website

Re: Discrepancy in density cube files generated by xTB & Multiwfn

Do you know where can I add "cube_step" option in xtb control file to adjust grid spacing of exported cube file? I cannot find a way to make it take effect.

Offline

#92023-01-25 10:55:20

clemens
Member
Registered: 2022-01-25
Posts: 9

Re: Discrepancy in density cube files generated by xTB & Multiwfn

You can use the following:

$write
density=true
$cube
step=0.05

It took me a while to find this as well, buthttps://github.com/grimme-lab/xtb/blob/ … rol.7.adocprovides a good reference.

Offline

#102023-01-26 09:52:34

sobereva
Tian Lu (Multiwfn developer)
From: Beijing
Registered: 2017-09-11
Posts: 1,773
Website

Re: Discrepancy in density cube files generated by xTB & Multiwfn

I guess the electron density cube file exported by xtb is somewhat problematic, or the density is not calculated in common way.

I generated the cube file using the same control file in #9, after loading the cube file into Multiwfn, it can be seen from screen (see below) that the integral is only 5.905, which deviates from expected value 8.0 (6 valence electrons of O and 1 electron of each H) significantly

After multiplied by differential element: 5.9054561225

In contrast, after setting "isupplyEDF" in settings.ini to 0 to avoid providing EDF information, using exactly the same grid definition as the xtb cube file, the integral of the electron density grid data by Multiwfn based on the xtb .molden.input file is 7.991965, which is almost exactly identical to the expected value, indicating that the density calculated by Multiwfn should be correct.

Regarding why there is no (3,-3) corresponding to H of H2O in the topology analysis of Multiwfn, I think this issue is caused by insufficient quality of GFN-xTB wavefunction. Previously, I also occasionally found for other systems that the quality of GFN-xTB wavefunction sometimes is not good enough to perform reliable AIM topology analyses.

Offline

#112023-01-26 14:18:35

clemens
Member
Registered: 2022-01-25
Posts: 9

Re: Discrepancy in density cube files generated by xTB & Multiwfn

Dear Tian, thanks a lot for running those experiments. Good call to check the total # of electrons.

Offline

Board footer

Baidu
map