-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: a promising angle mixing method for non-colinear calculations #3356
Feature: a promising angle mixing method for non-colinear calculations #3356
Conversation
…op into mixing_angle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution, mixing method for noncollinear spin will be improved with this PR.
@@ -1015,6 +1016,17 @@ We recommend the following options: | |||
- **Description**: the minimum kerker coefficient | |||
- **Default**: 0.1 | |||
|
|||
### mixing_angle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the description in https://abacus.deepmodeling.com/en/latest/advanced/scf/converge.html#charge-mixing for new mixing parameters.
### mixing_angle | ||
|
||
- **Type**: Real | ||
- **Availability**: Only relevant for non-colinear calculations `nspin=4`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users often set "lspinorb=1" or "noncolin=1" rather than "nspin=4".
@@ -235,6 +235,7 @@ class Input | |||
double mixing_beta_mag; | |||
double mixing_gg0_mag; | |||
double mixing_gg0_min; | |||
double mixing_angle; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add unit-test for this mixing_angle parameter.
@@ -896,10 +1002,13 @@ double Charge_Mixing::inner_product_recip(std::complex<double>* rho1, std::compl | |||
double Charge_Mixing::inner_product_recip_new1(std::complex<double>* rho1, std::complex<double>* rho2) | |||
{ | |||
double rnorm = 0.0; | |||
// consider a resize for mixing_angle | |||
int resize_tmp = 1; | |||
if (GlobalV::NSPIN == 4 && GlobalV::MIXING_ANGLE > 0) resize_tmp = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope you can replace the use of "GlobalV" with local variables or class members in Charge_Mixing code.
Linked Issue
Fix #3336. As is mentioned in Issue #3336, If one is not interested in the energies of a given magnetic configuration but wants to determine the ground state by relaxing the magnetic moments’ directions, one cannot rely on the standard Broyden mixing algorithm.
To enhance ABACUS's ability to find correct magnetic configuration for non-colinear calculations, I implement a promising mixing method proposed by J. Phys. Soc. Jpn. 82 (2013) 114706.
b.t.w, in this PR, I only realize a special case with angle mixing parameter is 1 NOW.
What's changed?
mixing_angle
to control if this method is used.mix_rho_real()
andmix_rho_recip_new()
.resize_tmp
in Kerker and inner_product to corporate with new angle mixing method.Charge_Mixing::Kerker_screen_real_test()
.Notice that:
mixing_angle 1
mixing_beta_mag >> mixing_beta
, andmixing_beta_mag
is around 1.