deepmodeling / abacus-develop

An electronic structure package based on either plane wave basis or numerical atomic orbitals.
http://abacus.ustc.edu.cn
GNU Lesser General Public License v3.0
174 stars 136 forks source link

Wrong output Matrices in tddft calculation #4117

Closed ESROAMER closed 6 months ago

ESROAMER commented 6 months ago

Describe the bug

The output Matrices, H(R),S(R),S(k),are totally wrong if 'esolver_type=tddft'. It's a problem occurs only in versions later than 3.5.0. Since tddft didn't changed from 3.4.4 to 3.5.0, I guess the reason is that the output function has changed, yet tddft didn't change correspondly. Please fix this.

Expected behavior

No response

To Reproduce

No response

Environment

No response

Additional Context

No response

Task list for Issue attackers (only for developers)

mohanchen commented 6 months ago

Thanks for your report! We will fix it soon.

ESROAMER commented 6 months ago

Sorry, I was wrong about the version. There are two different problems: The first is wrong output of Sk, it occurs after version 3.5.1 in tddft calculation. According to my result, I guess ABACUS just output Sk with data of Hk martix, since they are exactly the same. The second is wrong output of HR, it occurs after version 3.5.3, and I know its reason. It was due to the velocity gague code, in which a new HR was set up to store the complex correction term. To output the correct HR, these term should be included.

AsTonyshment commented 6 months ago

Sorry, I was wrong about the version. There are two different problems: The first is wrong output of Sk, it occurs after version 3.5.1 in tddft calculation. According to my result, I guess ABACUS just output Sk with data of Hk martix, since they are exactly the same. The second is wrong output of HR, it occurs after version 3.5.3, and I know its reason. It was due to the velocity gague code, in which a new HR was set up to store the complex correction term. To output the correct HR, these term should be included.

So can you fix the part related to $H(\boldsymbol{R})$ @ESROAMER (since I am not familiar with the velocity gauge code)? I'll try to fix the remaining problems with respect to $S(\boldsymbol{R})$ and $S(\boldsymbol{k})$.

ESROAMER commented 6 months ago

Sorry, I was wrong about the version. There are two different problems: The first is wrong output of Sk, it occurs after version 3.5.1 in tddft calculation. According to my result, I guess ABACUS just output Sk with data of Hk martix, since they are exactly the same. The second is wrong output of HR, it occurs after version 3.5.3, and I know its reason. It was due to the velocity gague code, in which a new HR was set up to store the complex correction term. To output the correct HR, these term should be included.

So can you fix the part related to H(R) @ESROAMER (since I am not familiar with the velocity gauge code)? I'll try to fix the remaining problems with respect to S(R) and S(k).

Ok, I'll handle the problem of HR. The SR matrix is correct, you may just check the part of Sk. @AsTonyshment