abacusmodeling / abacus-develop

An electronic structure package based on either plane wave basis or numerical atomic orbitals.
GNU Lesser General Public License v3.0
158 stars 165 forks source link

PBE band structures diagonalization of H(R) and nscf calculation are different #165

Closed 1041176461 closed 2 years ago

1041176461 commented 2 years ago

Describe the Bug

@PeizeLin and I compare PBE band structures from diagonalization of H(R) matrix and nscf calculation, among three versions of ABACUS (21-12-04, 22-04-25 and 22-07-11). We found that results of version 22-07-11 are different from the other two, especically, hr-results of 22-07-11 are different from nscf-results of 22-07-11 while such a big difference do not appear in the old versions. Here we provide the pairwise MAEs: band_compare and input files: input.zip

1041176461 commented 2 years ago

Test

I did SCF calculation first and got a charge file SPIN1_CHG. Then I used four settings to compare 'nscf' and 'HR' bands:

  1. NSCF: out_band=1 based on SPIN1_CHG
  2. SCF: out_band=1, scf_nmax=1 based on SPIN1_CHG
  3. NSCF: out_band=1,out_mat_hs2=1 based on SPIN1_CHG
  4. SCF: out_mat_hs2=1 + External diagonalization

Results

Band structure obtained from setting 1 and 2 are same, and setting 3 and 4 are same. However, setting 1(2) and 3(4) are different, their MAE is 0.003678632989845569 eV, which is a large error.

Possible causes

I guess there are some additional pre-processing when out_mat_hs2=1 is set.

Files

Here are my input and result files test.zip

1041176461 commented 2 years ago

I retested the parameters, I found that the error originates from the keyword out_mat_r, rather than out_mat_hs2. Here I write the final band data as a tag

  1. out_mat_hs2=0 and out_mat_r=0 -> 11.539922
  2. out_mat_hs2=0 and out_mat_r=1 -> 11.550836
  3. out_mat_hs2=1 and out_mat_r=0 -> 11.539922

Here are my new result files retest.zip

jingan-181 commented 2 years ago

When setting out_mat_r=1, in module_orbital/ORB_read.cpp

if(out_mat_r)
{
    kmesh = kmesh * 4;
} 

This kemsh is the cause of the different band results.