diff --git a/docs/advanced/input_files/input-main.md b/docs/advanced/input_files/input-main.md index 7e70ec86d6..d91640bdb4 100644 --- a/docs/advanced/input_files/input-main.md +++ b/docs/advanced/input_files/input-main.md @@ -195,7 +195,7 @@ - [bessel\_descriptor\_smooth](#bessel_descriptor_smooth) - [bessel\_descriptor\_sigma](#bessel_descriptor_sigma) - [deepks\_bandgap](#deepks_bandgap) - - [deepks\_bandgap\_range](#deepks_bandgap_range) + - [deepks\_band\_range](#deepks_band_range) - [deepks\_v\_delta](#deepks_v_delta) - [deepks\_out\_unittest](#deepks_out_unittest) - [OFDFT: orbital free density functional theory](#ofdft-orbital-free-density-functional-theory) @@ -2149,20 +2149,19 @@ Warning: this function is not robust enough for the current version. Please try - **Availability**: numerical atomic orbital basis and `deepks_scf` is true - **Description**: include bandgap label for DeePKS training - 0: Don't include bandgap label - - 1: Include HOMO and LOMO for bandgap label - - 2: Include multiple bandgap label (see [deepks\_bandgap\_range](#deepks_bandgap_range) for more details) - - 3: Include target bandgap label (see [deepks\_bandgap\_range](#deepks_bandgap_range) for more details) - - 4: For systems containing H atoms only, HOMO is defined as the max occupation expect H atoms and the bandgap label is the energy between (HOMO, HOMO + 1) + - 1: Include target bandgap label (see [deepks\_band\_range](#deepks_band_range) for more details) + - 2: Include multiple bandgap label (see [deepks\_band\_range](#deepks_band_range) for more details) + - 3: For systems containing H atoms only, HOMO is defined as the max occupation expect H atoms and the bandgap label is the energy between HOMO and (HOMO + 1) - **Default**: 0 -### deepks_bandgap_range +### deepks_band_range - **Type**: Int*2 -- **Availability**: numerical atomic orbital basis, `deepks_scf` is true, and `deepks_bandgap` is 2 or 3 -- **Description**: - - `deepks_bandgap` is 2: Bandgap labels are energies between (LUMO + deepks_bandgap_range[0], HOMO), (LUMO + deepks_bandgap_range[0] + 1, HOMO), ..., (LUMO + deepks_bandgap_range[1], HOMO) except (HOMO, HOMO) - - `deepks_bandgap` is 3: Bandgap label is the energy between (LUMO + deepks_bandgap_range[0], LUMO + deepks_bandgap_range[1]) -- **Default**: 0 0 +- **Availability**: numerical atomic orbital basis, `deepks_scf` is true, and `deepks_bandgap` is 1 or 2 +- **Description**: The first value should not be larger than the second one and the meaning differs in different cases below + - `deepks_bandgap` is 1: Bandgap label is the energy between `LUMO + deepks_band_range[0]` and `LUMO + deepks_band_range[1]`. If not set, it will calculate energy between HOMO and LUMO states. + - `deepks_bandgap` is 2: Bandgap labels are energies between HOMO and all states in range [`LUMO + deepks_band_range[0]`, `LUMO + deepks_band_range[1]`] (Thus there are `deepks_band_range[1] - deepks_band_range[0] + 1` bandgaps in total). If HOMO is included in the setting range, it will be ignored since it will always be zero and has no valuable messages (`deepks_band_range[1] - deepks_band_range[0]` bandgaps in this case). *NOTICE: The set range can be greater than, less than, or include the value of HOMO. In the bandgap label, we always calculate the energy of the state in the set range minus the energy of HOMO state, so the bandgap can be negative if the state is lower than HOMO.* +- **Default**: -1 0 ### deepks_v_delta diff --git a/source/module_hamilt_lcao/module_deepks/LCAO_deepks_interface.cpp b/source/module_hamilt_lcao/module_deepks/LCAO_deepks_interface.cpp index 509ea0cd93..981a8e8050 100644 --- a/source/module_hamilt_lcao/module_deepks/LCAO_deepks_interface.cpp +++ b/source/module_hamilt_lcao/module_deepks/LCAO_deepks_interface.cpp @@ -204,93 +204,58 @@ void LCAO_Deepks_Interface::out_deepks_labels(const double& etot, } // Bandgap Part - if (PARAM.inp.deepks_bandgap == 1) + if (PARAM.inp.deepks_bandgap > 0) { - const int nocc = (PARAM.inp.nelec + 1) / 2; - ModuleBase::matrix o_tot(nks, 1); - for (int iks = 0; iks < nks; ++iks) + // Get the number of the occupied bands + // Notice that the index of band starts from 0, so actually (nocc - 1) is the index of HOMO state + int nocc = (PARAM.inp.nelec + 1) / 2; + if (PARAM.inp.deepks_bandgap == 3) { - // record band gap for each k point (including spin) - o_tot(iks, 0) = ekb(iks, nocc) - ekb(iks, nocc - 1); - } - - const std::string file_otot - = PARAM.globalv.global_out_dir - + (PARAM.inp.deepks_out_labels == 1 ? "deepks_otot.npy" : "deepks_orbital.npy"); - LCAO_deepks_io::save_matrix2npy(file_otot, o_tot, rank); // Unit: Hartree - - if (PARAM.inp.deepks_out_labels == 1) // don't need these when deepks_out_labels == 2 - { - if (PARAM.inp.deepks_scf) + int natom_H = 0; + for (int it = 0; it < ucell.ntype; it++) { - ModuleBase::matrix wg_hl; - std::vector dm_bandgap; - - // Calculate O_delta - wg_hl.create(nks, PARAM.inp.nbands); - dm_bandgap.resize(nks); - wg_hl.zero_out(); - for (int iks = 0; iks < nks; ++iks) + if (ucell.atoms[it].label == "H") { - wg_hl(iks, nocc - 1) = -1.0; - wg_hl(iks, nocc) = 1.0; + natom_H = ucell.atoms[it].na; + break; } - elecstate::cal_dm(ParaV, wg_hl, psi, dm_bandgap); - - ModuleBase::matrix o_delta(nks, 1); - - // calculate and save orbital_precalc: [nks,NAt,NDscrpt] - torch::Tensor orbital_precalc; - DeePKS_domain::cal_orbital_precalc(dm_bandgap, - lmaxd, - inlmax, - nat, - nks, - inl2l, - kvec_d, - phialpha, - gevdm, - inl_index, - ucell, - orb, - *ParaV, - GridD, - orbital_precalc); - DeePKS_domain::cal_o_delta(dm_bandgap, *h_delta, o_delta, *ParaV, nks, nspin); - - // save obase and orbital_precalc - const std::string file_orbpre = PARAM.globalv.global_out_dir + "deepks_orbpre.npy"; - LCAO_deepks_io::save_tensor2npy(file_orbpre, orbital_precalc, rank); + } + nocc = (PARAM.inp.nelec - natom_H) / 2; + } - const std::string file_obase = PARAM.globalv.global_out_dir + "deepks_obase.npy"; - LCAO_deepks_io::save_matrix2npy(file_obase, o_tot - o_delta, rank); // Unit: Hartree - } // end deepks_scf == 1 - else // deepks_scf == 0 + // Get the number of bandgap to be recorded + int range = 1; // normally use only one gap + if (PARAM.inp.deepks_bandgap == 2) // for bandgap label 2, use multi bandgap + { + range = PARAM.inp.deepks_band_range[1] - PARAM.inp.deepks_band_range[0] + 1; + // For cases where HOMO(nocc - 1) is included in the range + if ((PARAM.inp.deepks_band_range[0] <= -1) && (PARAM.inp.deepks_band_range[1] >= -1)) { - const std::string file_obase = PARAM.globalv.global_out_dir + "deepks_obase.npy"; - LCAO_deepks_io::save_matrix2npy(file_obase, o_tot, rank); // no scf, o_tot=o_base - } // end deepks_scf == 0 - } // end deepks_out_labels == 1 - } // end bandgap label + range -= 1; + } + } - if (PARAM.inp.deepks_bandgap == 2) - { - const int nocc = (PARAM.inp.nelec + 1) / 2; - const int range = PARAM.inp.deepks_band_range[1] - PARAM.inp.deepks_band_range[0]; + // Calculate the bandgap for each k point ModuleBase::matrix o_tot(nks, range); for (int iks = 0; iks < nks; ++iks) { - // record band gap for each k point (including spin) - for (int ib = 0; ib <= range; ++ib) + int ib = 0; + if (PARAM.inp.deepks_bandgap == 1 || PARAM.inp.deepks_bandgap == 3) { - if (ib + PARAM.inp.deepks_band_range[0] < -1) - { - o_tot(iks, ib) = ekb(iks, nocc + ib + PARAM.inp.deepks_band_range[0]) - ekb(iks, nocc - 1); - } - if (ib + PARAM.inp.deepks_band_range[0] > -1) + o_tot(iks, ib) = ekb(iks, nocc + PARAM.inp.deepks_band_range[1]) + - ekb(iks, nocc + PARAM.inp.deepks_band_range[0]); + } + else if (PARAM.inp.deepks_bandgap == 2) + { + for (int ir = PARAM.inp.deepks_band_range[0]; ir <= PARAM.inp.deepks_band_range[1]; ++ir) { - o_tot(iks, ib - 1) = ekb(iks, nocc + ib + PARAM.inp.deepks_band_range[0]) - ekb(iks, nocc -1); + if (ir != -1) + { + o_tot(iks, ib) = ekb(iks, nocc + ir) - ekb(iks, nocc - 1); + ib++; + } } + assert(ib == range); // ensure that we have filled all the bandgap values } } @@ -304,236 +269,88 @@ void LCAO_Deepks_Interface::out_deepks_labels(const double& etot, if (PARAM.inp.deepks_scf) { std::vector wg_hl_range(range); - std::vector> dm_bandgap_range(range); + for (int ir = 0; ir < range; ++ir) + { + wg_hl_range[ir].create(nks, PARAM.inp.nbands); + wg_hl_range[ir].zero_out(); + } // Calculate O_delta - for (int ir = 0; ir <= range; ++ir) + for (int iks = 0; iks < nks; ++iks) { - if (ir + PARAM.inp.deepks_band_range[0] < -1) + int ib = 0; + if (PARAM.inp.deepks_bandgap == 1 || PARAM.inp.deepks_bandgap == 3) { - wg_hl_range[ir].create(nks, PARAM.inp.nbands); - wg_hl_range[ir].zero_out(); - dm_bandgap_range[ir].resize(nks); - for (int iks = 0; iks < nks; ++iks) - { - wg_hl_range[ir](iks, nocc - 1) = -1.0; - wg_hl_range[ir](iks, nocc + ir + PARAM.inp.deepks_band_range[0]) = 1.0; - } - elecstate::cal_dm(ParaV, wg_hl_range[ir], psi, dm_bandgap_range[ir]); + wg_hl_range[ib](iks, nocc + PARAM.inp.deepks_band_range[0]) = -1.0; + wg_hl_range[ib](iks, nocc + PARAM.inp.deepks_band_range[1]) = 1.0; } - if (ir + PARAM.inp.deepks_band_range[0] > -1) + else if (PARAM.inp.deepks_bandgap == 2) { - wg_hl_range[ir - 1].create(nks, PARAM.inp.nbands); - wg_hl_range[ir - 1].zero_out(); - dm_bandgap_range[ir - 1].resize(nks); - for (int iks = 0; iks < nks; ++iks) + for (int ir = PARAM.inp.deepks_band_range[0]; ir <= PARAM.inp.deepks_band_range[1]; ++ir) { - wg_hl_range[ir - 1](iks, nocc - 1) = -1.0; - wg_hl_range[ir - 1](iks, nocc + ir + PARAM.inp.deepks_band_range[0]) = 1.0; + if (ir != -1) + { + wg_hl_range[ib](iks, nocc - 1) = -1.0; + wg_hl_range[ib](iks, nocc + ir) = 1.0; + ib++; + } } - elecstate::cal_dm(ParaV, wg_hl_range[ir - 1], psi, dm_bandgap_range[ir - 1]); } } ModuleBase::matrix o_delta(nks, range); - torch::Tensor orbital_precalc_range; - + torch::Tensor orbital_precalc; for (int ir = 0; ir < range; ++ir) { + std::vector dm_bandgap(nks); + elecstate::cal_dm(ParaV, wg_hl_range[ir], psi, dm_bandgap); + torch::Tensor orbital_precalc_temp; ModuleBase::matrix o_delta_temp(nks, 1); - DeePKS_domain::cal_orbital_precalc(dm_bandgap_range[ir], - lmaxd, - inlmax, - nat, - nks, - inl2l, - kvec_d, - phialpha, - gevdm, - inl_index, - ucell, - orb, - *ParaV, - GridD, - orbital_precalc_temp); + DeePKS_domain::cal_orbital_precalc(dm_bandgap, + lmaxd, + inlmax, + nat, + nks, + inl2l, + kvec_d, + phialpha, + gevdm, + inl_index, + ucell, + orb, + *ParaV, + GridD, + orbital_precalc_temp); if (ir == 0) { - orbital_precalc_range = orbital_precalc_temp; + orbital_precalc = orbital_precalc_temp; } else { - orbital_precalc_range = torch::cat({orbital_precalc_range, orbital_precalc_temp}, 0); + orbital_precalc = torch::cat({orbital_precalc, orbital_precalc_temp}, 0); } - DeePKS_domain::cal_o_delta(dm_bandgap_range[ir], *h_delta, o_delta_temp, *ParaV, nks, nspin); + DeePKS_domain::cal_o_delta(dm_bandgap, *h_delta, o_delta_temp, *ParaV, nks, nspin); for (int iks = 0; iks < nks; ++iks) { o_delta(iks, ir) = o_delta_temp(iks, 0); } } - - // save obase and orbital_precalc - const std::string file_orbpre = PARAM.globalv.global_out_dir + "deepks_orbpre.npy"; - LCAO_deepks_io::save_tensor2npy(file_orbpre, orbital_precalc_range, rank); - - const std::string file_obase = PARAM.globalv.global_out_dir + "deepks_obase.npy"; - LCAO_deepks_io::save_matrix2npy(file_obase, o_tot - o_delta, rank); // Unit: Hartree - } // end deepks_scf == 1 - else // deepks_scf == 0 - { - const std::string file_obase = PARAM.globalv.global_out_dir + "deepks_obase.npy"; - LCAO_deepks_io::save_matrix2npy(file_obase, o_tot, rank); // no scf, o_tot=o_base - } // end deepks_scf == 0 - } // end deepks_out_labels == 1 - } // end bandgap label - - if (PARAM.inp.deepks_bandgap == 3) - { - const int nocc = (PARAM.inp.nelec + 1) / 2; - ModuleBase::matrix o_tot(nks, 1); - for (int iks = 0; iks < nks; ++iks) - { - // record band gap for each k point (including spin) - o_tot(iks, 0) = ekb(iks, nocc + PARAM.inp.deepks_band_range[1]) - ekb(iks, nocc + PARAM.inp.deepks_band_range[0]); - } - - const std::string file_otot - = PARAM.globalv.global_out_dir - + (PARAM.inp.deepks_out_labels == 1 ? "deepks_otot.npy" : "deepks_orbital.npy"); - LCAO_deepks_io::save_matrix2npy(file_otot, o_tot, rank); // Unit: Hartree - - if (PARAM.inp.deepks_out_labels == 1) // don't need these when deepks_out_labels == 2 - { - if (PARAM.inp.deepks_scf) - { - ModuleBase::matrix wg_hl; - std::vector dm_bandgap; - - // Calculate O_delta - wg_hl.create(nks, PARAM.inp.nbands); - dm_bandgap.resize(nks); - wg_hl.zero_out(); - for (int iks = 0; iks < nks; ++iks) - { - wg_hl(iks, nocc + PARAM.inp.deepks_band_range[0]) = -1.0; - wg_hl(iks, nocc + PARAM.inp.deepks_band_range[1]) = 1.0; - } - elecstate::cal_dm(ParaV, wg_hl, psi, dm_bandgap); - - ModuleBase::matrix o_delta(nks, 1); - - // calculate and save orbital_precalc: [nks,NAt,NDscrpt] - torch::Tensor orbital_precalc; - DeePKS_domain::cal_orbital_precalc(dm_bandgap, - lmaxd, - inlmax, - nat, - nks, - inl2l, - kvec_d, - phialpha, - gevdm, - inl_index, - ucell, - orb, - *ParaV, - GridD, - orbital_precalc); - DeePKS_domain::cal_o_delta(dm_bandgap, *h_delta, o_delta, *ParaV, nks, nspin); - // save obase and orbital_precalc const std::string file_orbpre = PARAM.globalv.global_out_dir + "deepks_orbpre.npy"; LCAO_deepks_io::save_tensor2npy(file_orbpre, orbital_precalc, rank); const std::string file_obase = PARAM.globalv.global_out_dir + "deepks_obase.npy"; LCAO_deepks_io::save_matrix2npy(file_obase, o_tot - o_delta, rank); // Unit: Hartree - } // end deepks_scf == 1 - else // deepks_scf == 0 - { - const std::string file_obase = PARAM.globalv.global_out_dir + "deepks_obase.npy"; - LCAO_deepks_io::save_matrix2npy(file_obase, o_tot, rank); // no scf, o_tot=o_base - } // end deepks_scf == 0 - } // end deepks_out_labels == 1 - } // end bandgap label - - if (PARAM.inp.deepks_bandgap == 4) - { - int natom_H = 0; - for(int it = 0; it < ucell.ntype; it++) - { - if(ucell.atoms[it].label == "H") - { - natom_H = ucell.atoms[it].na; - break; } - } - const int nocc = (PARAM.inp.nelec - natom_H) / 2; - ModuleBase::matrix o_tot(nks, 1); - for (int iks = 0; iks < nks; ++iks) - { - // record band gap for each k point (including spin) - o_tot(iks, 0) = ekb(iks, nocc) - ekb(iks, nocc - 1); - } - - const std::string file_otot - = PARAM.globalv.global_out_dir - + (PARAM.inp.deepks_out_labels == 1 ? "deepks_otot.npy" : "deepks_orbital.npy"); - LCAO_deepks_io::save_matrix2npy(file_otot, o_tot, rank); // Unit: Hartree - - if (PARAM.inp.deepks_out_labels == 1) // don't need these when deepks_out_labels == 2 - { - if (PARAM.inp.deepks_scf) - { - ModuleBase::matrix wg_hl; - std::vector dm_bandgap; - - // Calculate O_delta - wg_hl.create(nks, PARAM.inp.nbands); - dm_bandgap.resize(nks); - wg_hl.zero_out(); - for (int iks = 0; iks < nks; ++iks) - { - wg_hl(iks, nocc - 1) = -1.0; - wg_hl(iks, nocc) = 1.0; - } - elecstate::cal_dm(ParaV, wg_hl, psi, dm_bandgap); - - ModuleBase::matrix o_delta(nks, 1); - - // calculate and save orbital_precalc: [nks,NAt,NDscrpt] - torch::Tensor orbital_precalc; - DeePKS_domain::cal_orbital_precalc(dm_bandgap, - lmaxd, - inlmax, - nat, - nks, - inl2l, - kvec_d, - phialpha, - gevdm, - inl_index, - ucell, - orb, - *ParaV, - GridD, - orbital_precalc); - DeePKS_domain::cal_o_delta(dm_bandgap, *h_delta, o_delta, *ParaV, nks, nspin); - - // save obase and orbital_precalc - const std::string file_orbpre = PARAM.globalv.global_out_dir + "deepks_orbpre.npy"; - LCAO_deepks_io::save_tensor2npy(file_orbpre, orbital_precalc, rank); - - const std::string file_obase = PARAM.globalv.global_out_dir + "deepks_obase.npy"; - LCAO_deepks_io::save_matrix2npy(file_obase, o_tot - o_delta, rank); // Unit: Hartree - } // end deepks_scf == 1 - else // deepks_scf == 0 + else // deepks_scf == 0 { const std::string file_obase = PARAM.globalv.global_out_dir + "deepks_obase.npy"; LCAO_deepks_io::save_matrix2npy(file_obase, o_tot, rank); // no scf, o_tot=o_base } // end deepks_scf == 0 } // end deepks_out_labels == 1 - } // end bandgap label + } // not add deepks_out_labels = 2 for HR yet // H(R) matrix part, for HR, base will not be calculated since they are HContainer objects diff --git a/source/module_io/read_input_item_deepks.cpp b/source/module_io/read_input_item_deepks.cpp index aa4f9603ac..3552b7bed7 100644 --- a/source/module_io/read_input_item_deepks.cpp +++ b/source/module_io/read_input_item_deepks.cpp @@ -19,13 +19,13 @@ void ReadInput::item_deepks() read_sync_bool(input.deepks_scf); item.check_value = [](const Input_Item& item, const Parameter& para) { #ifndef __DEEPKS - if (PARAM.inp.deepks_scf || PARAM.inp.deepks_out_labels || PARAM.inp.deepks_bandgap - || PARAM.inp.deepks_v_delta) + if (para.input.deepks_scf || para.input.deepks_out_labels || para.input.deepks_bandgap + || para.input.deepks_v_delta) { ModuleBase::WARNING_QUIT("Input_conv", "please compile with DeePKS"); } #endif - // if (!PARAM.inp.deepks_scf && PARAM.inp.deepks_out_labels == 1) + // if (!para.input.deepks_scf && para.input.deepks_out_labels == 1) // { // ModuleBase::WARNING_QUIT("Input_conv", "deepks_out_labels = 1 requires deepks_scf = 1"); // } @@ -58,6 +58,29 @@ void ReadInput::item_deepks() para.input.deepks_band_range[1] = std::stod(item.str_values[1]); }; sync_intvec(input.deepks_band_range, 2, 0); + item.check_value = [](const Input_Item& item, const Parameter& para) { + if (para.input.deepks_bandgap == 1) + { + if (para.input.deepks_band_range[0] >= para.input.deepks_band_range[1]) + { + ModuleBase::WARNING_QUIT("ReadInput", "deepks_band_range[0] must be smaller than deepks_band_range[1] for deepks_bandgap = 1."); + } + } + else if (para.input.deepks_bandgap == 2) + { + if (para.input.deepks_band_range[0] > para.input.deepks_band_range[1]) + { + ModuleBase::WARNING_QUIT("ReadInput", "deepks_band_range[0] must be no more than deepks_band_range[1] for deepks_bandgap = 2."); + } + } + else + { + if (para.input.deepks_band_range[0] != -1 || para.input.deepks_band_range[1] != 0) + { + ModuleBase::WARNING("ReadInput", "deepks_band_range is used for deepks_bandgap = 1/2. Ignore its setting for other cases."); + } + } + }; this->add_item(item); } { diff --git a/source/module_parameter/input_parameter.h b/source/module_parameter/input_parameter.h index 69e697b8c7..53683194d6 100644 --- a/source/module_parameter/input_parameter.h +++ b/source/module_parameter/input_parameter.h @@ -265,7 +265,7 @@ struct Input_para bool deepks_scf = false; ///< (need libnpy and libtorch) if set to true, a trained model ///< would be needed to calculate V_delta and F_delta int deepks_bandgap = 0; ///< for bandgap label. QO added 2021-12-15 - std::vector deepks_band_range = {0, 0}; ///< the range of bands to calculate bandgap + std::vector deepks_band_range = {-1, 0}; ///< the range of bands to calculate bandgap int deepks_v_delta = 0; ///< for v_delta label. xuan added bool deepks_equiv = false; ///< whether to use equivariant version of DeePKS bool deepks_out_unittest = false; ///< if set to true, prints intermediate quantities that shall diff --git a/tests/09_DeePKS/103_NO_GO_deepks_bandgap/INPUT b/tests/09_DeePKS/103_NO_GO_deepks_bandgap/INPUT index bf00a247bc..e63ac26817 100644 --- a/tests/09_DeePKS/103_NO_GO_deepks_bandgap/INPUT +++ b/tests/09_DeePKS/103_NO_GO_deepks_bandgap/INPUT @@ -21,3 +21,4 @@ deepks_scf 1 deepks_model ../Model_ProjOrb/model_lda_pbe_18.ptg deepks_out_labels 1 deepks_bandgap 1 +deepks_band_range -1 0 diff --git a/tests/09_DeePKS/103_NO_GO_deepks_bandgap_3/INPUT b/tests/09_DeePKS/103_NO_GO_deepks_bandgap_3/INPUT index 4f7f92b5db..a7293e9d74 100644 --- a/tests/09_DeePKS/103_NO_GO_deepks_bandgap_3/INPUT +++ b/tests/09_DeePKS/103_NO_GO_deepks_bandgap_3/INPUT @@ -21,4 +21,3 @@ deepks_scf 1 deepks_model ../Model_ProjOrb/model_lda_pbe_18.ptg deepks_out_labels 1 deepks_bandgap 3 -deepks_band_range -1 0 diff --git a/tests/09_DeePKS/103_NO_GO_deepks_bandgap_4/INPUT b/tests/09_DeePKS/103_NO_GO_deepks_bandgap_4/INPUT deleted file mode 100644 index 68d05ed247..0000000000 --- a/tests/09_DeePKS/103_NO_GO_deepks_bandgap_4/INPUT +++ /dev/null @@ -1,23 +0,0 @@ -INPUT_PARAMETERS -suffix autotest -calculation scf - -ecutwfc 50 -scf_thr 1e-6 -scf_nmax 35 -pseudo_dir ../../PP_ORB -orbital_dir ../../PP_ORB -basis_type lcao -dft_functional lda -gamma_only 1 -mixing_type broyden -mixing_beta 0.8 -smearing_method gaussian -smearing_sigma 0.02 - -cal_force 0 -cal_stress 0 -deepks_scf 1 -deepks_model ../Model_ProjOrb/model_lda_pbe_18.ptg -deepks_out_labels 1 -deepks_bandgap 4 diff --git a/tests/09_DeePKS/103_NO_GO_deepks_bandgap_4/KPT b/tests/09_DeePKS/103_NO_GO_deepks_bandgap_4/KPT deleted file mode 100644 index c289c0158a..0000000000 --- a/tests/09_DeePKS/103_NO_GO_deepks_bandgap_4/KPT +++ /dev/null @@ -1,4 +0,0 @@ -K_POINTS -0 -Gamma -1 1 1 0 0 0 diff --git a/tests/09_DeePKS/103_NO_GO_deepks_bandgap_4/README b/tests/09_DeePKS/103_NO_GO_deepks_bandgap_4/README deleted file mode 100644 index 85883a384c..0000000000 --- a/tests/09_DeePKS/103_NO_GO_deepks_bandgap_4/README +++ /dev/null @@ -1 +0,0 @@ -test bandgap label (deepks_bandgap = 4) output for deepks_out_labels = 1, for gamma_only H2O molecule \ No newline at end of file diff --git a/tests/09_DeePKS/103_NO_GO_deepks_bandgap_4/STRU b/tests/09_DeePKS/103_NO_GO_deepks_bandgap_4/STRU deleted file mode 100644 index e0342e22f2..0000000000 --- a/tests/09_DeePKS/103_NO_GO_deepks_bandgap_4/STRU +++ /dev/null @@ -1,32 +0,0 @@ -ATOMIC_SPECIES -H 1.00 H_ONCV_PBE-1.0.upf -O 1.00 O_ONCV_PBE-1.0.upf - - -LATTICE_CONSTANT -1 - -LATTICE_VECTORS -15 0 0 -0 15 0 -0 0 15 - -ATOMIC_POSITIONS -Cartesian # Cartesian(Unit is LATTICE_CONSTANT) - -H -0.0 -2 -2.451268787740 18.304568063522 29.094778093001 0 0 0 -0.634768813069 17.692018052980 31.090158495369 0 0 0 -O -0.0 -1 -0.953925982272 17.270156608314 29.386199785767 0 0 0 - -NUMERICAL_ORBITAL -./1_H_gga_100Ry_7au_2s1p.orb -./8_O_gga_100Ry_7au_2s2p1d.orb - -NUMERICAL_DESCRIPTOR -../Model_ProjOrb/2au_20Ry_jle.orb diff --git a/tests/09_DeePKS/103_NO_GO_deepks_bandgap_4/result.ref b/tests/09_DeePKS/103_NO_GO_deepks_bandgap_4/result.ref deleted file mode 100644 index b4a2174c4a..0000000000 --- a/tests/09_DeePKS/103_NO_GO_deepks_bandgap_4/result.ref +++ /dev/null @@ -1,10 +0,0 @@ -etotref -466.7530905050443 -etotperatomref -155.5843635017 -deepks_desc 2.297551 -deepks_dm_eig 10.742704784158393 -deepks_e_label 17.152853550955058 -deepks_edelta 0.09792547271228358 -deepks_o_label 0.29172556580830844 -deepks_odelta 9.932412417318348e-05 -deepks_oprec -0.45169372175959677 -totaltimeref 1.22 diff --git a/tests/09_DeePKS/103_NO_KP_deepks_bandgap/INPUT b/tests/09_DeePKS/103_NO_KP_deepks_bandgap/INPUT index fb1b56b93a..9437c80975 100644 --- a/tests/09_DeePKS/103_NO_KP_deepks_bandgap/INPUT +++ b/tests/09_DeePKS/103_NO_KP_deepks_bandgap/INPUT @@ -20,5 +20,6 @@ cal_stress 0 deepks_scf 1 deepks_out_labels 1 deepks_bandgap 1 +deepks_band_range -1 0 deepks_model ../Model_ProjOrb/model_lda_pbe_18.ptg symmetry_prec 1e-5 diff --git a/tests/09_DeePKS/103_NO_KP_deepks_bandgap_3/INPUT b/tests/09_DeePKS/103_NO_KP_deepks_bandgap_3/INPUT index 826caa2627..a1db172bb7 100644 --- a/tests/09_DeePKS/103_NO_KP_deepks_bandgap_3/INPUT +++ b/tests/09_DeePKS/103_NO_KP_deepks_bandgap_3/INPUT @@ -20,6 +20,5 @@ cal_stress 0 deepks_scf 1 deepks_out_labels 1 deepks_bandgap 3 -deepks_band_range -1 0 deepks_model ../Model_ProjOrb/model_lda_pbe_18.ptg symmetry_prec 1e-5 diff --git a/tests/09_DeePKS/103_NO_KP_deepks_bandgap_4/INPUT b/tests/09_DeePKS/103_NO_KP_deepks_bandgap_4/INPUT deleted file mode 100644 index fa0f78357d..0000000000 --- a/tests/09_DeePKS/103_NO_KP_deepks_bandgap_4/INPUT +++ /dev/null @@ -1,24 +0,0 @@ -INPUT_PARAMETERS -calculation scf -suffix autotest -pseudo_dir ../../PP_ORB -orbital_dir ../../PP_ORB - -ecutwfc 50 -scf_thr 1e-06 -scf_nmax 35 -basis_type lcao -dft_functional lda -gamma_only 0 -mixing_type broyden -mixing_beta 0.8 -smearing_method gaussian -smearing_sigma 0.02 - -cal_force 0 -cal_stress 0 -deepks_scf 1 -deepks_out_labels 1 -deepks_bandgap 4 -deepks_model ../Model_ProjOrb/model_lda_pbe_18.ptg -symmetry_prec 1e-5 diff --git a/tests/09_DeePKS/103_NO_KP_deepks_bandgap_4/KPT b/tests/09_DeePKS/103_NO_KP_deepks_bandgap_4/KPT deleted file mode 100644 index d360afb615..0000000000 --- a/tests/09_DeePKS/103_NO_KP_deepks_bandgap_4/KPT +++ /dev/null @@ -1,4 +0,0 @@ -K_POINTS -0 -Gamma -1 1 2 0 0 0 \ No newline at end of file diff --git a/tests/09_DeePKS/103_NO_KP_deepks_bandgap_4/README b/tests/09_DeePKS/103_NO_KP_deepks_bandgap_4/README deleted file mode 100644 index 8616111c1f..0000000000 --- a/tests/09_DeePKS/103_NO_KP_deepks_bandgap_4/README +++ /dev/null @@ -1 +0,0 @@ -test bandgap label (deepks_bandgap = 4) output for deepks_out_labels = 1, for multi-k 1D SiO2 chain \ No newline at end of file diff --git a/tests/09_DeePKS/103_NO_KP_deepks_bandgap_4/STRU b/tests/09_DeePKS/103_NO_KP_deepks_bandgap_4/STRU deleted file mode 100644 index d96524cc65..0000000000 --- a/tests/09_DeePKS/103_NO_KP_deepks_bandgap_4/STRU +++ /dev/null @@ -1,32 +0,0 @@ -ATOMIC_SPECIES -Si 1.00 Si_ONCV_PBE-1.2.upf -O 1.00 O_ONCV_PBE-1.2.upf - - -LATTICE_CONSTANT -1 - -LATTICE_VECTORS -15 0 0 -0 15 0 -0 0 9 - -ATOMIC_POSITIONS -Direct # Cartesian(Unit is LATTICE_CONSTANT) - -Si -0.0 -1 -0.5 0.5 0 0 0 0 -O -0.0 -2 -0.5 0.5 0.25 0 0 0 -0.5 0.5 0.75 0 0 0 - -NUMERICAL_ORBITAL -Si_gga_8au_60Ry_2s2p1d.orb -O_gga_7au_60Ry_2s2p1d.orb - -NUMERICAL_DESCRIPTOR -../Model_ProjOrb/2au_20Ry_jle.orb diff --git a/tests/09_DeePKS/103_NO_KP_deepks_bandgap_4/result.ref b/tests/09_DeePKS/103_NO_KP_deepks_bandgap_4/result.ref deleted file mode 100644 index 1582fefe3b..0000000000 --- a/tests/09_DeePKS/103_NO_KP_deepks_bandgap_4/result.ref +++ /dev/null @@ -1,10 +0,0 @@ -etotref -959.2783700856231 -etotperatomref -319.7594566952 -deepks_desc 2.456992 -deepks_dm_eig 15.506898379534249 -deepks_e_label 35.25281724192405 -deepks_edelta 0.09772974729136052 -deepks_o_label 0.3368945080257191 -deepks_odelta 0.0014646771995326935 -deepks_oprec -1.2637665734018695 -totaltimeref 1.53 diff --git a/tests/09_DeePKS/CASES_CPU.txt b/tests/09_DeePKS/CASES_CPU.txt index 3ee06e5f1b..153f74fe2b 100644 --- a/tests/09_DeePKS/CASES_CPU.txt +++ b/tests/09_DeePKS/CASES_CPU.txt @@ -14,11 +14,9 @@ 103_NO_GO_deepks_bandgap 103_NO_GO_deepks_bandgap_2 103_NO_GO_deepks_bandgap_3 -103_NO_GO_deepks_bandgap_4 103_NO_KP_deepks_bandgap 103_NO_KP_deepks_bandgap_2 103_NO_KP_deepks_bandgap_3 -103_NO_KP_deepks_bandgap_4 103_NO_GO_deepks_vdelta_1 103_NO_KP_deepks_vdelta_1 103_NO_GO_deepks_vdelta_2