Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
5708805
Fix: param settings error
1041176461 Jan 9, 2025
1532914
Fix: add Rcut for set_Vs_dVs
1041176461 Jan 9, 2025
c6dad8f
Fix: mixing pulay
1041176461 Jan 12, 2025
4875128
Fix: large system rcut error
1041176461 Jan 14, 2025
3c01c3a
Merge branch 'LC_Exx-new' into hytd
1041176461 Jan 14, 2025
1ee218c
Merge pull request #20 from ESROAMER/hytd
1041176461 Jan 14, 2025
50f805d
Merge pull request #21 from ESROAMER/hytd
1041176461 Jan 21, 2025
011b570
Fix: parse_expression for scientific notation
1041176461 Jan 30, 2025
851eda8
Fix: pulay mixing for td
1041176461 Feb 12, 2025
b254a91
add rH and Hr
1041176461 Mar 4, 2025
4251c12
fix type error
1041176461 Mar 4, 2025
8d61289
fix memory error
1041176461 Mar 4, 2025
9d486a0
fix coeff for current
1041176461 Mar 4, 2025
4a4e74d
fix memory
1041176461 Mar 5, 2025
181d0e1
based on full HR
1041176461 Mar 6, 2025
8e91048
fix ik
1041176461 Mar 6, 2025
4b4a425
correct current with wg and -
1041176461 Mar 7, 2025
e052aea
add Hexx current
1041176461 Mar 7, 2025
6a1360d
comment add_partial_Hexx
1041176461 Mar 7, 2025
6d6a086
add complex HexxR
1041176461 Mar 7, 2025
f887f54
add hybrid gauge
1041176461 Mar 7, 2025
8096507
fix nbands
1041176461 Mar 8, 2025
e38a408
fix stype == 2
1041176461 Mar 8, 2025
cf9e702
add warning for exx_real_number with td
1041176461 Mar 8, 2025
6758a01
add add_Hexx_td for hyb gauge
1041176461 Mar 8, 2025
602b4a5
refactor and add vel gauge
1041176461 Mar 8, 2025
bbab19d
out_current_comm support for pbe
1041176461 Mar 8, 2025
0759153
fix velocity current error
1041176461 Mar 8, 2025
bea8a47
init rR from hR
1041176461 Mar 8, 2025
0c573a6
use Hexxc
1041176461 Mar 9, 2025
aca84df
fix add_Hexx_td
1041176461 Mar 10, 2025
48ad0f5
fix folding_partial_HR
1041176461 Mar 10, 2025
fc43f00
use adj R for rR
1041176461 Mar 10, 2025
24eae3a
add hybrid gauge for new current method
1041176461 Mar 11, 2025
96dad75
fix add HexxR to full HR
1041176461 Mar 11, 2025
681f6e1
add init_wfc support for exx
1041176461 Mar 18, 2025
6b8d56b
add delete
1041176461 Mar 20, 2025
556f68a
Merge branch 'hytd' into hytd-nonlocal
ESROAMER Apr 25, 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
1 change: 1 addition & 0 deletions source/module_esolver/esolver_ks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ void ESolver_KS<T, Device>::before_all_runners(const Input_para& inp, UnitCell&
PARAM.inp.mixing_gg0_min,
PARAM.inp.mixing_angle,
PARAM.inp.mixing_dmr);
p_chgmix->init_mixing();

