Page 1 of 1

Periodic Boundary Conditions

Posted: Thu Jul 19, 2012 10:12 pm
by deniz
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

Re: Periodic Boundary Conditions

Posted: Fri Jul 20, 2012 8:02 am
by graeme
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

Posted: Sat Jul 21, 2012 10:10 pm
by deniz
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.

Re: Periodic Boundary Conditions

Posted: Sun Jul 22, 2012 1:43 am
by graeme
Ah, I see the problem, the upload should work now.

Re: Periodic Boundary Conditions

Posted: Mon Jul 23, 2012 2:36 pm
by deniz
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

Re: Periodic Boundary Conditions

Posted: Tue Jul 24, 2012 4:49 pm
by graeme
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.

Re: Periodic Boundary Conditions

Posted: Mon Jul 30, 2012 7:41 pm
by deniz
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

Re: Periodic Boundary Conditions

Posted: Fri Aug 03, 2012 2:15 am
by graeme
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

Posted: Fri Aug 03, 2012 3:37 pm
by deniz
Thanks a lot Prof Henkelman.

The issue has been fixed. It turned out to be a row major vs colum major array indexing issue.