Refactor: charge mixing#3400
Closed
WHUweiqingzhou wants to merge 18 commits intodeepmodeling:developfrom
Closed
Conversation
16 tasks
…velop into refactor_mixing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #3363.
Now ABACUS has implemented various charge mixing methods. To avoid too many uses of if...elseif, a more general design is urgently needed. Besides that, possible new method, f.e. #3335 is also needed to be taken into consideration. To this end, I introduce two new local variables
_mixing_rho_type_numand_mixing_rho_unit_num.Notes:
_mixing_rho_type_numrepresents how many types of density stored in mixing data. f.e., if only mix charge density (including total density and magnetic density), this value is 1; if we also mix kinetic density,_mixing_rho_type_numwill be 2._mixing_rho_unit_numrepresents how many units of density in each density type. It is 1 fornspin=1(nspin=2(nspin=4(nspin=4using angle mixing method (List of Changes
_mixing_rho_type_numand_mixing_rho_unit_numincharge_mixing.hmix_rho_real()Kerker_screen_real()andinner_product_real()by using_mixing_rho_type_numand_mixing_rho_unit_num