votca 2024.1-dev
Loading...
Searching...
No Matches
fcddiabatization.cc
Go to the documentation of this file.
1/*
2 * Copyright 2009-2020 The VOTCA Development Team (http://www.votca.org)
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 */
17
18// VOTCA includes
20#include "votca/xtp/aomatrix.h"
24
25using boost::format;
26using std::flush;
27
28namespace votca {
29namespace xtp {
30
32
33 // Check on dftbasis
35 throw std::runtime_error("Different DFT basis for the two input file.");
36 }
37
38 // check BSE indices
40 throw std::runtime_error("Different BSE vmin for the two input file.");
41 }
42
44 throw std::runtime_error("Different BSE vmax for the two input file.");
45 }
46
48 throw std::runtime_error("Different BSE cmin for the two input file.");
49 }
50
52 throw std::runtime_error("Different BSE cmax for the two input file.");
53 }
54
56
60 } else {
63 }
64}
65
67
68 // calculate fragment charge differences in state 1
69 QMState state1 = QMState(qmtype_, state_idx_1_ - 1, false);
70 Lowdin pops;
72
73 XTP_LOG(Log::error, *pLog_) << TimeStamp() << " Fragment 1 ground state "
74 << fragments_[0].value().Gs << flush;
75 XTP_LOG(Log::error, *pLog_) << TimeStamp() << " Fragment 2 ground state "
76 << fragments_[1].value().Gs << flush;
77
79 << TimeStamp() << " Fragment 1 poulation electron "
80 << fragments_[0].value().E(state_idx_1_ - 1) << flush;
82 << TimeStamp() << " Fragment 1 poulation hole "
83 << fragments_[0].value().H(state_idx_1_ - 1) << flush;
85 << TimeStamp() << " Fragment 2 poulation electron "
86 << fragments_[1].value().E(state_idx_1_ - 1) << flush;
88 << TimeStamp() << " Fragment 2 poulation hole "
89 << fragments_[1].value().H(state_idx_1_ - 1) << flush;
90
91 double dQ11 = fragments_[0].value().H(state_idx_1_ - 1) +
92 fragments_[0].value().E(state_idx_1_ - 1) -
93 fragments_[1].value().H(state_idx_1_ - 1) -
94 fragments_[1].value().E(state_idx_1_ - 1);
95
96 XTP_LOG(Log::error, *pLog_) << TimeStamp() << " dQ11 " << dQ11 << flush;
97
98 // calculate fragment charge differences in state 2
99 QMState state2 = QMState(qmtype_, state_idx_2_ - 1, false);
102 << TimeStamp() << " Fragment 1 poulation electron "
103 << fragments_[0].value().E(state_idx_2_ - 1) << flush;
105 << TimeStamp() << " Fragment 1 poulation hole "
106 << fragments_[0].value().H(state_idx_2_ - 1) << flush;
107
108 double dQ22 = fragments_[0].value().H(state_idx_2_ - 1) +
109 fragments_[0].value().E(state_idx_2_ - 1) -
110 fragments_[1].value().H(state_idx_2_ - 1) -
111 fragments_[1].value().E(state_idx_2_ - 1);
112
113 XTP_LOG(Log::error, *pLog_) << TimeStamp() << " dQ22 " << dQ22 << flush;
114
115 // calculate fragment charge difference from 1 to 2 transition density
117 tdmat.configure();
118 Eigen::MatrixXd tmat = tdmat.Matrix(state1, state2);
120 XTP_LOG(Log::error, *pLog_) << TimeStamp() << " Fragment 1 transition "
121 << fragments_[0].value().Gs << flush;
122 XTP_LOG(Log::error, *pLog_) << TimeStamp() << " Fragment 2 transition "
123 << fragments_[1].value().Gs << flush;
124
125 double dQ12 = fragments_[0].value().Gs - fragments_[1].value().Gs;
126
127 XTP_LOG(Log::error, *pLog_) << TimeStamp() << " dQ12 " << dQ12 << flush;
128
129 // Fragment Charge Difference coupling
130 double coupling =
131 (std::abs(dQ12) * (E2_ - E1_)) /
132 std::sqrt(std::pow(dQ11 - dQ22, 2) + 4.0 * std::pow(dQ12, 2));
133
134 return coupling;
135}
136
137} // namespace xtp
138} // namespace votca
const Eigen::VectorXd & eigenvalues() const
Definition eigensystem.h:30
std::vector< QMFragment< BSE_Population > > fragments_
Index getBSEvmax() const
Definition orbitals.h:286
const tools::EigenSystem & BSETriplets() const
Definition orbitals.h:324
Index getBSEcmin() const
Definition orbitals.h:288
const tools::EigenSystem & BSESinglets() const
Definition orbitals.h:334
Index getBSEcmax() const
Definition orbitals.h:290
Index getBSEvmin() const
Definition orbitals.h:284
const std::string & getDFTbasisName() const
Definition orbitals.h:202
void CalcChargeperFragment(std::vector< QMFragment< BSE_Population > > &frags, const Orbitals &orbitals, QMStateType type) const
void CalcChargeperFragmentTransition(std::vector< QMFragment< BSE_Population > > &frags, const Orbitals &orbitals, const Eigen::MatrixXd &dmat) const
void FromString(const std::string &statetypestring)
Definition qmstate.cc:103
Identifier for QMstates. Strings like S1 are converted into enum +zero indexed int.
Definition qmstate.h:132
const QMStateType & Type() const
Definition qmstate.h:151
Timestamp returns the current time as a string Example: cout << TimeStamp()
Definition logger.h:224
Generalized transition densities tools for different excited states.
Eigen::MatrixXd Matrix(QMState state1, QMState state2)
#define XTP_LOG(level, log)
Definition logger.h:40
base class for all analysis tools
Definition basebead.h:33