Divid by zero in matrix inverse

Bader charge density analysis

Moderator: moderators

Post Reply
L. Matthes
Posts: 8
Joined: Mon May 09, 2011 9:59 am

Divid by zero in matrix inverse

Post by L. Matthes »

Dear developers,

recently I used your new Beta version 0.95, basically to check out your new weight method with VASP.
However, already before I could try I encountered a strange new error, which did not occur in version 0.28.
The error message is:
Divid by zero in matrix inverse

Some details about my system:
HBC (isolated) molecule (large vacuum), kind of a snowflake molecule
Reading in the charge densities is no problem
I have no clue what part of the program causes this issue

Best regards
Lars
graeme
Site Admin
Posts: 2276
Joined: Tue Apr 26, 2005 4:25 am
Contact:

Re: Divid by zero in matrix inverse

Post by graeme »

Ah, thanks for the note. If you can post or send me the charge density file, I'll see if I can fix this asap. There is some matrix math related to calculating the cross-sectional area between Voronoi cells. I suspect either (i) a bug or (ii) a special case that needs to be specifically considered.

The weight method was developed some time ago by Yu and Trinkle [J. Chem. Phys. 134, 064111 (2011)]. It just took us a while to implement it.
L. Matthes
Posts: 8
Joined: Mon May 09, 2011 9:59 am

Re: Divid by zero in matrix inverse

Post by L. Matthes »

Thank you for your reply. The files are comparable large. I'll send the files asap.

Best regards
Lars
L. Matthes
Posts: 8
Joined: Mon May 09, 2011 9:59 am

Re: Divid by zero in matrix inverse

Post by L. Matthes »

Here are the files. I usually use my own program to sum the charge densities AECCAR0 and AECCAR2. My program also led to another minor "bug" in v0.28 which occurred due to the usage of atomic coordinates in double precision, which could not be read correctly by your Bader analysis tool.

https://upload.uni-jena.de/data/569f7cf ... AR0.tar.gz
https://upload.uni-jena.de/data/569f7d1 ... AR2.tar.gz
https://upload.uni-jena.de/data/569f7d2 ... CAR.tar.gz
https://upload.uni-jena.de/data/569f7d2 ... sum.tar.gz

Best regards
Lars
graeme
Site Admin
Posts: 2276
Joined: Tue Apr 26, 2005 4:25 am
Contact:

Re: Divid by zero in matrix inverse

Post by graeme »

Looking at your files I can tell that the immediate problem is the formatting of the lattice vectors in your CHGCAR_sum file. Both VASP and our bader code use the same fortran fixed-format interpretation of those values. Specifically, the expected format for the lattice vectors in a CHGCAR are given by:

READ(100,'(3F13.6)') (ions%lattice(i,1:3) , i=1,3)

When I read a CHGCAR_sum generated by our script (chgsumf.pl) into the bader analysis program I see a correct set of lattice vectors:

21.650625000000002 21.650625000000002 0.0000000000000000
-12.500000000000000 12.500000000000000 0.0000000000000000
0.0000000000000000 0.0000000000000000 15.000000000000000

When I read the lattice vectors from your file I get:

21.650500000000001 21.650500000000001 0.0000000000000000
125000.00000000000 125000.00000000000 0.0000000000000000
-12.500000000000000 12.500000000000000 0.0000000000000000

Before we try to sort out any problems regarding the weight method, I think we need to have lattice vectors written the format the vasp writes them. You can use our chgsum.pl, or for a more accurate fortran formatting, our chgsumf.pl script to generate the CHGCAR_sum file.
L. Matthes
Posts: 8
Joined: Mon May 09, 2011 9:59 am

Re: Divid by zero in matrix inverse

Post by L. Matthes »

Well, I guess you are right. Using the script chgcarsum.pl seems to work and I get the charges with the old and new method.
Thank you for your efforts and hopefully the weight method overcomes the slow convergence with repsect to the number of grid points, which is quite painful for isolated molecules.

Best regards
Lars
Post Reply