Hello everyone,
We have our own dft code that I want to interface with Bader. I wrote a simple script that outputs a .cube file for bader to read. The cube file looks ok, but I am getting nonsensical results.
It might be related to boundary conditions. I don't know how boundary conditions are done in bader. We implement periodic bc in our code (meaning x and x + n*T_x are really the same point and the code automatically accouts for translations) . Is that also the case when cube files are read?
Cheers
Deniz
Periodic Boundary Conditions
Moderator: moderators
Re: Periodic Boundary Conditions
We do assume periodic boundaries when reading cube files. But the cube file has a picky format; if you upload an example of your file format, I can see where our cube reader is failing.
Re: Periodic Boundary Conditions
I haven't been able to upload the cube file (its ~4.5 MB). Gives the error: Sorry, the board attachment quota has been reached.
The top of the cube file is (Li2S primitive cell):
#Gaussian cube file generated from output.
#
3 0.0 0.0 0.0
64 0.0 0.0836597501039 0.0836597501039
64 0.0836597501039 0.0 0.0836597501039
64 0.0836597501039 0.0836597501039 0.0
3 0.0 2.67711200332 2.67711200332 2.67711200332
3 0.0 -2.67711200332 -2.67711200332 -2.67711200332
16 0.0 0.0 0.0 0.0
Charge Density data goes here and below...
Thanks a lot.
The top of the cube file is (Li2S primitive cell):
#Gaussian cube file generated from output.
#
3 0.0 0.0 0.0
64 0.0 0.0836597501039 0.0836597501039
64 0.0836597501039 0.0 0.0836597501039
64 0.0836597501039 0.0836597501039 0.0
3 0.0 2.67711200332 2.67711200332 2.67711200332
3 0.0 -2.67711200332 -2.67711200332 -2.67711200332
16 0.0 0.0 0.0 0.0
Charge Density data goes here and below...
Thanks a lot.
Re: Periodic Boundary Conditions
Ah, I see the problem, the upload should work now.
Re: Periodic Boundary Conditions
Here is a cube file that I generated from a Li surface slab. The problem here is more dramatic than that of Li2O. There are 9 layers and the x and y directions have pbc. The bader charges (running with -vac 1e-5) end up only on the two surface atoms (top and bottom of the slab).
I uploaded is as .txt because the forum did not accept a .cube. Just change the file extension.
Thanks a lot
Deniz
I uploaded is as .txt because the forum did not accept a .cube. Just change the file extension.
Thanks a lot
Deniz
- Attachments
-
- Li_100.txt
- (10.48 MiB) Downloaded 1003 times
Re: Periodic Boundary Conditions
It looks to me as if the problem is with core charges. You Li atoms have only 1 electron per atom, and these electrons reside in the bonding regions. The charge density at the atomic cores is actually a minimum, instead of a maximum. If you can include core charges to correctly capture the charge density maxima at the atomic cores, the results should make sense.
I don't see any problem with the reading of the file.
I don't see any problem with the reading of the file.
Re: Periodic Boundary Conditions
I 'added' the core charges by making gaussian chargeballs at the ionic sites. However, I'm still getting an excess amount of charge on the surface atoms. Here is the new cube file: (in .txt form)
Thanks a lot
Deniz
Thanks a lot
Deniz
- Attachments
-
- Li_100.txt
- Gaussian Cube file in .txt
- (10.43 MiB) Downloaded 990 times
Re: Periodic Boundary Conditions
The first cube files looked reasonable, but the second does not. Not only does it contain far too many charge density maxima, it also does not make sense when loaded in VMD. I suspect that something went wrong when the core charges were added.
Re: Periodic Boundary Conditions
Thanks a lot Prof Henkelman.
The issue has been fixed. It turned out to be a row major vs colum major array indexing issue.
The issue has been fixed. It turned out to be a row major vs colum major array indexing issue.