Skip to content
Merged
Show file tree
Hide file tree
Changes from 96 commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
242184c
add update_pot in source_estate
mohanchen Oct 16, 2025
9441396
split update_pot in rt-TDDFT into two functions, one is the original …
mohanchen Oct 17, 2025
dc20084
fix bugs
mohanchen Oct 17, 2025
7829228
update
mohanchen Oct 17, 2025
e842ff4
update esolver_ks
mohanchen Oct 18, 2025
5ade8bb
small updates
mohanchen Oct 18, 2025
d04e97d
small bug fixed
mohanchen Oct 18, 2025
b8237aa
update E_bandgap to E_gap(k)
mohanchen Oct 18, 2025
266fbc2
delete rho_restart file
mohanchen Oct 18, 2025
715f03f
Merge branch 'develop' of https://github.com/mohanchen/abacus-mc into…
mohanchen Oct 18, 2025
3cc238d
Merge branch '20251018' into develop
mohanchen Oct 18, 2025
11d9427
change setup_parameters to print_parameters
mohanchen Oct 18, 2025
4998c0c
move setup_pw.cpp to setup_pwwfc.cpp in module_pwdft
mohanchen Oct 18, 2025
e1154d8
Merge branch 'deepmodeling:develop' into develop
mohanchen Oct 18, 2025
e31c3aa
update esolver, small things
mohanchen Oct 18, 2025
9429236
delete some old_gint codes in esolver
mohanchen Oct 18, 2025
78829e9
fix bugs, update outputs
mohanchen Oct 18, 2025
5463571
fix bug in tests
mohanchen Oct 18, 2025
6f095fb
change efermi to Efermi in fp_energy.h
mohanchen Oct 18, 2025
6b4d7c8
fix bugs
mohanchen Oct 18, 2025
010a575
fix exd and exc in ctrl_runner_lcao
mohanchen Oct 18, 2025
3f23f15
fix cmake
mohanchen Oct 18, 2025
cc834e9
fix bug
mohanchen Oct 18, 2025
fe3bc01
Merge branch 'deepmodeling:develop' into develop
mohanchen Oct 19, 2025
803468f
delete lcao_after_scf and lcao_before_scf
mohanchen Oct 19, 2025
63eab55
modify codes including read_wfc_nao to delete pelec, add setup_psi_lc…
mohanchen Oct 19, 2025
f39bc50
fix bugs
mohanchen Oct 19, 2025
367db31
delete grid integral in FORCE_STRESS
mohanchen Oct 19, 2025
d8bd20a
move read psi to esolver, not in psi
mohanchen Oct 19, 2025
66445eb
fix system bug
mohanchen Oct 19, 2025
73965ea
fix bug in read_wfc_nao.h
mohanchen Oct 19, 2025
4870f18
Merge branch 'develop' into develop
mohanchen Oct 21, 2025
dc2592d
Merge branch 'deepmodeling:develop' into develop
mohanchen Oct 22, 2025
d521c44
change PARAM.inp to inp
mohanchen Oct 22, 2025
5130f4b
fix bugs
mohanchen Oct 22, 2025
10c4d9c
delete omega in pelec, remove some deepks codes to setup_deepks.cpp
mohanchen Oct 22, 2025
207d396
Merge branch 'develop' into develop
mohanchen Oct 22, 2025
a969207
remove exx redundant parameters in Hamilt_LCAO
mohanchen Oct 22, 2025
b32d47a
Merge branch 'develop' of https://github.com/mohanchen/abacus-mc into…
mohanchen Oct 22, 2025
9691f3d
Fix circular dependencies of header files.
mohanchen Oct 22, 2025
54d5c08
Merge branch 'develop' into develop
mohanchen Oct 22, 2025
b997a53
fix bugs in MLALGO
mohanchen Oct 22, 2025
244acfa
refactor exx lcao
mohanchen Oct 23, 2025
a49c409
add rho_tau_lcao files
mohanchen Oct 23, 2025
d309cba
fix bug in setup_deepks
mohanchen Oct 24, 2025
c446b3c
Merge branch 'develop' into 20251023-rho_tau
mohanchen Oct 24, 2025
b8e0d85
move rho_tau_lcao to source_lcao
mohanchen Oct 24, 2025
e493841
remove old psiToRho function in elecstate_lcao and replace with new r…
mohanchen Oct 24, 2025
64f1757
update estate
mohanchen Oct 24, 2025
8e5677f
fix bug in ELF
mohanchen Oct 24, 2025
6559a61
fix bug
mohanchen Oct 24, 2025
8966a3b
update to develop
mohanchen Oct 27, 2025
45e5a9b
Merge branch 'develop' of https://github.com/mohanchen/abacus-mc into…
mohanchen Oct 30, 2025
449d1eb
move DM outside of pelec
mohanchen Oct 30, 2025
e01f84a
deal with init_dm functions
mohanchen Oct 31, 2025
7a6f839
remove pelec in dftu, replace with dmk_d(ouble) and dmk_c(omplex)
mohanchen Nov 2, 2025
7d052a8
fix cal_ldos with DM
mohanchen Nov 2, 2025
26ce47d
update delta_spin
mohanchen Nov 2, 2025
20c5889
update delta spin run_lambda_loop
mohanchen Nov 3, 2025
49301a3
the big issue to remove dm may be caused by cal_mw_from_lambda
mohanchen Nov 3, 2025
ba7d6e6
remove some DM
mohanchen Nov 3, 2025
6ff99f0
keep updating DM
mohanchen Nov 3, 2025
6c0fbe3
refactor some DM in double_xc
mohanchen Nov 3, 2025
ea848fe
now all functions can be compiled
mohanchen Nov 3, 2025
b53865f
fix it
mohanchen Nov 3, 2025
236b8a8
update again
mohanchen Nov 3, 2025
b6bedf5
add and compile setup_dm
mohanchen Nov 3, 2025
2abcc9a
update fix bugs
mohanchen Nov 3, 2025
a9b1104
simplify dm
mohanchen Nov 4, 2025
531b647
one more fix
mohanchen Nov 4, 2025
bbfea9a
now I can compile the code
mohanchen Nov 4, 2025
fc7bc7c
fix some bugs in EXX version
mohanchen Nov 4, 2025
540d845
Merge branch 'develop' of https://github.com/mohanchen/abacus-mc into…
mohanchen Nov 4, 2025
59d1891
solve conflicts
mohanchen Nov 4, 2025
1af42b8
fix FORCE_STRESS
mohanchen Nov 4, 2025
93fd786
fix 2
mohanchen Nov 4, 2025
1b4f8b6
fix 3
mohanchen Nov 4, 2025
600421c
fix 4
mohanchen Nov 4, 2025
8bd559a
fix 5
mohanchen Nov 4, 2025
f3d9986
improve esolver_ks_lcao
mohanchen Nov 4, 2025
e0c7a6b
Merge branch 'develop' into develop
mohanchen Nov 4, 2025
8789c9f
improve again
mohanchen Nov 4, 2025
4d2cf41
comment out psi2rho in init_dm
mohanchen Nov 4, 2025
aef0c12
clean esolver_ks_lcao
mohanchen Nov 4, 2025
4dc6f15
Merge branch 'develop' of https://github.com/mohanchen/abacus-mc into…
mohanchen Nov 4, 2025
0ba139b
update structure_factor
mohanchen Nov 4, 2025
3f77d97
update sf
mohanchen Nov 4, 2025
ed64231
update
mohanchen Nov 5, 2025
1d71aa7
fix sf
mohanchen Nov 5, 2025
8029f27
fix
mohanchen Nov 5, 2025
3fe9aed
fix structure factor
mohanchen Nov 5, 2025
639fc03
Merge branch 'deepmodeling:develop' into develop
mohanchen Nov 5, 2025
7d29c43
fix dm bug in PEXSI
mohanchen Nov 6, 2025
7807e61
Merge branch 'develop' into develop
mohanchen Nov 6, 2025
01a83f2
fix PEXSI
mohanchen Nov 7, 2025
901bd50
Merge branch 'develop' of https://github.com/mohanchen/abacus-mc into…
mohanchen Nov 7, 2025
5020b40
Update edm.cpp
ZhouXY-PKU Nov 7, 2025
c4d309d
fix edm
mohanchen Nov 7, 2025
686be13
solve edm conflict
mohanchen Nov 7, 2025
884d47d
Update hsolver_lcao.cpp
ZhouXY-PKU Nov 7, 2025
c010f37
Update hsolver_lcao.cpp
ZhouXY-PKU Nov 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions source/source_estate/elecstate_lcao.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "elecstate_lcao.h"

