Skip to content

Commit

Permalink
enable complex spin2 and fix a parameter bug
Browse files Browse the repository at this point in the history
  • Loading branch information
maki49 committed Oct 19, 2024
1 parent be39bde commit 39b5fd5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
9 changes: 2 additions & 7 deletions source/module_esolver/esolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<double, double>(inp, ucell);
} else if (PARAM.inp.nspin < 2) {
return new LR::ESolver_LR<std::complex<double>, 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<double, double>(inp, ucell); }
else { return new LR::ESolver_LR<std::complex<double>, double>(inp, ucell); }
}
else if (esolver_type == "ksdft_lr_lcao")
{
Expand Down
4 changes: 0 additions & 4 deletions source/module_io/read_input_item_tddft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion source/module_parameter/input_parameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<double> abs_wavelen_range = { 0., 0. }; ///< the range of wavelength(nm) to output the absorption spectrum
std::vector<double> 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<int> aims_nbasis = {}; ///< the number of basis functions for each atom type used in FHI-aims (for benchmark)
Expand Down

0 comments on commit 39b5fd5

Please sign in to comment.