votca 2026-dev
Loading...
Searching...
No Matches
qmpair.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2020 The VOTCA Development Team
3 * (http://www.votca.org)
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License")
6 *
7 * You may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 */
21
22#pragma once
23#ifndef VOTCA_XTP_QMPAIR_H
24#define VOTCA_XTP_QMPAIR_H
25
26// Standard includes
27#include <vector>
28
29// Local VOTCA includes
30#include "eigen.h"
31#include "qmstate.h"
32#include "segment.h"
33
34namespace votca {
35namespace xtp {
36
37class QMPair {
38 public:
39 enum PairType { Hopping = 0, Excitoncl = 1 };
40
41 static std::string get_name(PairType type) {
42 switch (type) {
43 case Hopping:
44 return "Hopping";
45 case Excitoncl:
46 return "Excitoncl";
47 // no default case to trigger compiler error
48 }
49 return "";
50 }
51
52 struct data {
56 double RX;
57 double RY;
58 double RZ;
59
60 char* pair_type;
61
62 double lambda0e;
63 double lambda0h;
64 double lambda0s;
65 double lambda0t;
66
67 double jeffe;
68 double jeffh;
69 double jeffs;
70 double jefft;
71
72 double jeff2e;
73 double jeff2h;
74 double jeff2s;
75 double jeff2t;
76 };
77
78 static PairType get_Enum(std::string type) {
79 if (type == "Hopping") {
80 return PairType::Hopping;
81 } else if (type == "Excitoncl") {
83 } else {
84 throw std::runtime_error("get_Enum input is invalid");
85 }
86 }
87
88 QMPair(Index id, const Segment* seg1, const Segment* seg2,
89 const Eigen::Vector3d& delta_R);
90
91 QMPair(const data& d, const std::vector<Segment>& segments) {
92 ReadData(d, segments);
93 }
94
95 Index getId() const { return id_; }
96 void setId(Index id) { id_ = id; }
97
98 const Eigen::Vector3d& R() const { return R_; }
99 double Dist() const { return R_.norm(); }
100
101 void setLambdaO(double lO, QMStateType state) {
102 lambda0_.setValue(lO, state);
103 }
104 double getLambdaO(QMStateType state) const {
105 return lambda0_.getValue(state);
106 }
107
108 double getReorg12(QMStateType state) const {
109 return segments_.first->getU_nX_nN(state) +
110 segments_.second->getU_xN_xX(state);
111 } // 1->2
112 double getReorg21(QMStateType state) const {
113 return segments_.first->getU_xN_xX(state) +
114 segments_.second->getU_nX_nN(state);
115 } // 2->1
116
117 double getJeff(QMStateType state) const { return Jeff_.getValue(state); }
118 void setJeff(double Jeff, QMStateType state) { Jeff_.setValue(Jeff, state); }
119
120 double getJeff2(QMStateType state) const { return Jeff2_.getValue(state); }
121 void setJeff2(double Jeff2, QMStateType state) {
122 Jeff2_.setValue(Jeff2, state);
123 }
124
125 double getdE12(QMStateType state) const {
126 return segments_.first->getSiteEnergy(state) -
127 segments_.second->getSiteEnergy(state);
128 }
129
130 Segment Seg2PbCopy() const;
131 const Segment* Seg1() const { return segments_.first; }
132 const Segment* Seg2() const { return segments_.second; }
133
134 const Segment* first() { return segments_.first; }
135 const Segment* second() { return segments_.second; }
136
137 void setType(PairType pair_type) { pair_type_ = pair_type; }
138 const PairType& getType() const { return pair_type_; }
139
140 static void SetupCptTable(CptTable& table);
141 void WriteData(data& d) const;
142
143 void ReadData(const data& d, const std::vector<Segment>& segments);
144
145 private:
146 Index id_ = -1;
147 std::pair<const Segment*, const Segment*> segments_;
148
149 Eigen::Vector3d R_ = Eigen::Vector3d::Zero();
150
152
156};
157
158} // namespace xtp
159} // namespace votca
160
161#endif // VOTCA_XTP_QMPAIR_H
const Segment * Seg2() const
Definition qmpair.h:132
void setLambdaO(double lO, QMStateType state)
Definition qmpair.h:101
double getJeff2(QMStateType state) const
Definition qmpair.h:120
const Segment * first()
Definition qmpair.h:134
double getReorg21(QMStateType state) const
Definition qmpair.h:112
Eigen::Vector3d R_
Definition qmpair.h:149
const Segment * Seg1() const
Definition qmpair.h:131
static PairType get_Enum(std::string type)
Definition qmpair.h:78
static std::string get_name(PairType type)
Definition qmpair.h:41
QMPair(Index id, const Segment *seg1, const Segment *seg2, const Eigen::Vector3d &delta_R)
Definition qmpair.cc:30
void setId(Index id)
Definition qmpair.h:96
double getJeff(QMStateType state) const
Definition qmpair.h:117
PairType pair_type_
Definition qmpair.h:151
void setType(PairType pair_type)
Definition qmpair.h:137
Segment Seg2PbCopy() const
Definition qmpair.cc:37
std::pair< const Segment *, const Segment * > segments_
Definition qmpair.h:147
const Segment * second()
Definition qmpair.h:135
void WriteData(data &d) const
Definition qmpair.cc:75
const Eigen::Vector3d & R() const
Definition qmpair.h:98
static void SetupCptTable(CptTable &table)
Definition qmpair.cc:49
void setJeff2(double Jeff2, QMStateType state)
Definition qmpair.h:121
QMPair(const data &d, const std::vector< Segment > &segments)
Definition qmpair.h:91
double getLambdaO(QMStateType state) const
Definition qmpair.h:104
QMStateCarrierStorage< double > Jeff_
Definition qmpair.h:154
QMStateCarrierStorage< double > lambda0_
Definition qmpair.h:153
void ReadData(const data &d, const std::vector< Segment > &segments)
Definition qmpair.cc:102
double getdE12(QMStateType state) const
Definition qmpair.h:125
const PairType & getType() const
Definition qmpair.h:138
Index getId() const
Definition qmpair.h:95
double getReorg12(QMStateType state) const
Definition qmpair.h:108
void setJeff(double Jeff, QMStateType state)
Definition qmpair.h:118
double Dist() const
Definition qmpair.h:99
QMStateCarrierStorage< double > Jeff2_
Definition qmpair.h:155
Storage class for properties of QMStateTypes, which can be used in KMC.
Definition qmstate.h:108
Provides a means for comparing floating point numbers.
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26