/// PAW Section
#ifdef USE_PAW
Expand Down
79 changes: 54 additions & 25 deletions source/module_esolver/esolver_ks_lcao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,14 @@ ESolver_KS_LCAO<TK, TR>::ESolver_KS_LCAO()
// because some members like two_level_step are used outside if(cal_exx)
if (GlobalC::exx_info.info_ri.real_number)
{
this->exx_lri_double = std::make_shared<Exx_LRI<double>>(GlobalC::exx_info.info_ri, GlobalC::exx_info.info_ewald);
this->exx_lri_double
= std::make_shared<Exx_LRI<double>>(GlobalC::exx_info.info_ri, GlobalC::exx_info.info_ewald);
this->exd = std::make_shared<Exx_LRI_Interface<TK, double>>(exx_lri_double);
}
else
{
this->exx_lri_complex = std::make_shared<Exx_LRI<std::complex<double>>>(GlobalC::exx_info.info_ri, GlobalC::exx_info.info_ewald);
this->exx_lri_complex
= std::make_shared<Exx_LRI<std::complex<double>>>(GlobalC::exx_info.info_ri, GlobalC::exx_info.info_ewald);
this->exc = std::make_shared<Exx_LRI_Interface<TK, std::complex<double>>>(exx_lri_complex);
}
#endif
Expand Down Expand Up @@ -198,7 +200,10 @@ void ESolver_KS_LCAO<TK, TR>::before_all_runners(const Input_para& inp, UnitCell
{
if (GlobalC::exx_info.info_global.cal_exx)
{
XC_Functional::set_xc_first_loop(ucell);
if (PARAM.inp.init_wfc != "file")
{ // if init_wfc==file, directly enter the EXX loop
XC_Functional::set_xc_first_loop(ucell);
}
// initialize 2-center radial tables for EXX-LRI
if (GlobalC::exx_info.info_ri.real_number)
{
Expand Down Expand Up @@ -521,7 +526,7 @@ void ESolver_KS_LCAO<TK, TR>::iter_init(const int istep, const int iter)

if (iter == 1)
{
this->p_chgmix->init_mixing(); // init mixing
this->p_chgmix->mix_reset(); // init mixing
this->p_chgmix->mixing_restart_step = PARAM.inp.scf_nmax + 1;
this->p_chgmix->mixing_restart_count = 0;
// this output will be removed once the feeature is stable
Expand Down Expand Up @@ -575,7 +580,16 @@ void ESolver_KS_LCAO<TK, TR>::iter_init(const int istep, const int iter)
// electrons number.
if (istep == 0 && this->wf.init_wfc == "file")
{
if (iter == 1)
int exx_two_level_step = 0;
#ifdef __EXX
if (GlobalC::exx_info.info_global.cal_exx)
{
// the following steps are only needed in the first outer exx loop
exx_two_level_step
= GlobalC::exx_info.info_ri.real_number ? this->exd->two_level_step : this->exc->two_level_step;
}
#endif
if (iter == 1 && exx_two_level_step == 0)
{
std::cout << " WAVEFUN -> CHARGE " << std::endl;

Expand Down Expand Up @@ -945,9 +959,24 @@ void ESolver_KS_LCAO<TK, TR>::iter_finish(const int istep, int& iter)
// 3) save exx matrix
if (GlobalC::exx_info.info_global.cal_exx)
{
GlobalC::exx_info.info_ri.real_number ?
this->exd->exx_iter_finish(this->kv, GlobalC::ucell, *this->p_hamilt, *this->pelec, *this->p_chgmix, this->scf_ene_thr, iter, istep, this->conv_esolver) :
this->exc->exx_iter_finish(this->kv, GlobalC::ucell, *this->p_hamilt, *this->pelec, *this->p_chgmix, this->scf_ene_thr, iter, istep, this->conv_esolver);
GlobalC::exx_info.info_ri.real_number ? this->exd->exx_iter_finish(this->kv,
GlobalC::ucell,
*this->p_hamilt,
*this->pelec,
*this->p_chgmix,
this->scf_ene_thr,
iter,
istep,
this->conv_esolver)
: this->exc->exx_iter_finish(this->kv,
GlobalC::ucell,
*this->p_hamilt,
*this->pelec,
*this->p_chgmix,
this->scf_ene_thr,
iter,
istep,
this->conv_esolver);
}
#endif

Expand All @@ -967,26 +996,26 @@ void ESolver_KS_LCAO<TK, TR>::iter_finish(const int istep, int& iter)
}
std::string fn = PARAM.globalv.global_out_dir + "/tmp_SPIN" + std::to_string(is + 1) + "_CHG.cube";
ModuleIO::write_vdata_palgrid(GlobalC::Pgrid,
data,
is,
PARAM.inp.nspin,
0,
fn,
this->pelec->eferm.get_efval(is),
&(GlobalC::ucell),
3,
1);
data,
is,
PARAM.inp.nspin,
0,
fn,
this->pelec->eferm.get_efval(is),
&(GlobalC::ucell),
3,
1);
if (XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5)
{
fn = PARAM.globalv.global_out_dir + "/tmp_SPIN" + std::to_string(is + 1) + "_TAU.cube";
ModuleIO::write_vdata_palgrid(GlobalC::Pgrid,
this->pelec->charge->kin_r_save[is],
is,
PARAM.inp.nspin,
0,
fn,
this->pelec->eferm.get_efval(is),
&(GlobalC::ucell));
this->pelec->charge->kin_r_save[is],
is,
PARAM.inp.nspin,
0,
fn,
this->pelec->eferm.get_efval(is),
&(GlobalC::ucell));
}
}
}
Expand Down Expand Up @@ -1032,7 +1061,7 @@ void ESolver_KS_LCAO<TK, TR>::after_scf(const int istep)
{
this->pelec->cal_tau(*(this->psi));
}

// 2) call after_scf() of ESolver_KS
ESolver_KS<TK>::after_scf(istep);

Expand Down
Loading
Loading