43 throw std::runtime_error(
"Diabatization method unknown!");
49 if (options.
exists(
".orb_file2")) {
51 E1_ = options.
get(
".E1").
as<
double>();
52 E2_ = options.
get(
".E2").
as<
double>();
66 throw std::runtime_error(
"State idx 1 must start from 1.");
72 throw std::runtime_error(
"State idx 2 must start from 1.");
79 if (options.
exists(
".fragments")) {
80 std::vector<tools::Property*> prop_region =
81 options.
Select(
"fragments.fragment");
84 std::string indices = prop->get(
"indices").as<std::string>();
123 double QMMM_correction;
139 std::pair<Eigen::VectorXd, Eigen::MatrixXd> rotate_H =
141 E1ad = rotate_H.first(0);
142 E2ad = rotate_H.first(1);
143 Eigen::MatrixXd& diabatic_H = rotate_H.second;
148 << format(
"Diabatic Energy 1: %1$+1.12f eV") %
152 << format(
"Diabatic Energy 2: %1$+1.12f eV") %
159 QMMM_correction = (
E2_ -
E1_) / (E2ad - E1ad);
161 J_QMMM = J * QMMM_correction;
163 if (std::abs(diabatic_H(1, 0) - diabatic_H(0, 1)) >
164 1
e-4 * std::abs(diabatic_H(1, 0))) {
167 <<
" --- Check carefully!" << flush;
181 << format(
"Unprojected diabatic Coupling: %1$+1.12f eV") % (J_unproj)
189 QMMM_correction = (
E2_ -
E1_) / (Ead.second - Ead.first);
190 J_QMMM = J * QMMM_correction;
197 throw std::runtime_error(
"Fragments are undefined in FCD!");
210 QMMM_correction = (
E2_ -
E1_) / (Ead.second - Ead.first);
211 J_QMMM = J * QMMM_correction;
217 << format(
"Internal adiabatic energies: %1$+1.12f eV and %2$+1.12f eV") %
223 << format(
"Diabatic Coupling: %1$+1.12f eV ") % (J) << flush;
227 << format(
"QMMM adiabatic energies: %1$+1.12f eV and %2$+1.12f eV") %
233 << format(
"QMMM correction factor: %1$+1.12f ") % (QMMM_correction)
236 << format(
"Diabatic Coupling with QMMM: %1$+1.12f eV ") % (J_QMMM)
void ParseOptions(const tools::Property &user_options) final
std::vector< QMFragment< BSE_Population > > fragments_
std::pair< Eigen::VectorXd, Eigen::MatrixXd > Calculate_diabatic_H(const double angle) const
double Calculate_angle() const
const std::pair< double, double > adiabatic_energies()
double calculate_coupling()
std::pair< double, double > calculate_coupling()
const std::pair< double, double > adiabatic_energies()
void setReportLevel(Log::Level ReportLevel)
void setMultithreading(bool maverick)
void setCommonPreface(const std::string &preface)
container for molecular orbitals
bool getTDAApprox() const
void ReadFromCpt(const std::string &filename)
Timestamp returns the current time as a string Example: cout << TimeStamp()
#define XTP_LOG(level, log)
void setMaxThreads(Index)
base class for all analysis tools
static Level current_level