BADER analysis on vdW calculations in SIESTA

Bader charge density analysis

Moderator: moderators

Post Reply
mohataba
Posts: 9
Joined: Tue Jan 03, 2017 9:55 am

BADER analysis on vdW calculations in SIESTA

Post by mohataba »

Dear all,

I have used vdW pseudos to calculate Adenine adsorption on monolayer MoS2 in SIESTA. To calculate the charge transfer, I have used the useful bader code from "http://theory.cm.utexas.edu/henkelman/code/bader/". I actually used the recommendation in SIESTA manual as "bader Mysys.RHO.cube -ref Mysys.BADER.cube".

Interestingly, I get no errors when I use "-vac off" in my command (turning off vacuum charges) but I get lots of errors when I do not use "-vac off" (turning on vacuum charges).

My errors are like this:
Error: Should be no new maxima in edge refinement

I have also read "viewtopic.php?t=2417" but that does not hold in my case.

My "NUMBER OF BADER MAXIMA FOUND" is also much larger than the 90 atoms I have in my system. I would be really grateful if anyone helps me to fix this problem. Using a command like "bader Mysys.RHO.cube" also ends with no errors but gives a very high value for "NUMBER OF BADER MAXIMA FOUND". Is it conceptually OK that I go with the results I get with "-vac off" or without "-ref"? Which one do you suggest?

Isn't this problem related to my use of vdW pseudos?

Thank you in advance for your help.

Here I have illustered how my attached files are generated.

*_wref* : bader Mysys.RHO.cube -ref Mysys.BADER.cube > wref_stdout
*_wref_vacoff* : bader Mysys.RHO.cube -ref Mysys.BADER.cube > wref_vacoff_stdout
Attachments
RHO and BADER.zip
(19.64 MiB) Downloaded 1410 times
ACF and stdout.zip
(8.12 KiB) Downloaded 1348 times
Last edited by mohataba on Fri Jan 06, 2017 11:23 am, edited 1 time in total.
graeme
Site Admin
Posts: 2290
Joined: Tue Apr 26, 2005 4:25 am
Contact:

Re: BADER analysis on vdW calculations in SIESTA

Post by graeme »

The "-vac off" flag should maybe be the default setting. With this flag, the entire charge density is analyzed. The idea behind assigning a vacuum region is that there can be large portions of the file with a very low charge density which can essentially be safely ignored. The warning about new charge density maxima upon refinement can be ignored when you have vacuum charge - that warning was introduced for when the entire charge was analyzed and there was no possibility for new charge density maxima showing up when the boundary of the Bader volumes was refined. You should not see a significant difference in your results with or without the "-vac off" flag.

The -ref option is very important. For a proper analyze, you really need to have the total charge density including the core charge. However, since it is difficult to properly resolve the cusps in the total charge we suggest doing the partitioning on the total charge and the integration just one the valance charge. The total charge is expected (in almost all cases) to have a single charge density maximum at each atomic center. Then, the number of Bader maxima found should be the number of atoms. If you just analyze the valence charge, you can find more Bader maxima and for many elements a non-physical atomic charges. One caveat to this is that there can be many small maxima in the vacuum region just due to charge fluctuations from the calculation. If you look in the BCF.dat file, you may find many near-zero Bader volumes. In the ACF.dat file, these are all assigned to the nearest atom.

So in summary, you want to do "bader -vac off Mysys.RHO.cube -ref Mysys.BADER.cube" where Mysys.RHO.cube is the valence density and Mysys.BADER.cube is the total density. You should get essentially the same results in the ACF.dat file using "bader Mysys.RHO.cube -ref Mysys.BADER.cube", and ignore the warnings.
mohataba
Posts: 9
Joined: Tue Jan 03, 2017 9:55 am

Re: BADER analysis on vdW calculations in SIESTA

Post by mohataba »

Thank you very much for your instant reply. I still would be really thankful if you elaborate more on this. I should note here that I have used 300 Ry cut-off energy in my SIESTA calculations and my supercells are not cubic (I am still able to convert my SIESTA outputs to .cube files using "g2c_ng" distributed by SIESTA). Specifically:

1-Based on my understanding, you said that I should adopt the "-vac off" flag as default from now on and it would do NO harm to my results. Is my understanding correct? Is it only a recommendation that applies to my case or is it general?

2-Based on my understanding, you said that I should worry about the "Error: Should be no new maxima in edge refinement" ONLY when I use "-vac off". Since I get the "Error: Should be no new maxima in edge refinement" ONLY WHEN I DO NOT USE "-vac off", I should safely ignore this error and treat it as a negligible warning. Hence, my results WITHOUT "-vac off" in which the error happens are equally reliable as my results WITH "-vac off". Is my understanding correct?