#include "cal_dm.h"
#include "source_estate/elecstate_lcao.h"
#include "source_estate/cal_dm.h"
#include "source_base/timer.h"
#include "source_estate/module_dm/cal_dm_psi.h"
#include "source_hamilt/module_xc/xc_functional.h"
Expand Down Expand Up @@ -31,25 +30,28 @@ double ElecStateLCAO<std::complex<double>>::get_spin_constrain_energy()
return sc.cal_escon();
}

#ifdef __PEXSI
template <>
void ElecStateLCAO<double>::dm2Rho(std::vector<double*> pexsi_DM, std::vector<double*> pexsi_EDM)
void ElecStateLCAO<double>::dm2rho(std::vector<double*> pexsi_DM,
std::vector<double*> pexsi_EDM,
DensityMatrix<double, double>* dm)
{
ModuleBase::timer::tick("ElecStateLCAO", "dm2Rho");
ModuleBase::timer::tick("ElecStateLCAO", "dm2rho");

int nspin = PARAM.inp.nspin;
if (PARAM.inp.nspin == 4)
{
nspin = 1;
}

this->get_DM()->pexsi_EDM = pexsi_EDM;
#ifdef __PEXSI
dm->pexsi_EDM = pexsi_EDM;
#endif

for (int is = 0; is < nspin; is++)
{
this->DM->set_DMK_pointer(is, pexsi_DM[is]);
dm->set_DMK_pointer(is, pexsi_DM[is]);
}
DM->cal_DMR();
dm->cal_DMR();

for (int is = 0; is < PARAM.inp.nspin; is++)
{
Expand All @@ -58,30 +60,30 @@ void ElecStateLCAO<double>::dm2Rho(std::vector<double*> pexsi_DM, std::vector<do
}

ModuleBase::GlobalFunc::NOTE("Calculate the charge on real space grid!");
ModuleGint::cal_gint_rho(this->DM->get_DMR_vector(), PARAM.inp.nspin, this->charge->rho);
ModuleGint::cal_gint_rho(dm->get_DMR_vector(), PARAM.inp.nspin, this->charge->rho);
if (XC_Functional::get_ked_flag())
{
for (int is = 0; is < PARAM.inp.nspin; is++)
{
ModuleBase::GlobalFunc::ZEROS(this->charge->kin_r[0], this->charge->nrxx);
}
ModuleGint::cal_gint_tau(this->DM->get_DMR_vector(), PARAM.inp.nspin, this->charge->kin_r);
ModuleGint::cal_gint_tau(dm->get_DMR_vector(), PARAM.inp.nspin, this->charge->kin_r);
}

this->charge->renormalize_rho();

ModuleBase::timer::tick("ElecStateLCAO", "dm2Rho");
ModuleBase::timer::tick("ElecStateLCAO", "dm2rho");
return;
}

template <>
void ElecStateLCAO<std::complex<double>>::dm2rho(std::vector<std::complex<double>*> pexsi_DM,
std::vector<std::complex<double>*> pexsi_EDM)
std::vector<std::complex<double>*> pexsi_EDM,
DensityMatrix<std::complex<double>, double>* dm)
{
ModuleBase::WARNING_QUIT("ElecStateLCAO", "pexsi is not completed for multi-k case");
}

