21#include <boost/math/constants/constants.hpp>
62 <<
"Calculating absorption spectrum plot " <<
orbfile_ << std::flush;
67 <<
" Loading QM data from " <<
orbfile_ << std::flush;
72 throw std::runtime_error(
73 "BSE singlet energies not stored in QM data file!");
77 throw std::runtime_error(
78 "BSE transition dipoles not stored in QM data file!");
81 const Eigen::VectorXd BSESingletEnergies =
83 const std::vector<Eigen::Vector3d>& TransitionDipoles =
93 <<
" Considering " << n_exc <<
" excitation with max energy "
94 << BSESingletEnergies(
maxexc_) <<
" eV / min wave length "
95 <<
evtonm(BSESingletEnergies[
maxexc_ - 1]) <<
" nm" << std::flush;
132 ofs <<
"# E(eV) epsGaussian IM(eps)Gaussian epsLorentz "
138 double eps_Gaussian = 0.0;
139 double imeps_Gaussian = 0.0;
140 double eps_Lorentzian = 0.0;
141 double imeps_Lorentzian = 0.0;
147 imeps_Gaussian += osc[i_exc] * BSESingletEnergies(i_exc) *
151 imeps_Lorentzian += osc[i_exc] * BSESingletEnergies(i_exc) *
155 ofs <<
e <<
" " << eps_Gaussian <<
" " << imeps_Gaussian <<
" "
156 << eps_Lorentzian <<
" " << imeps_Lorentzian << std::endl;
160 <<
" Spectrum in energy range from " <<
lower_ <<
" to " <<
upper_
161 <<
" eV and with broadening of FWHM " <<
fwhm_
162 <<
" eV written to file " <<
output_file_ << std::flush;
167 ofs <<
"# lambda(nm) epsGaussian IM(eps)Gaussian epsLorentz "
173 double eps_Gaussian = 0.0;
174 double imeps_Gaussian = 0.0;
175 double eps_Lorentzian = 0.0;
176 double imeps_Lorentzian = 0.0;
180 eps_Gaussian += osc[i_exc] *
Gaussian(lambda, exc_lambda,
fwhm_);
182 osc[i_exc] * exc_lambda *
Gaussian(lambda, exc_lambda,
fwhm_);
188 ofs << lambda <<
" " << eps_Gaussian <<
" " << imeps_Gaussian
189 <<
" " << eps_Lorentzian <<
" " << imeps_Lorentzian << std::endl;
192 <<
" Spectrum in wavelength range from " <<
lower_ <<
" to " <<
upper_
193 <<
" nm and with broadening of FWHM " <<
fwhm_
194 <<
" nm written to file " <<
output_file_ << std::flush;
202 return 0.5 * fwhm / (std::pow(x - center, 2) + 0.25 * fwhm * fwhm) /
203 boost::math::constants::pi<double>();
208 double sigma = fwhm / 2.3548;
209 return std::exp(-0.5 * std::pow((x - center) / sigma, 2)) / sigma /
210 sqrt(2.0 * boost::math::constants::pi<double>());
void setReportLevel(Log::Level ReportLevel)
void setMultithreading(bool maverick)
void setCommonPreface(const std::string &preface)
container for molecular orbitals
const tools::EigenSystem & BSESinglets() const
bool hasBSESinglets() const
Eigen::VectorXd Oscillatorstrengths() const
bool hasTransitionDipoles() const
const std::vector< Eigen::Vector3d > & TransitionDipoles() const
void ReadFromCpt(const std::string &filename)
double Lorentzian(double x, double center, double fwhm)
double invcmtonm(double invcm)
std::string spectrum_type_
double evtoinvcm(double eV)
double nmtoinvcm(double nm)
double Gaussian(double x, double center, double fwhm)
void ParseOptions(const tools::Property &user_options)
#define XTP_LOG(level, log)
base class for all analysis tools
static Level current_level