3-Evidently, my previously attached .ACF files for "bader -vac off Mysys.RHO.cube -ref Mysys.BADER.cube" and "bader Mysys.RHO.cube -ref Mysys.BADER.cube" are different. The difference is quite drastic for the first 25 Mo atoms for which I get 0.00000 charge by using "bader Mysys.RHO.cube -ref Mysys.BADER.cube". Not all of my Mo atoms behave in this way. What is your educated opinion on this? The MIN DIST and ATOMIC VOL in the .ACF output file are also zero for these Mo atoms.

4-Also, the NUMBER OF ELECTRONS is 500.0028 for "bader -vac off Mysys.RHO.cube -ref Mysys.BADER.cube" and 383.6360 for "bader Mysys.RHO.cube -ref Mysys.BADER.cube" plus 1.0261 of VACUUM CHARGE in the latter case. Isn't this drastic difference important? The number of valence electrons in my system is 500 so without "-vac off", a noticeable amount of charge is missing (383.6360+1.0261=384.6621 is much smaller than 500).

5-My "NUMBER OF BADER MAXIMA FOUND" is also much larger than the 90 atoms I have in my system. I would be really grateful if you help me to fix this problem. Is it really a problem? For example, I get NUMBER OF BADER MAXIMA FOUND: 1671 when I use "bader Mysys.RHO.cube -ref Mysys.BADER.cube". How can I resolve this issue?

6-I also tried "bader -b weight Mysys.RHO.cube -ref Mysys.BADER.cube" but no .ACF file is written as a result. I would be really grateful if you guide me on this. I saw in "viewtopic.php?f=1&t=2&p=7751#p7751" that you have said:

"There should be no downside to this method. The output will be more accurate due to a partial assignment of charge to bader volumes at the boundary volumes."

Thank you in advance for your precious help and sorry for many questions.

Bests,
Last edited by mohataba on Thu Jan 12, 2017 12:05 pm, edited 1 time in total.
graeme
Site Admin
Posts: 2290
Joined: Tue Apr 26, 2005 4:25 am
Contact:

Re: BADER analysis on vdW calculations in SIESTA

Post by graeme »

The "bader -vac off Mysys.RHO.cube -ref Mysys.BADER.cube" calculation look ok, but there appears to be something going wrong with the "bader Mysys.RHO.cube -ref Mysys.BADER.cube" calculation. I'll look into it.

To answer the other questions:

1. yes, no downside to -vac off except computation time, particularly for the weight method

2. Yes, but let me get to the bottom of the problem that you found. This warning may be a result of some other problem, such as how the files are being read.

3-4. related to the problem under investigation

5. if you just run "bader Mysys.RHO.cube" and "bader Mysys.BADER.cube" you will see that the number of maxima will change significantly if you add the -vac off flag. The number of significant maxima, however, remains the same (see data below). The fact that there are so many significant maxima in your Mysys.Bader.cube file indicates to me that there is some roughness in that total charge density. This is consistent with the many bader maxima reported in the BCF.dat file.

6. I'll look into the weight method once I understand the present issue since they are likely related.
mohataba
Posts: 9
Joined: Tue Jan 03, 2017 9:55 am

Re: BADER analysis on vdW calculations in SIESTA

Post by mohataba »

Thank you very much for your sincere support. I am really indebted.
graeme
Site Admin
Posts: 2290
Joined: Tue Apr 26, 2005 4:25 am
Contact:

Re: BADER analysis on vdW calculations in SIESTA

Post by graeme »

The core charge is indeed very fragmented near the S and Mo core (see attached picture). This will lead to a Bader maximum at each of the blue islands (plotted in vesta with an isosurface cutoff of 0.2). There are similar problems at all the atomic cores.
fragmented_cores.tiff
fragmented_cores.tiff (352.59 KiB) Viewed 44593 times
mohataba
Posts: 9
Joined: Tue Jan 03, 2017 9:55 am

Re: BADER analysis on vdW calculations in SIESTA

Post by mohataba »

Sorry, but I have no idea whether this is considered a problem or not. Please guide me on how to deal with it.
graeme
Site Admin
Posts: 2290
Joined: Tue Apr 26, 2005 4:25 am
Contact:

Re: BADER analysis on vdW calculations in SIESTA

Post by graeme »

