Skip to content

Commit bb76e8c

Browse files
committed
Add DeePKS V_delta_R support in doc&value_check.
1 parent 4ad378a commit bb76e8c

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2167,8 +2167,11 @@ Warning: this function is not robust enough for the current version. Please try
21672167

21682168
- **Type**: int
21692169
- **Availability**: numerical atomic orbital basis
2170-
- **Description**: Include V_delta label for DeePKS training. When `deepks_out_labels` is true and `deepks_v_delta` > 0, ABACUS will output h_base.npy, v_delta.npy and h_tot.npy(h_tot=h_base+v_delta).
2171-
Meanwhile, when `deepks_v_delta` equals 1, ABACUS will also output v_delta_precalc.npy, which is used to calculate V_delta during DeePKS training. However, when the number of atoms grows, the size of v_delta_precalc.npy will be very large. In this case, it's recommended to set `deepks_v_delta` as 2, and ABACUS will output phialpha.npy and grad_evdm.npy but not v_delta_precalc.npy. These two files are small and can be used to calculate v_delta_precalc in the procedure of training DeePKS.
2170+
- **Description**: Include V_delta/V_delta_R (Hamiltonian in k/real space) label for DeePKS training. When `deepks_out_labels` is true and `deepks_v_delta` > 0 (k space), ABACUS will output `deepks_hbase.npy`, `deepks_vdelta.npy` and `deepks_htot.npy`(htot=hbase+vdelta). When `deepks_out_labels` is true and `deepks_v_delta` < 0 (real space), ABACUS will output `deepks_hrtot.csr`, `deepks_hrdelta.csr`. Some more files output for different settings.
2171+
- `deepks_v_delta` = 1: `deepks_vdpre.npy`, which is used to calculate V_delta during DeePKS training.
2172+
- `deepks_v_delta` = 2: `deepks_phialpha.npy` and `deepks_gevdm.npy`, which can be used to calculate `deepks_vdpre.npy`. A recommanded method for memory saving.
2173+
- `deepks_v_delta` = -1: `deepks_vdrpre.npy`, which is used to calculate V_delta_R during DeePKS training.
2174+
- `deepks_v_delta` = -2: `deepks_phialpha_r.npy` and `deepks_gevdm.npy`, which can be used to calculate `deepks_vdrpre.npy`. A recommanded method for memory saving.
21722175
- **Default**: 0
21732176

21742177
### deepks_out_unittest

source/module_io/read_input_item_deepks.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,15 @@ void ReadInput::item_deepks()
8585
}
8686
{
8787
Input_Item item("deepks_v_delta");
88-
item.annotation = ">0 for v_delta label. when output, 1 for v_delta_precalc, 2 for phialpha and grad_evdm ( "
89-
"can save memory )";
88+
item.annotation = "!=0 for v_delta/v_delta_R label. when output, 1 for vdpre, 2 for phialpha and grad_evdm (can save memory )"
89+
" -1 for vdrpre, -2 for phialpha_r and gevdm (can save memory)";
9090
read_sync_int(input.deepks_v_delta);
91+
item.check_value = [](const Input_Item& item, const Parameter& para) {
92+
if (para.input.deepks_v_delta < -2 || para.input.deepks_v_delta > 2)
93+
{
94+
ModuleBase::WARNING_QUIT("ReadInput", "deepks_v_delta must be integer in [-2, 2]");
95+
}
96+
};
9197
this->add_item(item);
9298
}
9399
{

0 commit comments

Comments
 (0)