#endif

template class ElecStateLCAO<double>; // Gamma_only case
template class ElecStateLCAO<std::complex<double>>; // multi-k case
Expand Down
6 changes: 3 additions & 3 deletions source/source_estate/elecstate_lcao.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class ElecStateLCAO : public ElecState

double get_spin_constrain_energy() override;

#ifdef __PEXSI
// use for pexsi

/**
Expand All @@ -46,8 +45,9 @@ class ElecStateLCAO : public ElecState
* @param pexsi_EDM: pointers of energy-weighed density matrix (EDMK) calculated by pexsi, needed by MD, will be
* stored in DensityMatrix::pexsi_EDM
*/
void dm2rho(std::vector<TK*> pexsi_DM, std::vector<TK*> pexsi_EDM);
#endif
void dm2rho(std::vector<TK*> pexsi_DM,
std::vector<TK*> pexsi_EDM,
DensityMatrix<TK, double>* dm);

};

Expand Down
2 changes: 1 addition & 1 deletion source/source_hsolver/hsolver_lcao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void HSolverLCAO<TK, Device>::solve(hamilt::Hamilt<TK>* pHamilt,
auto _pes = dynamic_cast<elecstate::ElecStateLCAO<T>*>(pes);
pes->f_en.eband = pe.totalFreeEnergy;
// maybe eferm could be dealt with in the future
_pes->dm2rho(dm, pe.EDM);
_pes->dm2rho(pe.DM, pe.EDM, dm);
#endif
}

Expand Down
Loading