diff --git a/docs/advanced/input_files/input-main.md b/docs/advanced/input_files/input-main.md index 17615f6174..873220cd66 100644 --- a/docs/advanced/input_files/input-main.md +++ b/docs/advanced/input_files/input-main.md @@ -651,7 +651,7 @@ ### bndpar - **Type**: Integer -- **Description**: Divide all processors into bndpar groups, and bands (only stochastic orbitals now) will be distributed among each group. It should be larger than 0. +- **Description**: Divide all processors into bndpar groups for SDFT or the BPCG solver. bndpar must be positive, no greater than the number of MPI processes, and kpar * bndpar must divide the number of MPI processes exactly. - **Default**: 1 ### latname @@ -1263,7 +1263,7 @@ - **Description**: The number of spin components of wave functions. - 1: Spin degeneracy - 2: Collinear spin polarized. - - 4: For the case of noncollinear polarized, nspin will be automatically set to 4 without being specified by the user. + - 4: Noncollinear or spin-orbit calculations. Set nspin to 4 explicitly when noncolin or lspinorb is enabled. - **Default**: 1 ### smearing_method @@ -1467,7 +1467,7 @@ - **Type**: Boolean - **Description**: Whether to consider spin-orbit coupling (SOC) effect in the calculation. - True: Consider spin-orbit coupling effect. When enabled: - - nspin is automatically set to 4 (noncollinear spin representation) + - nspin must be explicitly set to 4 (noncollinear spin representation) - Symmetry is automatically disabled (SOC breaks inversion symmetry) - Requires full-relativistic pseudopotentials with has_so=true in the UPF header - False: Do not consider spin-orbit coupling effect. @@ -1479,7 +1479,7 @@ - **Type**: Boolean - **Description**: Whether to allow non-collinear magnetic moments, where magnetization can point in arbitrary directions (x, y, z components) rather than being constrained to the z-axis. - True: Allow non-collinear polarization. When enabled: - - nspin is automatically set to 4 + - nspin must be explicitly set to 4 - Wave function dimension is doubled (npol=2), and the number of occupied states is doubled - Charge density has 4 components (Pauli spin matrices) - Cannot be used with gamma_only=true @@ -1533,8 +1533,8 @@ - **Type**: Integer or string - **Availability**: *esolver_type = sdft* - **Description**: The number of stochastic orbitals - - > 0: Perform stochastic DFT. Increasing the number of bands improves accuracy and reduces stochastic errors; To perform mixed stochastic-deterministic DFT, you should set nbands, which represents the number of KS orbitals. - - 0: Perform Kohn-Sham DFT. + - 1-1000000: Perform stochastic DFT. Increasing the number of bands improves accuracy and reduces stochastic errors; To perform mixed stochastic-deterministic DFT, you should set nbands, which represents the number of KS orbitals. + - 0: Invalid. Use all for the complete-basis SDFT mode. - all: All complete basis sets are used to replace stochastic orbitals with the Chebyshev method (CT), resulting in the same results as KSDFT without stochastic errors. - **Default**: 256 diff --git a/docs/advanced/scf/spin.md b/docs/advanced/scf/spin.md index 1749db156d..0da2ad7cbc 100644 --- a/docs/advanced/scf/spin.md +++ b/docs/advanced/scf/spin.md @@ -30,11 +30,11 @@ If **"nupdown"** is set to non-zero, number of spin-up and spin-down electrons w ## Noncollinear Spin Polarized Calculations The spin non-collinear polarization calculation corresponds to setting **"noncolin 1"**, in which case the coupling between spin up and spin down will be taken into account. -In this case, nspin is automatically set to 4, which is usually not required to be specified manually. +In this case, **"nspin 4"** must also be specified. ABACUS reports an input error instead of silently changing an incompatible or omitted nspin value. The weight of each band will not change, but the number of occupied states will be double. If the nbands parameter is set manually, it is generally set to twice what it would be when nspin<4. -In general, non-collinear magnetic moment settings are often used in calculations considering [SOC effects](#soc-effects). When **"lspinorb 1"** in INPUT file, "nspin" is also automatically set to 4. +In general, non-collinear magnetic moment settings are often used in calculations considering [SOC effects](#soc-effects). When **"lspinorb 1"** is set in INPUT, **"nspin 4"** is also required. Note: different settings for "noncolin" and "lspinorb" correspond to different calculations: @@ -119,22 +119,22 @@ Example from a full-relativistic UPF file: - **PseudoDOJO**: Provides both scalar and full-relativistic versions - **ABACUS official**: [abacus.ustc.edu.cn](http://abacus.ustc.edu.cn/pseudo/list.htm) -## Automatic Parameter Settings +## Parameter Requirements and Automatic Settings -When using SOC or non-collinear calculations, ABACUS automatically adjusts several parameters: +When using SOC or non-collinear calculations, set the required spin representation explicitly. ABACUS still derives internal spin state and some related settings after validating the input: ### When `lspinorb=true`: -1. **nspin**: Automatically set to 4 (noncollinear spin representation) +1. **nspin**: Must be explicitly set to 4 (noncollinear spin representation) 2. **Symmetry**: Automatically disabled (`symm_flag=-1`) because SOC breaks inversion symmetry 3. **Magnetization**: NOT automatically set when `noncolin=0` (implies non-magnetic material with SOC) ### When `noncolin=true`: -1. **nspin**: Automatically set to 4 +1. **nspin**: Must be explicitly set to 4 2. **npol**: Set to 2 (wave function has two spinor components) 3. **Magnetization**: Automatically set if user provides zero values (unless `lspinorb=1` and `noncolin=0`) ### Important Notes: -- You do NOT need to manually set `nspin=4` when using `lspinorb=1` or `noncolin=1` +- You must set `nspin=4` when using `lspinorb=1` or `noncolin=1`; missing or incompatible values are rejected during input validation - Symmetry operations are incompatible with SOC, so they are automatically turned off - For `lspinorb=1, noncolin=0`: This is a special case for non-magnetic materials with SOC, where magnetization is not initialized @@ -172,7 +172,7 @@ basis_type pw ecutwfc 50 lspinorb 1 # Enable SOC noncolin 0 # No non-collinear magnetism -# nspin will be automatically set to 4 +nspin 4 # Required spinor representation # symmetry will be automatically disabled ``` @@ -185,7 +185,7 @@ calculation scf basis_type lcao lspinorb 0 # No SOC noncolin 1 # Enable non-collinear magnetism -# nspin will be automatically set to 4 +nspin 4 # Required spinor representation # Magnetization directions should be specified in STRU file ``` @@ -199,7 +199,7 @@ basis_type pw ecutwfc 60 lspinorb 1 # Enable SOC noncolin 1 # Enable non-collinear magnetism -# nspin will be automatically set to 4 +nspin 4 # Required spinor representation # symmetry will be automatically disabled # Magnetization directions should be specified in STRU file ``` @@ -213,6 +213,7 @@ calculation scf basis_type pw ecutwfc 50 lspinorb 1 # Enable SOC +nspin 4 # Required spinor representation soc_lambda 0.5 # 50% SOC strength # Useful when full SOC overestimates or underestimates experimental results ``` diff --git a/docs/community/faq.md b/docs/community/faq.md index 1e372a180d..c5b4e4c9a7 100644 --- a/docs/community/faq.md +++ b/docs/community/faq.md @@ -50,7 +50,7 @@ To perform SOC calculations in ABACUS, follow these steps: 2. **Use full-relativistic pseudopotentials**: SOC calculations require pseudopotentials with `has_so=true` in the UPF header - Download full-relativistic versions of SG15_ONCV pseudopotentials from [quantum-simulation.org](http://quantum-simulation.org/potentials/sg15_oncv/upf/) - Check the UPF file header for `relativistic="full"` and `has_so="T"` -3. **Verify automatic settings**: When `lspinorb=1` is set, `nspin` is automatically set to 4 and symmetry is automatically disabled +3. **Set the spin representation**: When `lspinorb=1` is set, explicitly set `nspin=4`; symmetry is automatically disabled **Basis set support**: Both `basis_type=pw` (plane wave) and `basis_type=lcao` (numerical atomic orbitals) support SOC calculations for both SCF and NSCF. diff --git a/docs/parameters.yaml b/docs/parameters.yaml index afaf399bc9..6ef6821699 100644 --- a/docs/parameters.yaml +++ b/docs/parameters.yaml @@ -108,7 +108,7 @@ parameters: category: System variables type: Integer description: | - Divide all processors into bndpar groups, and bands (only stochastic orbitals now) will be distributed among each group. It should be larger than 0. + Divide all processors into bndpar groups for SDFT or the BPCG solver. bndpar must be positive, no greater than the number of MPI processes, and kpar * bndpar must divide the number of MPI processes exactly. default_value: "1" unit: "" availability: "" @@ -661,7 +661,7 @@ parameters: The number of spin components of wave functions. * 1: Spin degeneracy * 2: Collinear spin polarized. - * 4: For the case of noncollinear polarized, nspin will be automatically set to 4 without being specified by the user. + * 4: Noncollinear or spin-orbit calculations. Set nspin to 4 explicitly when noncolin or lspinorb is enabled. default_value: "1" unit: "" availability: "" @@ -906,7 +906,7 @@ parameters: description: | Whether to consider spin-orbit coupling (SOC) effect in the calculation. * True: Consider spin-orbit coupling effect. When enabled: - * nspin is automatically set to 4 (noncollinear spin representation) + * nspin must be explicitly set to 4 (noncollinear spin representation) * Symmetry is automatically disabled (SOC breaks inversion symmetry) * Requires full-relativistic pseudopotentials with has_so=true in the UPF header * False: Do not consider spin-orbit coupling effect. @@ -920,7 +920,7 @@ parameters: description: | Whether to allow non-collinear magnetic moments, where magnetization can point in arbitrary directions (x, y, z components) rather than being constrained to the z-axis. * True: Allow non-collinear polarization. When enabled: - * nspin is automatically set to 4 + * nspin must be explicitly set to 4 * Wave function dimension is doubled (npol=2), and the number of occupied states is doubled * Charge density has 4 components (Pauli spin matrices) * Cannot be used with gamma_only=true @@ -2198,8 +2198,8 @@ parameters: type: Integer or string description: | The number of stochastic orbitals - * > 0: Perform stochastic DFT. Increasing the number of bands improves accuracy and reduces stochastic errors; To perform mixed stochastic-deterministic DFT, you should set nbands, which represents the number of KS orbitals. - * 0: Perform Kohn-Sham DFT. + * 1-1000000: Perform stochastic DFT. Increasing the number of bands improves accuracy and reduces stochastic errors; To perform mixed stochastic-deterministic DFT, you should set nbands, which represents the number of KS orbitals. + * 0: Invalid. Use all for the complete-basis SDFT mode. * all: All complete basis sets are used to replace stochastic orbitals with the Chebyshev method (CT), resulting in the same results as KSDFT without stochastic errors. default_value: "256" unit: "" diff --git a/examples/21_deepks/03_lcao_CsPbI3/INPUT b/examples/21_deepks/03_lcao_CsPbI3/INPUT index 499726f72d..e0189b5321 100644 --- a/examples/21_deepks/03_lcao_CsPbI3/INPUT +++ b/examples/21_deepks/03_lcao_CsPbI3/INPUT @@ -29,6 +29,7 @@ deepks_model model.ptg #Parameters (7.SOC) lspinorb 1 +nspin 4 diff --git a/source/source_io/module_parameter/read_input_item_elec_stru.cpp b/source/source_io/module_parameter/read_input_item_elec_stru.cpp index bc5ff4f4de..3cd51f3213 100644 --- a/source/source_io/module_parameter/read_input_item_elec_stru.cpp +++ b/source/source_io/module_parameter/read_input_item_elec_stru.cpp @@ -482,22 +482,20 @@ The other way is only available when compiling with LIBXC, and it allows for sup item.description = R"(The number of spin components of wave functions. * 1: Spin degeneracy * 2: Collinear spin polarized. -* 4: For the case of noncollinear polarized, nspin will be automatically set to 4 without being specified by the user.)"; +* 4: Noncollinear or spin-orbit calculations. Set nspin to 4 explicitly when noncolin or lspinorb is enabled.)"; item.default_value = "1"; item.unit = ""; item.availability = ""; read_sync_int(input.nspin); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.noncolin || para.input.lspinorb) - { - para.input.nspin = 4; - } - }; item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.nspin != 1 && para.input.nspin != 2 && para.input.nspin != 4) { ModuleBase::WARNING_QUIT("ReadInput", "nspin should be 1, 2 or 4."); } + if ((para.input.noncolin || para.input.lspinorb) && para.input.nspin != 4) + { + ModuleBase::WARNING_QUIT("ReadInput", "nspin must be 4 when noncolin or lspinorb is enabled."); + } }; this->add_item(item); } @@ -986,7 +984,7 @@ Note: If gamma_only is set to 1, the KPT file will be overwritten. So make sure item.type = "Boolean"; item.description = R"(Whether to consider spin-orbit coupling (SOC) effect in the calculation. * True: Consider spin-orbit coupling effect. When enabled: - * nspin is automatically set to 4 (noncollinear spin representation) + * nspin must be explicitly set to 4 (noncollinear spin representation) * Symmetry is automatically disabled (SOC breaks inversion symmetry) * Requires full-relativistic pseudopotentials with has_so=true in the UPF header * False: Do not consider spin-orbit coupling effect. @@ -1004,7 +1002,7 @@ Note: If gamma_only is set to 1, the KPT file will be overwritten. So make sure item.type = "Boolean"; item.description = R"(Whether to allow non-collinear magnetic moments, where magnetization can point in arbitrary directions (x, y, z components) rather than being constrained to the z-axis. * True: Allow non-collinear polarization. When enabled: - * nspin is automatically set to 4 + * nspin must be explicitly set to 4 * Wave function dimension is doubled (npol=2), and the number of occupied states is doubled * Charge density has 4 components (Pauli spin matrices) * Cannot be used with gamma_only=true diff --git a/source/source_io/module_parameter/read_input_item_sdft.cpp b/source/source_io/module_parameter/read_input_item_sdft.cpp index b57a2ce797..2df4f2d661 100644 --- a/source/source_io/module_parameter/read_input_item_sdft.cpp +++ b/source/source_io/module_parameter/read_input_item_sdft.cpp @@ -1,8 +1,9 @@ -#include "source_base/global_function.h" #include "source_base/tool_quit.h" #include "read_input.h" #include "read_input_tool.h" +#include + namespace ModuleIO { void ReadInput::item_sdft() @@ -37,8 +38,8 @@ void ReadInput::item_sdft() item.category = "Electronic structure (SDFT)"; item.type = "Integer or string"; item.description = R"(The number of stochastic orbitals -* > 0: Perform stochastic DFT. Increasing the number of bands improves accuracy and reduces stochastic errors; To perform mixed stochastic-deterministic DFT, you should set nbands, which represents the number of KS orbitals. -* 0: Perform Kohn-Sham DFT. +* 1-1000000: Perform stochastic DFT. Increasing the number of bands improves accuracy and reduces stochastic errors; To perform mixed stochastic-deterministic DFT, you should set nbands, which represents the number of KS orbitals. +* 0: Invalid. Use all for the complete-basis SDFT mode. * all: All complete basis sets are used to replace stochastic orbitals with the Chebyshev method (CT), resulting in the same results as KSDFT without stochastic errors.)"; item.default_value = "256"; item.unit = ""; @@ -47,28 +48,32 @@ void ReadInput::item_sdft() std::string nbandsto_str = strvalue; if (nbandsto_str != "all") { - para.input.nbands_sto = std::stoi(nbandsto_str); + std::size_t parsed_chars = 0; + try + { + para.input.nbands_sto = std::stoi(nbandsto_str, &parsed_chars); + } + catch (const std::exception&) + { + ModuleBase::WARNING_QUIT("ReadInput", + "nbands_sto should be in the range of 1 to 1000000 or be all"); + } + if (parsed_chars != nbandsto_str.size()) + { + ModuleBase::WARNING_QUIT("ReadInput", + "nbands_sto should be in the range of 1 to 1000000 or be all"); + } } else { para.input.nbands_sto = 0; } }; - item.reset_value = [](const Input_Item& item, Parameter& para) { - // only do it when nbands_sto is set in INPUT - if (item.is_read()) - { - if (strvalue == "0" && para.input.esolver_type == "sdft") - { - para.input.esolver_type = "ksdft"; - ModuleBase::GlobalFunc::AUTO_SET("esolver_type", para.input.esolver_type); - } - } - }; item.check_value = [](const Input_Item& item, const Parameter& para) { - if (para.input.nbands_sto < 0 || para.input.nbands_sto > 100000) + const bool use_complete_basis = item.is_read() && strvalue == "all"; + if ((!use_complete_basis && para.input.nbands_sto < 1) || para.input.nbands_sto > 1000000) { - ModuleBase::WARNING_QUIT("ReadInput", "nbands_sto should be in the range of 0 to 100000"); + ModuleBase::WARNING_QUIT("ReadInput", "nbands_sto should be in the range of 1 to 1000000 or be all"); } }; item.get_final_value = [](Input_Item& item, const Parameter& para) { diff --git a/source/source_io/module_parameter/read_input_item_system.cpp b/source/source_io/module_parameter/read_input_item_system.cpp index eb38aa5ebf..06a5241e55 100644 --- a/source/source_io/module_parameter/read_input_item_system.cpp +++ b/source/source_io/module_parameter/read_input_item_system.cpp @@ -313,7 +313,7 @@ void ReadInput::item_system() // GPU + PW: validate kpar against total processors // Moved from base_device::information::get_device_kpar() #if defined(__CUDA) || defined(__ROCM) - if (para.input.device == "gpu" && para.input.basis_type == "pw") + if (para.input.device == "gpu" && para.input.basis_type == "pw" && para.input.bndpar > 0) { if (GlobalV::NPROC != para.input.kpar * para.input.bndpar) { @@ -339,25 +339,34 @@ void ReadInput::item_system() "will be distributed among each group"; item.category = "System variables"; item.type = "Integer"; - item.description = "Divide all processors into bndpar groups, and bands (only stochastic orbitals now) " - "will be distributed among each group. It should be larger than 0."; + item.description = "Divide all processors into bndpar groups for SDFT or the BPCG solver. bndpar must be " + "positive, no greater than the number of MPI processes, and kpar * bndpar must divide " + "the number of MPI processes exactly."; item.default_value = "1"; read_sync_int(input.bndpar); - item.reset_value = [](const Input_Item& item, Parameter& para) { - if (para.input.esolver_type != "sdft" && para.input.ks_solver != "bpcg") + item.check_value = [](const Input_Item& item, const Parameter& para) { + if (para.input.bndpar <= 0) { - para.input.bndpar = 1; + ModuleBase::WARNING_QUIT("ReadInput", "bndpar must be greater than 0"); } if (para.input.bndpar > GlobalV::NPROC) { - para.input.bndpar = GlobalV::NPROC; + ModuleBase::WARNING_QUIT("ReadInput", "bndpar can not exceed the number of MPI processes"); + } + if (para.input.bndpar > 1 && para.input.esolver_type != "sdft" && para.input.ks_solver != "bpcg") + { + ModuleBase::WARNING_QUIT("ReadInput", "bndpar > 1 requires esolver_type=sdft or ks_solver=bpcg"); } - }; - item.check_value = [](const Input_Item& item, const Parameter& para) { if (GlobalV::NPROC % para.input.bndpar != 0) { ModuleBase::WARNING_QUIT("ReadInput", "The number of processors can not be divided by bndpar"); } + if (para.input.bndpar > 1 + && (para.input.kpar <= 0 || (GlobalV::NPROC / para.input.bndpar) % para.input.kpar != 0)) + { + ModuleBase::WARNING_QUIT("ReadInput", + "The number of processors can not be divided by kpar * bndpar"); + } }; this->add_item(item); } diff --git a/source/source_io/test_serial/read_input_item_test.cpp b/source/source_io/test_serial/read_input_item_test.cpp index 6d9cb980fe..7c1077060c 100644 --- a/source/source_io/test_serial/read_input_item_test.cpp +++ b/source/source_io/test_serial/read_input_item_test.cpp @@ -88,11 +88,7 @@ TEST_F(InputTest, Item_test) } { // nspin auto it = find_label("nspin", readinput.input_lists); - param.input.nspin = 0; - param.input.noncolin = true; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.nspin, 4); - + param.input.noncolin = false; param.input.nspin = 3; testing::internal::CaptureStdout(); EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); @@ -188,15 +184,9 @@ TEST_F(InputTest, Item_test) } { // bndpar auto it = find_label("bndpar", readinput.input_lists); - param.input.esolver_type = "ksdft"; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.bndpar, 1); - param.input.esolver_type = "sdft"; - param.input.bndpar = 2; - GlobalV::NPROC = 1; - it->second.reset_value(it->second, param); - EXPECT_EQ(param.input.bndpar, 1); + param.input.bndpar = 1; + EXPECT_NO_THROW(it->second.check_value(it->second, param)); } { // dft_plus_dmft auto it = find_label("dft_plus_dmft", readinput.input_lists); @@ -871,22 +861,37 @@ TEST_F(InputTest, Item_test) it->second.str_values = {"all"}; it->second.read_value(it->second, param); - it->second.reset_value(it->second, param); + EXPECT_NO_THROW(it->second.check_value(it->second, param)); EXPECT_EQ(param.input.nbands_sto, 0); EXPECT_EQ(param.input.esolver_type, "sdft"); it->second.str_values = {"8"}; it->second.read_value(it->second, param); - it->second.reset_value(it->second, param); + EXPECT_NO_THROW(it->second.check_value(it->second, param)); EXPECT_EQ(param.input.nbands_sto, 8); EXPECT_EQ(param.input.esolver_type, "sdft"); + it->second.str_values = {"1000000"}; + it->second.read_value(it->second, param); + EXPECT_NO_THROW(it->second.check_value(it->second, param)); + + it->second.str_values = {"1000001"}; + it->second.read_value(it->second, param); + testing::internal::CaptureStdout(); + EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); + output = testing::internal::GetCapturedStdout(); + EXPECT_THAT(output, testing::HasSubstr("NOTICE")); + it->second.str_values = {"0"}; it->second.read_value(it->second, param); - it->second.reset_value(it->second, param); + testing::internal::CaptureStdout(); + EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); + output = testing::internal::GetCapturedStdout(); + EXPECT_THAT(output, testing::HasSubstr("NOTICE")); EXPECT_EQ(param.input.nbands_sto, 0); - EXPECT_EQ(param.input.esolver_type, "ksdft"); + EXPECT_EQ(param.input.esolver_type, "sdft"); + it->second.str_values = {"-1"}; param.input.nbands_sto = -1; testing::internal::CaptureStdout(); EXPECT_EXIT(it->second.check_value(it->second, param), ::testing::ExitedWithCode(1), ""); diff --git a/source/source_io/test_serial/read_input_test.cpp b/source/source_io/test_serial/read_input_test.cpp index 8aa7a84a80..b63982ff8a 100644 --- a/source/source_io/test_serial/read_input_test.cpp +++ b/source/source_io/test_serial/read_input_test.cpp @@ -68,6 +68,50 @@ void make_dir_out(const std::string& suffix, class InputTest : public testing::Test { protected: + void TearDown() override + { + set_nproc(1); + } + + void set_nproc(const int nproc) + { + GlobalV::NPROC = nproc; + } + + void write_input(const std::string& filename, const std::string& parameters) + { + std::ofstream input(filename.c_str()); + input << "INPUT_PARAMETERS\n" << parameters; + } + + void read_parameters(const std::string& filename, const std::string& parameters, Parameter& param) + { + write_input(filename, parameters); + ModuleIO::ReadInput readinput(0); + readinput.check_ntype_flag = false; + try + { + readinput.read_parameters(param, filename); + } + catch (...) + { + std::remove(filename.c_str()); + throw; + } + EXPECT_EQ(std::remove(filename.c_str()), 0); + } + + void expect_invalid_input(const std::string& filename, + const std::string& parameters, + const std::string& reason) + { + Parameter param; + testing::internal::CaptureStdout(); + EXPECT_THROW(read_parameters(filename, parameters, param), std::runtime_error); + const std::string output = testing::internal::GetCapturedStdout(); + EXPECT_THAT(output, testing::HasSubstr(reason)); + } + bool compare_two_files(const std::string& filename1, const std::string& filename2) { std::ifstream file1(filename1.c_str()); @@ -168,6 +212,77 @@ TEST_F(InputTest, RejectAutoDevice) EXPECT_TRUE(std::remove("./auto_device_INPUT") == 0); } +TEST_F(InputTest, ValidateNoncollinearSpin) +{ + Parameter valid_param; + EXPECT_NO_THROW(read_parameters("noncolin_valid_INPUT", "noncolin 1\nnspin 4\n", valid_param)); + + expect_invalid_input("noncolin_missing_nspin_INPUT", + "noncolin 1\n", + "nspin must be 4 when noncolin or lspinorb is enabled"); + expect_invalid_input("noncolin_invalid_nspin_INPUT", + "noncolin 1\nnspin 2\n", + "nspin must be 4 when noncolin or lspinorb is enabled"); + expect_invalid_input("soc_missing_nspin_INPUT", + "lspinorb 1\n", + "nspin must be 4 when noncolin or lspinorb is enabled"); +} + +TEST_F(InputTest, ValidateSdftStochasticBands) +{ + Parameter all_param; + EXPECT_NO_THROW(read_parameters("sdft_all_INPUT", "esolver_type sdft\nnbands_sto all\n", all_param)); + EXPECT_EQ(all_param.inp.esolver_type, "sdft"); + + Parameter relaxed_limit_param; + EXPECT_NO_THROW(read_parameters("sdft_relaxed_limit_INPUT", + "esolver_type sdft\nnbands_sto 100001\n", + relaxed_limit_param)); + EXPECT_EQ(relaxed_limit_param.inp.nbands_sto, 100001); + + expect_invalid_input("sdft_zero_INPUT", + "esolver_type sdft\nnbands_sto 00\n", + "nbands_sto should be in the range of 1 to 1000000 or be all"); + expect_invalid_input("ksdft_zero_INPUT", + "esolver_type ksdft\nnbands_sto 0\n", + "nbands_sto should be in the range of 1 to 1000000 or be all"); + expect_invalid_input("sdft_fractional_INPUT", + "esolver_type sdft\nnbands_sto 1.5\n", + "nbands_sto should be in the range of 1 to 1000000 or be all"); +} + +TEST_F(InputTest, ValidateBandParallelization) +{ + set_nproc(4); + Parameter valid_param; + EXPECT_NO_THROW(read_parameters("bndpar_valid_INPUT", + "esolver_type sdft\nnbands_sto all\nkpar 2\nbndpar 2\n", + valid_param)); + EXPECT_EQ(valid_param.inp.bndpar, 2); + + Parameter bpcg_param; + EXPECT_NO_THROW(read_parameters("bndpar_bpcg_INPUT", "ks_solver bpcg\nbndpar 2\n", bpcg_param)); + EXPECT_EQ(bpcg_param.inp.bndpar, 2); + + expect_invalid_input("bndpar_zero_INPUT", "bndpar 0\n", "bndpar must be greater than 0"); + expect_invalid_input("bndpar_wrong_solver_INPUT", + "bndpar 2\n", + "bndpar > 1 requires esolver_type=sdft or ks_solver=bpcg"); + expect_invalid_input("bndpar_kpar_not_divisible_INPUT", + "esolver_type sdft\nnbands_sto all\nkpar 2\nbndpar 4\n", + "The number of processors can not be divided by kpar * bndpar"); + + set_nproc(3); + expect_invalid_input("bndpar_not_divisible_INPUT", + "esolver_type sdft\nnbands_sto all\nbndpar 2\n", + "The number of processors can not be divided by bndpar"); + + set_nproc(1); + expect_invalid_input("bndpar_too_large_INPUT", + "esolver_type sdft\nnbands_sto all\nbndpar 2\n", + "bndpar can not exceed the number of MPI processes"); +} + TEST_F(InputTest, Check) { ModuleIO::ReadInput readinput(0); diff --git a/tests/01_PW/035_PW_15_SO/INPUT b/tests/01_PW/035_PW_15_SO/INPUT index f3f6b2c889..50170c1d71 100644 --- a/tests/01_PW/035_PW_15_SO/INPUT +++ b/tests/01_PW/035_PW_15_SO/INPUT @@ -31,6 +31,7 @@ cal_stress 1 #noncolin 1 lspinorb 1 +nspin 4 basis_type pw ks_solver dav_subspace diff --git a/tests/01_PW/038_PW_NC/INPUT b/tests/01_PW/038_PW_NC/INPUT index fdf932781f..86020809dc 100644 --- a/tests/01_PW/038_PW_NC/INPUT +++ b/tests/01_PW/038_PW_NC/INPUT @@ -5,6 +5,7 @@ init_wfc random basis_type pw calculation scf noncolin 1 +nspin 4 symmetry 0 cal_force 1 cal_stress 1 diff --git a/tests/01_PW/057_PW_SO_IW/INPUT b/tests/01_PW/057_PW_SO_IW/INPUT index d7ae118473..de68d2e40f 100644 --- a/tests/01_PW/057_PW_SO_IW/INPUT +++ b/tests/01_PW/057_PW_SO_IW/INPUT @@ -3,6 +3,7 @@ INPUT_PARAMETERS calculation scf #noncolin 1 lspinorb 1 +nspin 4 gamma_only 0 symmetry 0 diff --git a/tests/01_PW/099_PW_DJ_SO/INPUT b/tests/01_PW/099_PW_DJ_SO/INPUT index 0dc29de009..801389b783 100644 --- a/tests/01_PW/099_PW_DJ_SO/INPUT +++ b/tests/01_PW/099_PW_DJ_SO/INPUT @@ -32,6 +32,7 @@ pw_diag_ndim 2 basis_type pw gamma_only 0 noncolin 1 +nspin 4 lspinorb 1 cal_force 1 cal_stress 1 diff --git a/tests/03_NAO_multik/scf_angle_spin4/INPUT b/tests/03_NAO_multik/scf_angle_spin4/INPUT index 2bc14e6240..27704daa03 100644 --- a/tests/03_NAO_multik/scf_angle_spin4/INPUT +++ b/tests/03_NAO_multik/scf_angle_spin4/INPUT @@ -14,6 +14,7 @@ scf_thr 1e-7 scf_nmax 50 noncolin 1 +nspin 4 #Parameters (3.Basis) basis_type lcao diff --git a/tests/03_NAO_multik/scf_out_dos_spin4/INPUT b/tests/03_NAO_multik/scf_out_dos_spin4/INPUT index cc94233170..b57f2e8477 100644 --- a/tests/03_NAO_multik/scf_out_dos_spin4/INPUT +++ b/tests/03_NAO_multik/scf_out_dos_spin4/INPUT @@ -17,6 +17,7 @@ scf_nmax 100 #noncolin 1 lspinorb 1 +nspin 4 cal_force 1 cal_stress 1 diff --git a/tests/03_NAO_multik/scf_out_mul_spin4/INPUT b/tests/03_NAO_multik/scf_out_mul_spin4/INPUT index a992ca583d..f6f8319b14 100644 --- a/tests/03_NAO_multik/scf_out_mul_spin4/INPUT +++ b/tests/03_NAO_multik/scf_out_mul_spin4/INPUT @@ -3,6 +3,7 @@ INPUT_PARAMETERS # non-collinear LCAO calculations basis_type lcao noncolin 1 +nspin 4 symmetry 1 calculation scf diff --git a/tests/03_NAO_multik/scf_out_mul_spin4/result.ref b/tests/03_NAO_multik/scf_out_mul_spin4/result.ref index 10ff603721..a7b8b55690 100644 --- a/tests/03_NAO_multik/scf_out_mul_spin4/result.ref +++ b/tests/03_NAO_multik/scf_out_mul_spin4/result.ref @@ -4,4 +4,5 @@ Compare_mulliken_pass 0 pointgroupref O_h spacegroupref O_h nksibzref 1 +magpointgroupref C_4h totaltimeref 4.42 diff --git a/tests/03_NAO_multik/scf_u_spin4/INPUT b/tests/03_NAO_multik/scf_u_spin4/INPUT index eb558ee779..05077a9600 100644 --- a/tests/03_NAO_multik/scf_u_spin4/INPUT +++ b/tests/03_NAO_multik/scf_u_spin4/INPUT @@ -25,6 +25,7 @@ ks_solver scalapack_gvx basis_type lcao gamma_only 0 noncolin 1 +nspin 4 lspinorb 1 cal_force 1 cal_stress 1 diff --git a/tests/06_SDFT/16_PW_KG_100/INPUT b/tests/06_SDFT/16_PW_KG_100/INPUT index da5ce4d012..188956fc00 100644 --- a/tests/06_SDFT/16_PW_KG_100/INPUT +++ b/tests/06_SDFT/16_PW_KG_100/INPUT @@ -2,10 +2,9 @@ INPUT_PARAMETERS #Parameters (1.General) suffix autotest calculation scf -esolver_type sdft +esolver_type ksdft nbands 100 -nbands_sto 0 #execute KSDFT pseudo_dir ../../PP_ORB symmetry 1 kpar 2 diff --git a/tests/11_PW_GPU/BUG_nspin4_u/INPUT b/tests/11_PW_GPU/BUG_nspin4_u/INPUT index f23760c0d4..be1092363d 100644 --- a/tests/11_PW_GPU/BUG_nspin4_u/INPUT +++ b/tests/11_PW_GPU/BUG_nspin4_u/INPUT @@ -33,6 +33,7 @@ pw_diag_ndim 2 basis_type pw gamma_only 0 noncolin 1 +nspin 4 lspinorb 1 cal_force 1 cal_stress 1 diff --git a/tests/17_DS_DFTU/02_LCAO_SPIN_S4_XYZ/INPUT b/tests/17_DS_DFTU/02_LCAO_SPIN_S4_XYZ/INPUT index 163c7b3bcd..8916bdf4b0 100644 --- a/tests/17_DS_DFTU/02_LCAO_SPIN_S4_XYZ/INPUT +++ b/tests/17_DS_DFTU/02_LCAO_SPIN_S4_XYZ/INPUT @@ -5,6 +5,7 @@ basis_type lcao ecutwfc 20 gamma_only 0 noncolin 1 +nspin 4 #nbands 40 scf_thr 1.0e-6 scf_nmax 50 diff --git a/tests/17_DS_DFTU/04_LCAO_DFTU_S4_XY/INPUT b/tests/17_DS_DFTU/04_LCAO_DFTU_S4_XY/INPUT index 7daab2ff56..a0de7786ca 100644 --- a/tests/17_DS_DFTU/04_LCAO_DFTU_S4_XY/INPUT +++ b/tests/17_DS_DFTU/04_LCAO_DFTU_S4_XY/INPUT @@ -6,6 +6,7 @@ ecutwfc 20 gamma_only 0 noncolin 1 +nspin 4 #nbands 28 scf_thr 1.0e-6 scf_nmax 50 diff --git a/tests/17_DS_DFTU/05_LCAO_DFTU_S4_XYZ/INPUT b/tests/17_DS_DFTU/05_LCAO_DFTU_S4_XYZ/INPUT index efb3db1a05..38bb439679 100644 --- a/tests/17_DS_DFTU/05_LCAO_DFTU_S4_XYZ/INPUT +++ b/tests/17_DS_DFTU/05_LCAO_DFTU_S4_XYZ/INPUT @@ -5,6 +5,7 @@ basis_type lcao ecutwfc 20 gamma_only 0 noncolin 1 +nspin 4 #nbands 40 scf_thr 1.0e-6 scf_nmax 50 diff --git a/tests/17_DS_DFTU/07_PW_SPIN_S4_XYZ/INPUT b/tests/17_DS_DFTU/07_PW_SPIN_S4_XYZ/INPUT index f0efbfb4f0..0c302486be 100644 --- a/tests/17_DS_DFTU/07_PW_SPIN_S4_XYZ/INPUT +++ b/tests/17_DS_DFTU/07_PW_SPIN_S4_XYZ/INPUT @@ -5,6 +5,7 @@ basis_type pw ecutwfc 20 gamma_only 0 noncolin 1 +nspin 4 #nbands 40 scf_thr 1.0e-6 scf_nmax 50 diff --git a/tests/17_DS_DFTU/09_PW_DFTU_S4_XY/INPUT b/tests/17_DS_DFTU/09_PW_DFTU_S4_XY/INPUT index 5d19e1c066..19db5178cb 100644 --- a/tests/17_DS_DFTU/09_PW_DFTU_S4_XY/INPUT +++ b/tests/17_DS_DFTU/09_PW_DFTU_S4_XY/INPUT @@ -7,6 +7,7 @@ gamma_only 0 device cpu noncolin 1 +nspin 4 scf_thr 1.0e-6 scf_nmax 50 out_chg 0 diff --git a/tests/17_DS_DFTU/14_PW_DS_S4_XYZ/INPUT b/tests/17_DS_DFTU/14_PW_DS_S4_XYZ/INPUT index 0d74fa0b60..bca933676e 100644 --- a/tests/17_DS_DFTU/14_PW_DS_S4_XYZ/INPUT +++ b/tests/17_DS_DFTU/14_PW_DS_S4_XYZ/INPUT @@ -5,6 +5,7 @@ basis_type pw ecutwfc 20 gamma_only 0 noncolin 1 +nspin 4 #nbands 28 scf_thr 1.0e-6 scf_nmax 50 diff --git a/tests/17_DS_DFTU/15_PW_DS_S4_Z/INPUT b/tests/17_DS_DFTU/15_PW_DS_S4_Z/INPUT index a300c67197..813c3a8167 100644 --- a/tests/17_DS_DFTU/15_PW_DS_S4_Z/INPUT +++ b/tests/17_DS_DFTU/15_PW_DS_S4_Z/INPUT @@ -5,6 +5,7 @@ basis_type pw ecutwfc 20 gamma_only 0 noncolin 1 +nspin 4 #nbands 40 scf_thr 1.0e-6 scf_nmax 50 diff --git a/tests/17_DS_DFTU/16_PW_DS_S4_XY/INPUT b/tests/17_DS_DFTU/16_PW_DS_S4_XY/INPUT index a300c67197..813c3a8167 100644 --- a/tests/17_DS_DFTU/16_PW_DS_S4_XY/INPUT +++ b/tests/17_DS_DFTU/16_PW_DS_S4_XY/INPUT @@ -5,6 +5,7 @@ basis_type pw ecutwfc 20 gamma_only 0 noncolin 1 +nspin 4 #nbands 40 scf_thr 1.0e-6 scf_nmax 50 diff --git a/tests/17_DS_DFTU/19_PW_DFTU_DS_S4_XY/INPUT b/tests/17_DS_DFTU/19_PW_DFTU_DS_S4_XY/INPUT index 34cb447147..d54f67b07a 100644 --- a/tests/17_DS_DFTU/19_PW_DFTU_DS_S4_XY/INPUT +++ b/tests/17_DS_DFTU/19_PW_DFTU_DS_S4_XY/INPUT @@ -7,6 +7,7 @@ gamma_only 0 device cpu noncolin 1 +nspin 4 scf_thr 1.0e-6 scf_nmax 50 out_chg 0 diff --git a/tests/17_DS_DFTU/21_PW_DFTU_DS_S4_Z/INPUT b/tests/17_DS_DFTU/21_PW_DFTU_DS_S4_Z/INPUT index a8de392596..c8521c839c 100644 --- a/tests/17_DS_DFTU/21_PW_DFTU_DS_S4_Z/INPUT +++ b/tests/17_DS_DFTU/21_PW_DFTU_DS_S4_Z/INPUT @@ -5,6 +5,7 @@ basis_type pw ecutwfc 20 gamma_only 0 noncolin 1 +nspin 4 #nbands 40 scf_thr 1.0e-6 scf_nmax 50 diff --git a/tests/17_DS_DFTU/26_LCAO_DS_S4_XYZ/INPUT b/tests/17_DS_DFTU/26_LCAO_DS_S4_XYZ/INPUT index b2b6ce9c8d..92f84f42af 100644 --- a/tests/17_DS_DFTU/26_LCAO_DS_S4_XYZ/INPUT +++ b/tests/17_DS_DFTU/26_LCAO_DS_S4_XYZ/INPUT @@ -6,6 +6,7 @@ ecutwfc 20 gamma_only 0 noncolin 1 +nspin 4 #nbands 28 scf_thr 1.0e-6 scf_nmax 100 diff --git a/tests/17_DS_DFTU/27_LCAO_DS_S4_Z/INPUT b/tests/17_DS_DFTU/27_LCAO_DS_S4_Z/INPUT index 4797cb91fc..608bffae3e 100644 --- a/tests/17_DS_DFTU/27_LCAO_DS_S4_Z/INPUT +++ b/tests/17_DS_DFTU/27_LCAO_DS_S4_Z/INPUT @@ -5,6 +5,7 @@ basis_type lcao ecutwfc 20 gamma_only 0 noncolin 1 +nspin 4 #nbands 40 scf_thr 1.0e-6 scf_nmax 100 diff --git a/tests/17_DS_DFTU/28_LCAO_DS_S4_XY/INPUT b/tests/17_DS_DFTU/28_LCAO_DS_S4_XY/INPUT index 4797cb91fc..608bffae3e 100644 --- a/tests/17_DS_DFTU/28_LCAO_DS_S4_XY/INPUT +++ b/tests/17_DS_DFTU/28_LCAO_DS_S4_XY/INPUT @@ -5,6 +5,7 @@ basis_type lcao ecutwfc 20 gamma_only 0 noncolin 1 +nspin 4 #nbands 40 scf_thr 1.0e-6 scf_nmax 100 diff --git a/tests/17_DS_DFTU/31_LCAO_DFTU_DS_S4_XY/INPUT b/tests/17_DS_DFTU/31_LCAO_DFTU_DS_S4_XY/INPUT index 5312a11245..938de0e2b0 100644 --- a/tests/17_DS_DFTU/31_LCAO_DFTU_DS_S4_XY/INPUT +++ b/tests/17_DS_DFTU/31_LCAO_DFTU_DS_S4_XY/INPUT @@ -6,6 +6,7 @@ ecutwfc 20 gamma_only 0 noncolin 1 +nspin 4 #nbands 28 scf_thr 1.0e-6 scf_nmax 50 diff --git a/tests/17_DS_DFTU/32_LCAO_DFTU_DS_S4_XYZ/INPUT b/tests/17_DS_DFTU/32_LCAO_DFTU_DS_S4_XYZ/INPUT index 19873fdd2d..c3e057923b 100644 --- a/tests/17_DS_DFTU/32_LCAO_DFTU_DS_S4_XYZ/INPUT +++ b/tests/17_DS_DFTU/32_LCAO_DFTU_DS_S4_XYZ/INPUT @@ -6,6 +6,7 @@ ecutwfc 20 gamma_only 0 noncolin 1 +nspin 4 #nbands 28 scf_thr 1.0e-6 scf_nmax 100 diff --git a/tests/17_DS_DFTU/33_LCAO_DFTU_DS_S4_Z/INPUT b/tests/17_DS_DFTU/33_LCAO_DFTU_DS_S4_Z/INPUT index 092d43abcb..4c412d0386 100644 --- a/tests/17_DS_DFTU/33_LCAO_DFTU_DS_S4_Z/INPUT +++ b/tests/17_DS_DFTU/33_LCAO_DFTU_DS_S4_Z/INPUT @@ -5,6 +5,7 @@ basis_type lcao ecutwfc 20 gamma_only 0 noncolin 1 +nspin 4 #nbands 40 scf_thr 1.0e-6 scf_nmax 50 diff --git a/tests/17_DS_DFTU/37_PW_DS_S4_ReadLam_XY/INPUT b/tests/17_DS_DFTU/37_PW_DS_S4_ReadLam_XY/INPUT index b5def492a6..17cba57c34 100644 --- a/tests/17_DS_DFTU/37_PW_DS_S4_ReadLam_XY/INPUT +++ b/tests/17_DS_DFTU/37_PW_DS_S4_ReadLam_XY/INPUT @@ -6,6 +6,7 @@ ecutwfc 20 gamma_only 0 noncolin 1 +nspin 4 scf_thr 1.0e-6 scf_nmax 50 out_chg 0 diff --git a/tests/17_DS_DFTU/39_PW_DS_S4_Thr1e10_XY/INPUT b/tests/17_DS_DFTU/39_PW_DS_S4_Thr1e10_XY/INPUT index adac5688d1..1dcd3febbd 100644 --- a/tests/17_DS_DFTU/39_PW_DS_S4_Thr1e10_XY/INPUT +++ b/tests/17_DS_DFTU/39_PW_DS_S4_Thr1e10_XY/INPUT @@ -6,6 +6,7 @@ ecutwfc 20 gamma_only 0 noncolin 1 +nspin 4 scf_thr 1.0e-6 scf_nmax 100 out_chg 0 diff --git a/tests/17_DS_DFTU/41_PW_DS_S4_Thr10_XY/INPUT b/tests/17_DS_DFTU/41_PW_DS_S4_Thr10_XY/INPUT index 38276dc868..5df87d9163 100644 --- a/tests/17_DS_DFTU/41_PW_DS_S4_Thr10_XY/INPUT +++ b/tests/17_DS_DFTU/41_PW_DS_S4_Thr10_XY/INPUT @@ -6,6 +6,7 @@ ecutwfc 20 gamma_only 0 noncolin 1 +nspin 4 scf_thr 1.0e-6 scf_nmax 50 out_chg 0 diff --git a/tests/17_DS_DFTU/43_PW_DFTU_DS_S4_Thr1e10_XY/INPUT b/tests/17_DS_DFTU/43_PW_DFTU_DS_S4_Thr1e10_XY/INPUT index 4629ed7b77..be59d5dc42 100644 --- a/tests/17_DS_DFTU/43_PW_DFTU_DS_S4_Thr1e10_XY/INPUT +++ b/tests/17_DS_DFTU/43_PW_DFTU_DS_S4_Thr1e10_XY/INPUT @@ -6,6 +6,7 @@ ecutwfc 20 gamma_only 0 noncolin 1 +nspin 4 scf_thr 1.0e-6 scf_nmax 100 out_chg 0 diff --git a/tests/17_DS_DFTU/45_PW_DFTU_DS_S4_Thr10_XY/INPUT b/tests/17_DS_DFTU/45_PW_DFTU_DS_S4_Thr10_XY/INPUT index bd4a2bedb7..8354f293b0 100644 --- a/tests/17_DS_DFTU/45_PW_DFTU_DS_S4_Thr10_XY/INPUT +++ b/tests/17_DS_DFTU/45_PW_DFTU_DS_S4_Thr10_XY/INPUT @@ -6,6 +6,7 @@ ecutwfc 20 gamma_only 0 noncolin 1 +nspin 4 scf_thr 1.0e-6 scf_nmax 50 out_chg 0 diff --git a/tests/17_DS_DFTU/55_PW_DS_NSCF_S4_XY/INPUT b/tests/17_DS_DFTU/55_PW_DS_NSCF_S4_XY/INPUT index 23afec5db2..a1ba2fddf3 100644 --- a/tests/17_DS_DFTU/55_PW_DS_NSCF_S4_XY/INPUT +++ b/tests/17_DS_DFTU/55_PW_DS_NSCF_S4_XY/INPUT @@ -7,6 +7,7 @@ gamma_only 0 init_chg file read_file_dir ./ noncolin 1 +nspin 4 #nbands 28 scf_thr 1.0e-6 scf_nmax 1 diff --git a/tests/17_DS_DFTU/55_PW_DS_NSCF_S4_XY/scf/INPUT b/tests/17_DS_DFTU/55_PW_DS_NSCF_S4_XY/scf/INPUT index 5d58bf0c49..244a635ced 100644 --- a/tests/17_DS_DFTU/55_PW_DS_NSCF_S4_XY/scf/INPUT +++ b/tests/17_DS_DFTU/55_PW_DS_NSCF_S4_XY/scf/INPUT @@ -6,6 +6,7 @@ ecutwfc 20 gamma_only 0 init_chg atomic noncolin 1 +nspin 4 #nbands 28 scf_thr 1.0e-6 scf_nmax 50 diff --git a/tests/17_DS_DFTU/56_PW_DS_S4_DirectionOnly_XY/INPUT b/tests/17_DS_DFTU/56_PW_DS_S4_DirectionOnly_XY/INPUT index b552257707..265721f75a 100644 --- a/tests/17_DS_DFTU/56_PW_DS_S4_DirectionOnly_XY/INPUT +++ b/tests/17_DS_DFTU/56_PW_DS_S4_DirectionOnly_XY/INPUT @@ -5,6 +5,7 @@ basis_type pw ecutwfc 20 gamma_only 0 noncolin 1 +nspin 4 #nbands 28 scf_thr 1.0e-8 scf_nmax 50 diff --git a/tests/17_DS_DFTU/57_PW_DFTU_DS_S4_DirectionOnly_XY/INPUT b/tests/17_DS_DFTU/57_PW_DFTU_DS_S4_DirectionOnly_XY/INPUT index 5748790452..e96f028bd6 100644 --- a/tests/17_DS_DFTU/57_PW_DFTU_DS_S4_DirectionOnly_XY/INPUT +++ b/tests/17_DS_DFTU/57_PW_DFTU_DS_S4_DirectionOnly_XY/INPUT @@ -6,6 +6,7 @@ ecutwfc 20 gamma_only 0 noncolin 1 +nspin 4 scf_thr 1.0e-8 scf_nmax 50 out_chg 0 diff --git a/tests/17_DS_DFTU/58_LCAO_DS_S4_DirectionOnly_XY/INPUT b/tests/17_DS_DFTU/58_LCAO_DS_S4_DirectionOnly_XY/INPUT index c66793eac2..af2c4402de 100644 --- a/tests/17_DS_DFTU/58_LCAO_DS_S4_DirectionOnly_XY/INPUT +++ b/tests/17_DS_DFTU/58_LCAO_DS_S4_DirectionOnly_XY/INPUT @@ -6,6 +6,7 @@ ecutwfc 20 gamma_only 0 noncolin 1 +nspin 4 #nbands 28 scf_thr 1.0e-6 scf_nmax 100 diff --git a/tests/17_DS_DFTU/59_LCAO_DFTU_DS_S4_DirectionOnly_XY/INPUT b/tests/17_DS_DFTU/59_LCAO_DFTU_DS_S4_DirectionOnly_XY/INPUT index 81ea04ea84..08c6fcce87 100644 --- a/tests/17_DS_DFTU/59_LCAO_DFTU_DS_S4_DirectionOnly_XY/INPUT +++ b/tests/17_DS_DFTU/59_LCAO_DFTU_DS_S4_DirectionOnly_XY/INPUT @@ -6,6 +6,7 @@ ecutwfc 20 gamma_only 0 noncolin 1 +nspin 4 #nbands 28 scf_thr 1.0e-6 scf_nmax 50 diff --git a/tests/17_DS_DFTU/60_PW_DFTU_DS_NSCF_Band_XY/INPUT b/tests/17_DS_DFTU/60_PW_DFTU_DS_NSCF_Band_XY/INPUT index aa919b587d..d0d6186ee1 100644 --- a/tests/17_DS_DFTU/60_PW_DFTU_DS_NSCF_Band_XY/INPUT +++ b/tests/17_DS_DFTU/60_PW_DFTU_DS_NSCF_Band_XY/INPUT @@ -7,6 +7,7 @@ gamma_only 0 init_chg file read_file_dir ./ noncolin 1 +nspin 4 nbands 40 scf_thr 1.0e-6 scf_nmax 1 diff --git a/tests/17_DS_DFTU/60_PW_DFTU_DS_NSCF_Band_XY/scf/INPUT b/tests/17_DS_DFTU/60_PW_DFTU_DS_NSCF_Band_XY/scf/INPUT index c1436937b8..50c68aa9bd 100644 --- a/tests/17_DS_DFTU/60_PW_DFTU_DS_NSCF_Band_XY/scf/INPUT +++ b/tests/17_DS_DFTU/60_PW_DFTU_DS_NSCF_Band_XY/scf/INPUT @@ -6,6 +6,7 @@ ecutwfc 10 gamma_only 0 init_chg atomic noncolin 1 +nspin 4 nbands 40 scf_thr 1.0e-6 scf_nmax 50 diff --git a/tests/17_DS_DFTU/61_LCAO_DS_NSCF_S4_XY/INPUT b/tests/17_DS_DFTU/61_LCAO_DS_NSCF_S4_XY/INPUT index deb30c6d17..d34b410cc6 100644 --- a/tests/17_DS_DFTU/61_LCAO_DS_NSCF_S4_XY/INPUT +++ b/tests/17_DS_DFTU/61_LCAO_DS_NSCF_S4_XY/INPUT @@ -7,6 +7,7 @@ gamma_only 0 init_chg file read_file_dir ./ noncolin 1 +nspin 4 #nbands 28 scf_thr 1.0e-6 scf_nmax 1 diff --git a/tests/17_DS_DFTU/61_LCAO_DS_NSCF_S4_XY/scf/INPUT b/tests/17_DS_DFTU/61_LCAO_DS_NSCF_S4_XY/scf/INPUT index 74a291898f..180ac68d25 100644 --- a/tests/17_DS_DFTU/61_LCAO_DS_NSCF_S4_XY/scf/INPUT +++ b/tests/17_DS_DFTU/61_LCAO_DS_NSCF_S4_XY/scf/INPUT @@ -6,6 +6,7 @@ ecutwfc 5 gamma_only 0 init_chg atomic noncolin 1 +nspin 4 #nbands 28 scf_thr 1.0e-6 scf_nmax 50 diff --git a/tests/17_DS_DFTU/62_LCAO_DFTU_NSCF_Band_XY/INPUT b/tests/17_DS_DFTU/62_LCAO_DFTU_NSCF_Band_XY/INPUT index 930f1f58c9..98e80fed28 100644 --- a/tests/17_DS_DFTU/62_LCAO_DFTU_NSCF_Band_XY/INPUT +++ b/tests/17_DS_DFTU/62_LCAO_DFTU_NSCF_Band_XY/INPUT @@ -7,6 +7,7 @@ gamma_only 0 init_chg file read_file_dir ./ noncolin 1 +nspin 4 #nbands 28 scf_thr 1.0e-6 scf_nmax 1 diff --git a/tests/17_DS_DFTU/62_LCAO_DFTU_NSCF_Band_XY/scf/INPUT b/tests/17_DS_DFTU/62_LCAO_DFTU_NSCF_Band_XY/scf/INPUT index 7d80334dbd..827c760515 100644 --- a/tests/17_DS_DFTU/62_LCAO_DFTU_NSCF_Band_XY/scf/INPUT +++ b/tests/17_DS_DFTU/62_LCAO_DFTU_NSCF_Band_XY/scf/INPUT @@ -6,6 +6,7 @@ ecutwfc 5 gamma_only 0 init_chg atomic noncolin 1 +nspin 4 #nbands 28 scf_thr 1.0e-6 scf_nmax 50 diff --git a/tests/17_DS_DFTU/63_LCAO_DFTU_DS_NSCF_Band_XY/INPUT b/tests/17_DS_DFTU/63_LCAO_DFTU_DS_NSCF_Band_XY/INPUT index 22c7407463..7c0304bcc1 100644 --- a/tests/17_DS_DFTU/63_LCAO_DFTU_DS_NSCF_Band_XY/INPUT +++ b/tests/17_DS_DFTU/63_LCAO_DFTU_DS_NSCF_Band_XY/INPUT @@ -7,6 +7,7 @@ gamma_only 0 init_chg file read_file_dir ./ noncolin 1 +nspin 4 #nbands 28 scf_thr 1.0e-6 scf_nmax 1 diff --git a/tests/17_DS_DFTU/63_LCAO_DFTU_DS_NSCF_Band_XY/scf/INPUT b/tests/17_DS_DFTU/63_LCAO_DFTU_DS_NSCF_Band_XY/scf/INPUT index 756cf0b898..894c324be2 100644 --- a/tests/17_DS_DFTU/63_LCAO_DFTU_DS_NSCF_Band_XY/scf/INPUT +++ b/tests/17_DS_DFTU/63_LCAO_DFTU_DS_NSCF_Band_XY/scf/INPUT @@ -6,6 +6,7 @@ ecutwfc 5 gamma_only 0 init_chg atomic noncolin 1 +nspin 4 #nbands 28 scf_thr 1.0e-6 scf_nmax 50 diff --git a/tests/17_DS_DFTU/64_PW_DFTU_NSCF_Band_XY/INPUT b/tests/17_DS_DFTU/64_PW_DFTU_NSCF_Band_XY/INPUT index f048ee6419..75163b6e90 100644 --- a/tests/17_DS_DFTU/64_PW_DFTU_NSCF_Band_XY/INPUT +++ b/tests/17_DS_DFTU/64_PW_DFTU_NSCF_Band_XY/INPUT @@ -7,6 +7,7 @@ gamma_only 0 init_chg file read_file_dir ./ noncolin 1 +nspin 4 #nbands 40 scf_thr 1.0e-6 scf_nmax 1 diff --git a/tests/17_DS_DFTU/64_PW_DFTU_NSCF_Band_XY/scf/INPUT b/tests/17_DS_DFTU/64_PW_DFTU_NSCF_Band_XY/scf/INPUT index f963181d33..abe46e4a03 100644 --- a/tests/17_DS_DFTU/64_PW_DFTU_NSCF_Band_XY/scf/INPUT +++ b/tests/17_DS_DFTU/64_PW_DFTU_NSCF_Band_XY/scf/INPUT @@ -6,6 +6,7 @@ ecutwfc 10 gamma_only 0 init_chg atomic noncolin 1 +nspin 4 #nbands 40 scf_thr 1.0e-6 scf_nmax 50