forked from abacusmodeling/abacus-develop
-
Notifications
You must be signed in to change notification settings - Fork 167
Fix the incorrect calculation of partial charge for multi-k-points under both PW and LCAO when symmetry is turned on #4803
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
bc0499d
Change some annotations for bands_to_print due to INPUT refactoring
AsTonyshment 057eb5c
Merge branch 'deepmodeling:develop' into fix_PW_pchg
AsTonyshment 125cb2b
Merge branch 'deepmodeling:develop' into fix_PW_pchg
AsTonyshment 2589bd2
Merge branch 'deepmodeling:develop' into fix_PW_pchg
AsTonyshment 545de07
Fix the bug of pchg incorrect calculation due to symmetry=1
AsTonyshment 7faa871
Get rid of GlobalC in istate_charge when symmetrizing charge density
AsTonyshment 72b89e6
Fix the bug of pchg incorrect calculation under PW due to symmetry=1
AsTonyshment c37e9ec
Merge branch 'deepmodeling:develop' into fix_PW_pchg
AsTonyshment b714017
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] b09d96c
Refactor symmetry_rho to replace raw pointer arrays with std::vector …
AsTonyshment 2c24027
Merge branch
AsTonyshment 6cbd476
Merge branch 'develop' into fix_PW_pchg
AsTonyshment 6cf9e98
Merge branch 'develop' into fix_PW_pchg
AsTonyshment 143e633
Merge branch 'deepmodeling:develop' into fix_PW_pchg
AsTonyshment fa53e29
Refactor partial charge calc in esolver_ks_pw.cpp to replace raw poin…
AsTonyshment dd4c865
Rename files: istate_charge to get_pchg, and istate_envelope to get_wf
AsTonyshment File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,37 +1,57 @@ | ||
| #ifndef SYMMETRY_RHO_H | ||
| #define SYMMETRY_RHO_H | ||
| #include "module_elecstate/module_charge/charge.h" | ||
| #include "module_basis/module_pw/pw_basis.h" | ||
| #include "module_hamilt_pw/hamilt_pwdft/parallel_grid.h" | ||
|
|
||
| #include "module_cell/module_symmetry/symmetry.h" | ||
| #include "module_elecstate/module_charge/charge.h" | ||
| #include "module_hamilt_pw/hamilt_pwdft/parallel_grid.h" | ||
|
|
||
| class Symmetry_rho | ||
| { | ||
| public: | ||
| Symmetry_rho(); | ||
| ~Symmetry_rho(); | ||
| public: | ||
| Symmetry_rho(); | ||
| ~Symmetry_rho(); | ||
|
|
||
| void begin(const int& spin_now, | ||
| const Charge& CHR, | ||
| const ModulePW::PW_Basis* pw, | ||
| Parallel_Grid& Pgrid, | ||
| ModuleSymmetry::Symmetry& symm) const; | ||
|
|
||
| void begin(const int& spin_now, | ||
| double** rho, | ||
| std::complex<double>** rhog, | ||
| int ngmc, | ||
| double** kin_r, | ||
| const ModulePW::PW_Basis* pw, | ||
| Parallel_Grid& Pgrid, | ||
| ModuleSymmetry::Symmetry& symm) const; | ||
|
|
||
| private: | ||
| // in real space: | ||
| void psymm(double *rho_part, const ModulePW::PW_Basis *pw, Parallel_Grid &Pgrid, ModuleSymmetry::Symmetry &symm) const; | ||
| // in reciprocal space: | ||
| void psymmg(std::complex<double>* rhog_part, const ModulePW::PW_Basis *rho_basis, | ||
| Parallel_Grid &Pgrid, ModuleSymmetry::Symmetry &symm) const; | ||
| // in real space: | ||
| void psymm(double* rho_part, | ||
| const ModulePW::PW_Basis* pw, | ||
| Parallel_Grid& Pgrid, | ||
| ModuleSymmetry::Symmetry& symm) const; | ||
| // in reciprocal space: | ||
| void psymmg(std::complex<double>* rhog_part, | ||
| const ModulePW::PW_Basis* rho_basis, | ||
| Parallel_Grid& Pgrid, | ||
| ModuleSymmetry::Symmetry& symm) const; | ||
| #ifdef __MPI | ||
| void reduce_to_fullrhog(const ModulePW::PW_Basis *rho_basis, std::complex<double>* rhogtot, | ||
| std::complex<double>* rhogin, int* ig2isztot, const int* ig2iszin, int max_npw) const; | ||
| void rhog_piece_to_all(const ModulePW::PW_Basis *rho_basis, | ||
| std::complex<double>* rhogtot, std::complex<double>* rhog_part) const; | ||
| void reduce_to_fullrhog(const ModulePW::PW_Basis* rho_basis, | ||
| std::complex<double>* rhogtot, | ||
| std::complex<double>* rhogin, | ||
| int* ig2isztot, | ||
| const int* ig2iszin, | ||
| int max_npw) const; | ||
| void rhog_piece_to_all(const ModulePW::PW_Basis* rho_basis, | ||
| std::complex<double>* rhogtot, | ||
| std::complex<double>* rhog_part) const; | ||
| #endif | ||
| void get_ixyz2ipw(const ModulePW::PW_Basis *rho_basis, const int* ig2isztot, | ||
| const int* fftixy2is, int* ixyz2ipw) const; //(ix, iy, iz) -> (ip, ig) | ||
| void get_ixyz2ipw(const ModulePW::PW_Basis* rho_basis, | ||
| const int* ig2isztot, | ||
| const int* fftixy2is, | ||
| int* ixyz2ipw) const; //(ix, iy, iz) -> (ip, ig) | ||
| }; | ||
|
|
||
| #endif |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.