Skip to content

Commit 79ccdb4

Browse files
authored
Fix: Value error of vdrpre in DeePKS. (#6476)
* Fix numerical error in DeePKS vdrpre. * Add a notice for deepks_v_delta.
1 parent 1b891d4 commit 79ccdb4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2258,7 +2258,7 @@ Warning: this function is not robust enough for the current version. Please try
22582258

22592259
- **Type**: int
22602260
- **Availability**: Numerical atomic orbital basis
2261-
- **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.
2261+
- **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. *NOTICE: To match the unit Normally used in DeePKS, the unit of Hamiltonian in k space is Hartree. However, currently in R space the unit is still Ry.*
22622262
- `deepks_v_delta` = 1: `deepks_vdpre.npy`, which is used to calculate V_delta during DeePKS training.
22632263
- `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.
22642264
- `deepks_v_delta` = -1: `deepks_vdrpre.npy`, which is used to calculate V_delta_R during DeePKS training.

source/source_lcao/module_deepks/deepks_vdrpre.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ void DeePKS_domain::cal_vdr_precalc(const int nlocal,
153153
hamilt::BaseMatrix<double>* overlap_1 = phialpha[0]->find_matrix(iat, ibt1, dR1);
154154
hamilt::BaseMatrix<double>* overlap_2 = phialpha[0]->find_matrix(iat, ibt2, dR2);
155155
assert(overlap_1->get_col_size() == overlap_2->get_col_size());
156-
ModuleBase::Vector3<int> dR = dR1 - dR2;
156+
ModuleBase::Vector3<int> dR = dR2 - dR1;
157157
int iRx = DeePKS_domain::mapping_R(dR.x);
158158
int iRy = DeePKS_domain::mapping_R(dR.y);
159159
int iRz = DeePKS_domain::mapping_R(dR.z);

0 commit comments

Comments
 (0)