Here is another view of the fragmented core charge. This is not nessecarily a problem for the final analysis, but it does explain the large number of Bader maxima and all the edge refining.
fragmented_cores2.tiff
fragmented_cores2.tiff (120.92 KiB) Viewed 44592 times
mohataba
Posts: 9
Joined: Tue Jan 03, 2017 9:55 am

Re: BADER analysis on vdW calculations in SIESTA

Post by mohataba »

One issue is still remaining and that is about zero charges for Mo atoms when using "bader Mysys.RHO.cube -ref Mysys.BADER.cube". Does fragmented core charges also account for this? What is the origin of this fragmented charges? Do they come from the vdW density functional I have used?
mohataba
Posts: 9
Joined: Tue Jan 03, 2017 9:55 am

Re: BADER analysis on vdW calculations in SIESTA

Post by mohataba »

I am really sorry. I have checked my files with VESTA. Indeed I have no negative values in my Mysys.RHO.cube file. However, I have negative values in my Mysys.BADER.cube file.

Also, for atoms #76,77,78, 80 in the .ACF file generated by using "-vac off", the numbers in columns MIN DIST & ATOMIC VOL are touching. Why does this happen? Is the charge calculated in these columns reliable?
Last edited by mohataba on Thu Jan 12, 2017 12:07 pm, edited 1 time in total.
mohataba
Posts: 9
Joined: Tue Jan 03, 2017 9:55 am

Re: BADER analysis on vdW calculations in SIESTA

Post by mohataba »

Dear all,

I would be really grateful if you help me about the above issues.

Bests,
graeme
Site Admin
Posts: 2290
Joined: Tue Apr 26, 2005 4:25 am
Contact:

Re: BADER analysis on vdW calculations in SIESTA

Post by graeme »

The problems are related primarily to the poor quality of your Mysys.Bader.cube file. The zero charges are for H atoms neighboring N atom, and looking at the Mysys.Bader.cube shows no charge density maximum at those H atoms. But if you are content with treating the N-H groups as a single unit, you can still determine partial charges and charge transfer to the surface (if that is what you are interested in). Perhaps the SIESTA team can help with generating a better total charge density. Overall though, I don't see any problem related to how the Bader analysis algorithm is functioning.

The formatting of the ACF.dat output, and specifically the lack of room to print large volume values, does not effect the calculation. I've changed the formatting in the code so it will print better in the next release.
graeme
Site Admin
Posts: 2290
Joined: Tue Apr 26, 2005 4:25 am
Contact:

Re: BADER analysis on vdW calculations in SIESTA

Post by graeme »

Your test case showed a problem in the code. Specifically, the vacuum criterion was based upon the valence charge density instead of the total charge density. I will upload a new version right now. This should correct the problems that you saw with different results with and without the "-vac off". In my test, the ERROR messages, and the low total charge problem using the default "bader Mysys.RHO.cube -ref Mysys.BADER.cube" are fixed.

The output for your files is now:

bader -vac off Mysys.RHO.cube -ref Mysys.BADER.cube

GRID BASED BADER ANALYSIS (Version 0.95a 02/26/16)

OPEN ... Mysys.RHO.cube
GAUSSIAN-STYLE INPUT FILE
DENSITY-GRID: 150 x 216 x 150
CLOSE ... Mysys.RHO.cube
RUN TIME: 1.46 SECONDS

OPEN ... Mysys.BADER.cube
GAUSSIAN-STYLE INPUT FILE
DENSITY-GRID: 150 x 216 x 150
CLOSE ... Mysys.BADER.cube
RUN TIME: 1.49 SECONDS

CALCULATING BADER CHARGE DISTRIBUTION
0 10 25 50 75 100
PERCENT DONE: **********************

REFINING AUTOMATICALLY
ITERATION: 1
EDGE POINTS: 1767046
REASSIGNED POINTS: 321560
ITERATION: 2
CHECKED POINTS: 1611152
REASSIGNED POINTS: 12795
ITERATION: 3
CHECKED POINTS: 149311
REASSIGNED POINTS: 2173
ITERATION: 4
CHECKED POINTS: 29217
REASSIGNED POINTS: 543
ITERATION: 5
CHECKED POINTS: 8553
REASSIGNED POINTS: 183
ITERATION: 6
CHECKED POINTS: 3187
REASSIGNED POINTS: 63
ITERATION: 7
CHECKED POINTS: 1220
REASSIGNED POINTS: 21
ITERATION: 8
CHECKED POINTS: 432
REASSIGNED POINTS: 14
ITERATION: 9
CHECKED POINTS: 251
REASSIGNED POINTS: 9
ITERATION:10
CHECKED POINTS: 166
REASSIGNED POINTS: 6
ITERATION:11
CHECKED POINTS: 128
REASSIGNED POINTS: 4
ITERATION:12
CHECKED POINTS: 87
REASSIGNED POINTS: 3
ITERATION:13
CHECKED POINTS: 44
REASSIGNED POINTS: 0

