Menu

total charge incorrect

Elk Users
2020-11-05
2020-11-05
  • Ronald Cohen

    Ronald Cohen - 2020-11-05

    Hello! I am finding that Elk (6.8.4) prints finds the incorrect total charge. At first I thought it was an input problem, or a compiler problem, but I have now tested with a number of systems including examples that come with elk and with different compilers and on different computers and find the same thing. I was not able to find this in the forum, but maybe I missed it? So for example, with the BaTiO3 example using the species files that come with elk, I find in INFO.OUT:EIGVAL.OUT:
      25  0.3179749728      2.000000000   
        26  0.4086095182      0.5155550937E-16
    etc for each k-point. So it should come out with an even number of electrons. If it were a metal the Fermi level should be adjusted to give the correct charge, but we find for Iridium:

    and Pt:

    total calculated charge    :    77.99263752 

    total calculated charge    :    102.0243043 

    whereas the charge should be 102.

    Sometimes the charge is real terrible. For example in the BaTiO3 example, if I increase gmaxvr from 18 to 22 it gets much worse:

    total calculated charge    :    51.99999409   
    total calculated charge    :    51.99999449   
    total calculated charge    :    51.99999964   
    total calculated charge    :    51.99999982   
    total calculated charge    :    81.66752526   
    total calculated charge    :    101.9951334   

    So this means that the fft is messing up? However I tried switching fft libraries and get the same result.

    I do not understand how it can be fractional as it is an insulator and the states are all occupied correctly:

    total calculated charge    :    76.98870966   
    total calculated charge    :    65.19357430   
    total calculated charge    :    47.99985111   
    total calculated charge    :    78.01516460   
    total calculated charge    :    77.93958531   
    total calculated charge    :    72.03920900   
    total calculated charge    :    74.24595460

    Can someone please explain what is happening and how to fix it? Surprisingly the total energies seem OK, so it is just the printed value wrong?

    By the way, I have over 30 years experience with LAPW, mainly with the Krakauer, Singh, and WIEN2K codes, and I never saw this before.

    Ronald Cohen
    Earth and Planets Laboratory
    Carnegie Institution for Science

     
  • Ronald Cohen

    Ronald Cohen - 2020-11-05

    I also find this problem with elk version 6.3.2, but with the same input the errors are different:

    cohen@tomcat:/home/beegfs/rcohen/ELK/PTO/WCP0/WClibXC/static$ grep "total calculated" INFO.OUT.6.8.3 | head
    total calculated charge : 128.0155108
    total calculated charge : 128.0155731
    total calculated charge : 128.0155682
    total calculated charge : 128.0156023
    total calculated charge : 128.0155967
    total calculated charge : 128.0144846
    total calculated charge : 128.0171201
    total calculated charge : 127.9950034
    total calculated charge : 128.0115674
    total calculated charge : 128.0153518
    rcohen@tomcat:/home/beegfs/rcohen/ELK/PTO/WCP0/WClibXC/static$ grep "total calculated" INFO.OUT.6.3.2 | head
    total calculated charge : 127.9992115
    total calculated charge : 128.1297140
    total calculated charge : 128.4487872
    total calculated charge : 128.9908332
    total calculated charge : 129.0412120
    total calculated charge : 129.1197192
    total calculated charge : 129.0372176
    total calculated charge : 128.0112899
    total calculated charge : 128.0550725

    --Ron Cohen

     
  • Ronald Cohen

    Ronald Cohen - 2020-11-05

    Increasing lmax lmaxapw to 12 from 8 also doesn't help.

     
  • Ronald Cohen

    Ronald Cohen - 2020-11-05

    This is wild—it gets worse with higher rkmax (rgkmax) ! I think the problem is overcompletness of the basis set. The Cholesky gets illdetermined if rkmax is too high
    and this depends also onthe number of local orbitals.

    For PbTiO3 with rkmax=7 the charge is better and it converges in 24 iterations.
    total calculated charge : 128.0138943

    with rkmax=9
    The charge is wrong and it doesn’t converge in 200 iterations!
    total calculated charge : 124.7882743

    even rkmax=8 seems too high
    total calculated charge : 128.0154127
    total calculated charge : 128.0154729
    total calculated charge : 128.0154702
    total calculated charge : 128.0132205
    total calculated charge : 128.0669213
    total calculated charge : 128.1216375
    total calculated charge : 128.0025878
    total calculated charge : 128.0113803
    total calculated charge : 128.0093243
    total calculated charge : 128.0245623
    total calculated charge : 128.0348816
    total calculated charge : 128.0017551
    total calculated charge : 128.0108920
    total calculated charge : 128.0084946
    total calculated charge : 128.0961536
    total calculated charge : 113.4393557

    This is related probably due to the interaction with the local orbitals in the default species file.

    Ron

     
  • J. K. Dewhurst

    J. K. Dewhurst - 2020-11-05

    Hi Ron,

    I ran BaTiO3 with:

    tasks
      0
    
    highq
     .true.
    
    ngridk
      8  8  8
    
    avec
      7.576  0.0    0.0
      0.0    7.576  0.0
      0.0    0.0    7.576
    
    atoms
      3                                    : nspecies
      'Ba.in'                              : spfname
      1                                    : natoms; atpos below
      0.0  0.0  0.0
      'Ti.in'
      1
      0.5  0.5  0.5
      'O.in'
      3
      0.5  0.5  0.0
      0.5  0.0  0.5
      0.0  0.5  0.5
    

    ... and everything seems fine. The calculated total charge from the last iteration was 102.0017678, which is well within tolerance.

    Could you post your problematic input files and I'll run them?

    Regards,
    Kay.

     

Log in to post a comment.