32 log_.setMultithreading(
true);
33 log_.setCommonPreface(
"\n...");
41 std::string fragment_A_str = options.
get(
".fragment_A").
as<std::string>();
42 std::string fragment_B_str = options.
get(
".fragment_B").
as<std::string>();
43 if (fragment_A_str.empty() || fragment_B_str.empty()) {
44 throw std::runtime_error(
45 "PodCouplingTool: fragment_A and fragment_B must both be given, "
46 "e.g. '0:5' and '6:11' (same syntax as cdft.indices).");
81 log_.setMultithreading(
true);
82 log_.setCommonPreface(
"\n...");
101 <<
" Full coupling matrix [eV] (fragment A orbital "
102 "index -> fragment B orbital index):"
106 std::ostringstream row;
107 row <<
" A[" << levelA << (levelA == homoA ?
"=HOMO" :
"")
108 << (levelA == lumoA ?
"=LUMO" :
"") <<
"]:";
113 row << boost::format(
" B[%1%]=%2$+1.6f") % levelB % coupling_ev;
119 double homo_homo_ev =
121 double lumo_lumo_ev =
124 << boost::format(
"POD2 Coupling, HOMO-HOMO (hole): %1$+1.12f eV") %
128 << boost::format(
"POD2 Coupling, LUMO-LUMO (electron): %1$+1.12f eV") %
139 <<
" Writing cube files for the computed fragment "
143 auto WriteFragmentOrbitalCube = [&](
bool fragment_A,
Index level,
144 const std::string& label) {
149 std::string filename =
150 "podcoupling_" + label +
"_orb" + std::to_string(level) +
".cube";
151 writer.
WriteFile(filename, orbitals_copy,
161 WriteFragmentOrbitalCube(
true, levelA,
"fragA");
165 WriteFragmentOrbitalCube(
false, levelB,
"fragB");
172 std::cout << std::endl;
void WriteFile(const std::string &filename, const Orbitals &orb, QMState state, bool dostateonly) const
std::vector< Index > CreateIndexVector(const std::string &Ids) const
Container for molecular orbitals and derived one-particle data.
const tools::EigenSystem & MOs() const
Return read-only access to alpha/restricted molecular orbitals.
void ReadFromCpt(const std::string &filename)
Read the orbital container from a checkpoint file on disk.
Index getFragmentAHomoIndex() const
void CalculateCouplings(Index numberofstatesA, Index numberofstatesB)
double getCouplingElement(Index levelA, Index levelB) const
Eigen::VectorXd GetFragmentOrbital(bool fragment_A, Index level) const
Index getFragmentBLumoIndex() const
Index getFragmentALumoIndex() const
Index getFragmentBHomoIndex() const
std::string DescribeFragmentOrbitalComposition(bool fragment_A, Index level, Index top_n=5) const
Identifier for QMstates. Strings like S1 are converted into enum +zero indexed int.
Timestamp returns the current time as a string Example: cout << TimeStamp().
#define XTP_LOG(level, log)
void setMaxThreads(Index)
Charge transport classes.
Provides a means for comparing floating point numbers.
static Level current_level