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

Question: Why does `UnitCell::cal_ux()` rely on the unchanged `atoms[it].m_loc_[ia]`? #4040

Closed WHUweiqingzhou closed 6 months ago

WHUweiqingzhou commented 7 months ago

Details

During SCF, atoms[it].m_loc_[ia] is not updated, and cal_ux run at each iteration. Is it correct?

Have you read FAQ on the online manual http://abacus.deepmodeling.com/en/latest/community/faq.html

Task list for Issue attackers (only for developers)

mohanchen commented 6 months ago

Good question.

dyzheng commented 6 months ago

This function only used for the special case: antiferromagnetism with NSPIN=4

In most of case, the local magnetic moment on grid point can be defined as mag(r) = (rho_x, rho_y, rho_z), and when rotate the quantization axis toward mag'(r) = (0, 0, rho'_z), the rho'_z can be sqrt(|mag(r)|^2), which is always positive.

But error occurred with antiferromagnetism case that some local magnetic moment on different grid point would have same norm with opposite direction, which usually will not arise naturally without initial antiferromagnetism atomic settings. In this case, cal_ux() will define a positive direction, and the antiferromagnetism will be calculated correctly.

In conclusion, this method for calculating magnetization density with noncollinear spin can work, but it dependent on the user's initial magnetic moment Settings, very unreliable!!!

I plan to refactor this method in future.

WHUweiqingzhou commented 6 months ago

@dyzheng Thanks! I get it.