-
Notifications
You must be signed in to change notification settings - Fork 148
Feature: init_chg hr for initializing charge density with hrs1_nao.csr
#6791
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
base: develop
Are you sure you want to change the base?
Conversation
init_chg hr for initializing charge density with hrs1_nao.csr
| this->dmat.dm->init_DMR(*hamilt_lcao->getHR()); | ||
|
|
||
| // 13.1) decide the strategy for initializing DMR and HR | ||
| if(istep == 0)//if the first scf step, readin DMR from file, |
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.
if you write the code in 'before_all_runners', then you don't need to specify if(istep==0) because it only be called once. If you write the code in 'before_scf', that's the wrong place to put the code.
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.
Next, if you want to have a function to read density matrix from DMR, then the details (from line 174-211) are suggested to put into other functions, not in esolver_ks_lcao.cpp
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 need to modify the operation of initializing the charge density such that the charge density is calculated after reading in the Hamiltonian or the density matrix, while skipping the original initialization strategy that starts from the atomic charge density.
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.
However, due to the code coupling relationship, I do not wish to introduce dependencies on LCAO-related modules into the Charge module. Given that the charge density initialization strategy in the Charge module includes a charge density normalization operation, I must ensure that the charge density initialization is completed before performing the normalization. Therefore, the new initialization code must be placed prior to init_scf, which means the initialization of the Hamiltonian and the density matrix also needs to be moved before init_scf. This approach is feasible, but the program does require refactoring to achieve greater rationality and neatness. Owing to time constraints, I have not yet considered this issue in detail.
Reminder
Linked Issue
Fix #6792
hrs1_nao.csr file is large, test case should be designed to reduce memory, will be updated later.
Unit Tests and/or Case Tests for my changes
What's changed?
Any changes of core modules? (ignore if not applicable)