diff --git a/source/module_esolver/esolver.cpp b/source/module_esolver/esolver.cpp index 3501cc79b2..b0247fd63e 100644 --- a/source/module_esolver/esolver.cpp +++ b/source/module_esolver/esolver.cpp @@ -187,13 +187,8 @@ ESolver* init_esolver(const Input_para& inp, UnitCell& ucell) else if (esolver_type == "lr_lcao") { // use constructor rather than Init function to initialize reference (instead of pointers) to ucell - if (PARAM.globalv.gamma_only_local){ - return new LR::ESolver_LR(inp, ucell); - } else if (PARAM.inp.nspin < 2) { - return new LR::ESolver_LR, double>(inp, ucell); - } else { - throw std::runtime_error("LR-TDDFT is not implemented for spin polarized case"); -} + if (PARAM.globalv.gamma_only_local) { return new LR::ESolver_LR(inp, ucell); } + else { return new LR::ESolver_LR, double>(inp, ucell); } } else if (esolver_type == "ksdft_lr_lcao") { diff --git a/source/module_io/read_input_item_tddft.cpp b/source/module_io/read_input_item_tddft.cpp index 75a5748abc..ccd3190c54 100644 --- a/source/module_io/read_input_item_tddft.cpp +++ b/source/module_io/read_input_item_tddft.cpp @@ -343,10 +343,6 @@ void ReadInput::item_lr_tddft() para.input.abs_wavelen_range.push_back(std::stod(item.str_values[i])); } }; - item.check_value = [](const Input_Item& item, const Parameter& para) { - auto& awr = para.input.abs_wavelen_range; - if (awr.size() < 2) { ModuleBase::WARNING_QUIT("ReadInput", "abs_wavelen_range must have two values"); } - }; sync_doublevec(input.abs_wavelen_range, 2, 0.0); this->add_item(item); } diff --git a/source/module_parameter/input_parameter.h b/source/module_parameter/input_parameter.h index 23ff114217..17284d4bb9 100644 --- a/source/module_parameter/input_parameter.h +++ b/source/module_parameter/input_parameter.h @@ -303,7 +303,7 @@ struct Input_para double lr_thr = 1e-2; ///< convergence threshold of the LR-TDDFT eigensolver bool out_wfc_lr = false; ///< whether to output the eigenvectors (excitation amplitudes) in the particle-hole basis bool lr_unrestricted = false; ///< whether to use the unrestricted construction for LR-TDDFT - std::vector abs_wavelen_range = { 0., 0. }; ///< the range of wavelength(nm) to output the absorption spectrum + std::vector abs_wavelen_range = {}; ///< the range of wavelength(nm) to output the absorption spectrum double abs_broadening = 0.01; ///< the broadening (eta) for LR-TDDFT absorption spectrum std::string ri_hartree_benchmark = "none"; ///< whether to use the RI approximation for the Hartree potential in LR-TDDFT for benchmark (with FHI-aims/ABACUS read-in style) std::vector aims_nbasis = {}; ///< the number of basis functions for each atom type used in FHI-aims (for benchmark)