votca 2024.1-dev
Loading...
Searching...
No Matches
gmhdiabatization.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"
23
24using boost::format;
25using std::flush;
26
27namespace votca {
28namespace xtp {
29
31
32 // Check on dftbasis
34 throw std::runtime_error("Different DFT basis for the two input file.");
35 }
36
37 // check BSE indices
39 throw std::runtime_error("Different BSE vmin for the two input file.");
40 }
41
43 throw std::runtime_error("Different BSE vmax for the two input file.");
44 }
45
47 throw std::runtime_error("Different BSE cmin for the two input file.");
48 }
49
51 throw std::runtime_error("Different BSE cmax for the two input file.");
52 }
53
55
59 } else {
62 }
63}
64
65std::pair<double, double> GMHDiabatization::calculate_coupling() {
66
67 // calculate electric dipole moment in state 1
68 QMState state1 = QMState(qmtype_, state_idx_1_ - 1, false);
69 Eigen::Vector3d state1_dipole = orbitals1_.CalcElDipole(state1);
71 << TimeStamp() << " Dipole Moment excited state 1 " << state1_dipole[0]
72 << "\t" << state1_dipole[1] << "\t" << state1_dipole[2] << flush;
73
74 // calculate electric dipole moment in state 2
75 QMState state2 = QMState(qmtype_, state_idx_2_ - 1, false);
76 Eigen::Vector3d state2_dipole = orbitals2_.CalcElDipole(state2);
78 << TimeStamp() << " Dipole Moment excited state 2 " << state2_dipole[0]
79 << "\t" << state2_dipole[1] << "\t" << state2_dipole[2] << flush;
80
81 // calculate transition dipole moment from 1 to 2
82 Eigen::Vector3d transition_dip = transition_dipole(state1, state2);
84 << TimeStamp() << " Transition Dipole Moment " << transition_dip[0]
85 << "\t" << transition_dip[1] << "\t" << transition_dip[2] << flush;
86
87 // Generalized Mulliken-Hush coupling
88 double abs_transition_dip = transition_dip.norm();
89 double dipole_diff_norm = (state1_dipole - state2_dipole).norm();
90 double coupling = (abs_transition_dip * (E2_ - E1_)) /
91 std::sqrt(std::pow(dipole_diff_norm, 2) +
92 4.0 * std::pow(abs_transition_dip, 2));
93
94 // with the "projection" from Stanford people
95 Eigen::Vector3d CT_direction =
96 (state1_dipole - state2_dipole) / (state1_dipole - state2_dipole).norm();
97 double proj_transition_dip = transition_dip.dot(CT_direction);
98 double coupling_proj = (std::abs(proj_transition_dip) * (E2_ - E1_)) /
99 std::sqrt(std::pow(dipole_diff_norm, 2) +
100 4.0 * std::pow(proj_transition_dip, 2));
101
102 return std::pair<double, double>(coupling, coupling_proj);
103}
104
106 QMState state2) {
107
109 AODipole dipole;
111 dipole.Fill(basis);
112
114 tdmat.configure();
115 Eigen::MatrixXd tmat = tdmat.Matrix(state1, state2);
116
117 Eigen::Vector3d electronic_dip;
118 for (Index i = 0; i < 3; ++i) {
119 electronic_dip(i) = tmat.cwiseProduct(dipole.Matrix()[i]).sum();
120 }
121
122 return electronic_dip;
123}
124
125} // namespace xtp
126} // namespace votca
const Eigen::VectorXd & eigenvalues() const
Definition eigensystem.h:30
Container to hold Basisfunctions for all atoms.
Definition aobasis.h:42
void setCenter(const Eigen::Vector3d &r)
Definition aomatrix.h:94
const std::array< Eigen::MatrixXd, 3 > & Matrix() const
Definition aomatrix.h:92
void Fill(const AOBasis &aobasis) final
const Eigen::Vector3d & getPos() const
std::pair< double, double > calculate_coupling()
Eigen::Vector3d transition_dipole(QMState state1, QMState state2)
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 QMMolecule & QMAtoms() const
Definition orbitals.h:172
const std::string & getDFTbasisName() const
Definition orbitals.h:202
Eigen::Vector3d CalcElDipole(const QMState &state) const
Definition orbitals.cc:242
const AOBasis & getDftBasis() const
Definition orbitals.h:208
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
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
Eigen::Index Index
Definition types.h:26