RUN TIME: 57.92 SECONDS

CALCULATING MINIMUM DISTANCES TO ATOMS
0 10 25 50 75 100
PERCENT DONE: **********************
RUN TIME: 1.04 SECONDS

WRITING BADER ATOMIC CHARGES TO ACF.dat
WRITING BADER VOLUME CHARGES TO BCF.dat

NUMBER OF BADER MAXIMA FOUND: 1968262
SIGNIFICANT MAXIMA FOUND: 1694
VACUUM CHARGE: 0.0000
NUMBER OF ELECTRONS: 500.00284

--------
and the ACF.dat contents
--------

# X Y Z CHARGE MIN DIST ATOMIC VOL
--------------------------------------------------------------------------------
1 0.000960 4.908359 1.619596 4.617416 1.747279 81.692623
2 -3.018630 4.910976 6.852683 4.618009 1.742250 81.882891
3 -6.037277 4.913494 12.077724 4.613122 1.744264 81.232296
4 -9.056099 4.910487 17.303207 4.609506 1.748624 80.913136
5 -12.076255 4.912850 22.531873 4.609478 1.747566 80.986789
6 3.020284 4.911613 6.852807 4.619430 1.741827 82.195913
7 0.000011 4.899292 12.084217 4.607085 1.745685 82.024058
8 -3.014045 4.872665 17.304394 4.598287 1.713660 80.630803
9 -6.037603 4.868861 22.536544 4.594678 1.725404 80.501911
10 -9.057822 4.891342 27.764875 4.605419 1.746671 80.710593
11 6.038653 4.907833 12.077267 4.612180 1.747461 81.305948
12 3.014094 4.869293 17.305941 4.596835 1.726278 80.624665
13 0.003199 4.833188 22.540471 4.590229 1.737807 81.072716
14 -3.016622 4.872422 27.763415 4.603420 1.738634 80.833347
15 -6.034667 4.909543 32.987431 4.611630 1.750959 81.275260
16 9.057709 4.902413 17.305936 4.606037 1.750259 80.765832
17 6.041429 4.860032 22.529894 4.588805 1.725141 80.348469
18 3.023915 4.868211 27.759448 4.597200 1.718639 80.943825
19 -0.000249 4.905720 32.985521 4.615411 1.754507 82.490522
20 -3.018260 4.920537 38.215354 4.604816 1.746310 81.220021
21 12.073347 4.904952 22.529537 4.608067 1.753502 80.759694
22 9.060323 4.884466 27.762792 4.607972 1.745085 80.790383
23 6.038358 4.907992 32.989425 4.611555 1.749990 81.398014
24 3.019704 4.922165 38.213607 4.604406 1.726846 82.220464
25 0.000546 4.921243 43.442613 4.605582 1.727170 81.398014
26 0.001167 1.873331 5.110438 6.696550 2.178352 506.389921
27 0.000579 7.948696 5.108067 6.691876 2.192274 389.006644
28 -3.023235 1.870688 10.336471 6.699788 2.178064 504.855499
29 -3.012160 7.949036 10.343489 6.689794 2.197424 353.303715
30 -6.052508 1.861675 15.553144 6.695742 2.175154 473.516466
31 -6.019369 7.940866 15.577998 6.706876 2.196267 241.812619
32 -9.074879 1.860829 20.780768 6.701286 2.174888 471.092079
33 -9.034255 7.941028 20.799283 6.718481 2.190833 223.417969
34 -12.082087 1.866891 26.013655 6.695721 2.173783 479.107899
35 -12.067055 7.944635 26.023777 6.701290 2.189967 270.003018
36 3.021367 1.869164 10.334769 6.700044 2.177813 497.570064
37 3.015197 7.947560 10.346295 6.689350 2.198508 306.749354
38 -0.000662 1.838913 15.550471 6.699223 2.188514 471.595369
39 0.002325 7.926374 15.580892 6.682240 2.188704 190.685680
40 -3.031823 1.818727 20.783728 6.690343 2.205566 462.480903
41 -2.998008 7.876087 20.804212 6.717195 2.185090 154.154163
42 -6.048261 1.838353 26.029512 6.695404 2.204723 463.818919
43 -6.027805 7.910017 26.017454 6.712501 2.162148 175.059128
44 -9.058444 1.866936 31.259457 6.693823 2.186394 493.359610
45 -9.052480 7.944620 31.240614 6.693327 2.181103 293.178927
46 6.051323 1.856520 15.553408 6.697411 2.178812 466.912314
47 6.022615 7.932969 15.578609 6.700093 2.191432 215.629243
48 3.030382 1.812190 20.781843 6.694497 2.208652 468.514250
49 3.004949 7.871810 20.805928 6.690154 2.150076 150.226043
50 0.000258 1.816139 26.041642 6.692192 2.219041 465.911871
51 0.006000 7.888789 26.007197 6.695038 2.225951 155.608795
52 -3.019386 1.856389 31.263172 6.692989 2.196200 481.415670
53 -3.012336 7.941013 31.225286 6.685478 2.167370 244.457962
54 -6.032224 1.876239 36.475998 6.699087 2.171068 500.829176
55 -6.041550 7.951993 36.471687 6.693426 2.187763 346.251512
56 9.076971 1.848347 20.779183 6.697106 2.182159 478.899218
57 9.034494 7.936036 20.797362 6.689449 2.186062 230.979600
58 6.052193 1.830597 26.025546 6.692437 2.207061 461.492735
59 6.037475 7.902564 26.005862 6.710878 2.197187 173.119618
60 3.021520 1.855949 31.264454 6.697460 2.197449 466.390610
61 3.016359 7.936192 31.223011 6.705779 2.188699 225.664362
62 0.000948 1.878455 36.479231 6.696294 2.171995 498.625746
63 -0.000985 7.956780 36.461392 6.696704 2.183428 364.811879
64 -3.011203 1.877141 41.696678 6.703930 2.164437 505.898906
65 -3.028541 7.955142 41.705710 6.693669 2.193767 344.213800
66 12.087111 1.862144 26.014803 6.695553 2.177841 486.767733
67 12.064637 7.938805 26.019723 6.697274 2.183059 281.652349
68 9.060237 1.864081 31.261400 6.697630 2.189748 485.049181
69 9.054048 7.940869 31.236940 6.696216 2.175858 269.039401
70 6.035627 1.877088 36.479334 6.696280 2.172983 497.735781
71 6.042158 7.954380 36.470259 6.698060 2.188325 337.493032
72 3.015193 1.881462 41.696470 6.703004 2.161384 497.766470
73 3.024631 7.957753 41.701879 6.702232 2.192694 338.935388
74 0.002466 1.877606 46.923691 6.700321 2.162793 502.081264
75 -0.005657 7.951800 46.934954 6.701821 2.191833 351.885909
76 3.876229 13.898156 17.774736 0.922881 0.500594 1420.567810
77 -5.155565 13.913314 20.023996 0.503027 0.245401 1073.150137
78 -6.259918 13.989084 24.792059 0.854237 0.567241 1320.683081
79 2.519988 14.096258 27.778693 0.504387 0.229828 980.685873
80 5.502508 14.074932 26.242912 0.458774 0.200574 1154.805934
81 2.618446 13.943865 19.465849 3.100434 0.759822 169.381766
82 -1.240221 13.992479 21.139660 3.195377 0.739283 132.371510
83 -0.284257 13.968393 23.640203 3.685267 0.922452 148.182193
84 2.407123 13.978064 23.862369 3.093428 0.777614 124.502994
85 -4.309120 13.998706 24.028317 3.266091 0.678122 199.014522
86 -2.216106 13.969718 25.427986 5.901237 1.383336 527.288747
87 3.575248 13.974647 26.163893 6.254387 1.209256 368.819789
88 3.837073 13.967603 21.728530 6.064562 1.315951 488.118025
89 -3.844986 14.047981 21.446281 6.117164 1.290172 316.778336
90 0.107655 13.958490 18.965857 6.041698 1.277176 659.175380
--------------------------------------------------------------------------------
VACUUM CHARGE: 0.0000
VACUUM VOLUME: 0.0000
NUMBER OF ELECTRONS: 500.0028

One last comment: I'm not sure what I said was correct about not having charge density maxima on H atoms -- they are being assigned charge in this calculation. These results look reasonable to me, despite the quality of the BADER.cube file.
mohataba
Posts: 9
Joined: Tue Jan 03, 2017 9:55 am

Re: BADER analysis on vdW calculations in SIESTA

Post by mohataba »

Thank you very much for your support.
Post Reply