Skip to content

Commit 34be1cc

Browse files
committed
Revert reference change by adding option dm_no_renormalize to init_chg
This reverts commit ed14d9f.
1 parent be860ce commit 34be1cc

7 files changed

Lines changed: 13 additions & 19 deletions

File tree

docs/advanced/input_files/input-main.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,11 +2038,7 @@
20382038

20392039
- **Type**: Boolean \[Integer\](optional)
20402040
- **Availability**: *Numerical atomic orbital basis (not gamma-only algorithm)*
2041-
<<<<<<< HEAD
2042-
- **Description**: Generate files containing the kinetic energy matrix. The optional second parameter controls text output precision. The format will be the same as the Hamiltonian matrix and overlap matrix as mentioned in out_mat_hs2. The name of the files will be trs1_nao.csr and so on. Also controled by out_freq_ion and out_app_flag.
2043-
=======
2044-
- **Description**: Generate files containing the kinetic energy matrix. The format will be the same as the Hamiltonian matrix and overlap matrix as mentioned in out_mat_hs2. The name of the files will be trs1_nao.csr and so on. Also controlled by out_freq_ion and out_app_flag.
2045-
>>>>>>> b1aa9e54a (small fixes)
2041+
- **Description**: Generate files containing the kinetic energy matrix. The optional second parameter controls text output precision. The format will be the same as the Hamiltonian matrix and overlap matrix as mentioned in out_mat_hs2. The name of the files will be trs1_nao.csr and so on. Also controlled by out_freq_ion and out_app_flag.
20462042

20472043
> Note: In the 3.10-LTS version, the file name is data-TR-sparse_SPIN0.csr.
20482044
- **Default**: False 8
@@ -2125,11 +2121,7 @@
21252121

21262122
- **Type**: Boolean \[Integer\](optional)
21272123
- **Availability**: *Numerical atomic orbital basis (not gamma-only algorithm)*
2128-
<<<<<<< HEAD
2129-
- **Description**: Whether to print files containing the derivatives of the overlap matrix. The optional second parameter controls text output precision. The format will be the same as the overlap matrix as mentioned in out_mat_dh. The name of the files will be dsxrs1_nao.csr and so on. Also controled by out_freq_ion and out_app_flag. This feature can be used with calculation get_s.
2130-
=======
2131-
- **Description**: Whether to print files containing the derivatives of the overlap matrix. The format will be the same as the overlap matrix as mentioned in out_mat_dh. The name of the files will be dsxrs1_nao.csr and so on. Also controlled by out_freq_ion and out_app_flag. This feature can be used with calculation get_s.
2132-
>>>>>>> b1aa9e54a (small fixes)
2124+
- **Description**: Whether to print files containing the derivatives of the overlap matrix. The optional second parameter controls text output precision. The format will be the same as the overlap matrix as mentioned in out_mat_dh. The name of the files will be dsxrs1_nao.csr and so on. Also controlled by out_freq_ion and out_app_flag. This feature can be used with calculation get_s.
21332125

21342126
> Note: In the 3.10-LTS version, the file name is data-dSRx-sparse_SPIN0.csr and so on.
21352127
- **Default**: False 8

source/source_esolver/esolver_ks_lcao.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ void ESolver_KS_LCAO<TK, TR>::before_scf(UnitCell& ucell, const int istep)
180180
if(istep == 0)//if the first scf step, readin DMR from file,
181181
{
182182
//calculate or readin the density matrix DMR
183-
if(PARAM.inp.init_chg == "dm")
183+
if(PARAM.inp.init_chg == "dm" || PARAM.inp.init_chg == "dm_no_renormalize")
184184
{
185185
//! 13.1.1) init charge density from density matrix file
186186
LCAO_domain::init_chg_dm<TK>(PARAM.globalv.global_readin_dir, PARAM.inp.nspin,

source/source_estate/init_scf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void init_scf(const UnitCell& ucell,
1717
pelec->charge->set_rho_core(ucell, strucfac, numeric);
1818

1919
//! renormalize the charge density
20-
if(PARAM.inp.init_chg != "dm")
20+
if(PARAM.inp.init_chg != "dm_no_renormalize")
2121
{
2222
pelec->charge->renormalize_rho();
2323
}

source/source_io/module_parameter/read_input_item_system.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,7 @@ Available options are:
468468
* file: the density will be read in from a binary file charge-density.dat first. If it does not exist, the charge density will be read in from cube files.
469469
* wfc: the density will be calculated by wavefunctions and occupations.
470470
* dm: the density will be calculated by real space density matrix(DMR) of LCAO base.
471+
* dm_no_renormalize: same as dm, but the charge density is not renormalized to the number of electrons.
471472
* hr: the real space Hamiltonian matrix(HR) will be read in from file hrs1_nao.csr in directory read_file_dir.
472473
* auto: Abacus first attempts to read the density from a file; if not found, it defaults to using atomic density.)";
473474
item.default_value = "atomic";
@@ -482,6 +483,7 @@ Available options are:
482483
// dm and hr are valid options for nscf calculation (e.g., band structure, wannier90)
483484
if (para.input.init_chg != "file" &&
484485
para.input.init_chg != "dm" &&
486+
para.input.init_chg != "dm_no_renormalize" &&
485487
para.input.init_chg != "hr")
486488
{
487489
ModuleBase::GlobalFunc::AUTO_SET("init_chg", para.input.init_chg);
@@ -490,7 +492,7 @@ Available options are:
490492
}
491493
};
492494
item.check_value = [](const Input_Item& item, const Parameter& para) {
493-
const std::vector<std::string> init_chgs = {"atomic", "file", "wfc", "auto", "dm", "hr"};
495+
const std::vector<std::string> init_chgs = {"atomic", "file", "wfc", "auto", "dm", "dm_no_renormalize", "hr"};
494496
if (std::find(init_chgs.begin(), init_chgs.end(), para.input.init_chg) == init_chgs.end())
495497
{
496498
const std::string warningstr = nofound_str(init_chgs, "init_chg");

source/source_lcao/module_operator_lcao/op_exx_lcao.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ OperatorEXX<OperatorLCAO<TK, TR>>::OperatorEXX(HS_Matrix_K<TK>* hsk_in,
170170
return true;
171171
};
172172

173-
if (PARAM.inp.init_chg == "dm")
173+
if (PARAM.inp.init_chg == "dm" || PARAM.inp.init_chg == "dm_no_renormalize")
174174
{
175175
// 1. cal Cs, Vs
176176
if (GlobalC::exx_info.info_ri.real_number)

source/source_lcao/setup_exx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void Exx_NAO<TK>::before_runner(
6363
}
6464
}
6565
}
66-
else if (inp.calculation == "nscf" && inp.init_chg == "dm")
66+
else if (inp.calculation == "nscf" && (inp.init_chg == "dm" || inp.init_chg == "dm_no_renormalize"))
6767
{
6868
// init exx integration tables for Cs/Vs, but not use symmetry for nscf
6969
if (GlobalC::exx_info.info_global.cal_exx)
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
etotref -5069.1660719143756069
2-
etotperatomref -2534.5830359572
3-
totalforceref 89.291628
4-
totalstressref 2011.565086
1+
etotref -5069.1660720303607377
2+
etotperatomref -2534.5830360152
3+
totalforceref 89.291634
4+
totalstressref 2011.565088
55
totaltimeref 0.33

0 commit comments

Comments
 (0)