votca 2024.2-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 jeff2e;
68 double jeff2h;
69 double jeff2s;
70 double jeff2t;
71 };
72
73 static PairType get_Enum(std::string type) {
74 if (type == "Hopping") {
75 return PairType::Hopping;
76 } else if (type == "Excitoncl") {
78 } else {
79 throw std::runtime_error("get_Enum input is invalid");
80 }
81 }
82
83 QMPair(Index id, const Segment* seg1, const Segment* seg2,
84 const Eigen::Vector3d& delta_R);
85
86 QMPair(const data& d, const std::vector<Segment>& segments) {
87 ReadData(d, segments);
88 }
89
90 Index getId() const { return id_; }
91 void setId(Index id) { id_ = id; }
92
93 const Eigen::Vector3d& R() const { return R_; }
94 double Dist() const { return R_.norm(); }
95
96 void setLambdaO(double lO, QMStateType state) {
97 lambda0_.setValue(lO, state);
98 }
99 double getLambdaO(QMStateType state) const {
100 return lambda0_.getValue(state);
101 }
102
103 double getReorg12(QMStateType state) const {
104 return segments_.first->getU_nX_nN(state) +
105 segments_.second->getU_xN_xX(state);
106 } // 1->2
107 double getReorg21(QMStateType state) const {
108 return segments_.first->getU_xN_xX(state) +
109 segments_.second->getU_nX_nN(state);
110 } // 2->1
111
112 double getJeff2(QMStateType state) const { return Jeff2_.getValue(state); }
113 void setJeff2(double Jeff2, QMStateType state) {
114 Jeff2_.setValue(Jeff2, state);
115 }
116
117 double getdE12(QMStateType state) const {
118 return segments_.first->getSiteEnergy(state) -
119 segments_.second->getSiteEnergy(state);
120 }
121
122 Segment Seg2PbCopy() const;
123 const Segment* Seg1() const { return segments_.first; }
124 const Segment* Seg2() const { return segments_.second; }
125
126 const Segment* first() { return segments_.first; }
127 const Segment* second() { return segments_.second; }
128
129 void setType(PairType pair_type) { pair_type_ = pair_type; }
130 const PairType& getType() const { return pair_type_; }
131
132 static void SetupCptTable(CptTable& table);
133 void WriteData(data& d) const;
134
135 void ReadData(const data& d, const std::vector<Segment>& segments);
136
137 private:
138 Index id_ = -1;
139 std::pair<const Segment*, const Segment*> segments_;
140
141 Eigen::Vector3d R_ = Eigen::Vector3d::Zero();
142
144
147};
148
149} // namespace xtp
150} // namespace votca
151
152#endif // VOTCA_XTP_QMPAIR_H
const Segment * Seg2() const
Definition qmpair.h:124
void setLambdaO(double lO, QMStateType state)
Definition qmpair.h:96
double getJeff2(QMStateType state) const
Definition qmpair.h:112
const Segment * first()
Definition qmpair.h:126
double getReorg21(QMStateType state) const
Definition qmpair.h:107
Eigen::Vector3d R_
Definition qmpair.h:141
const Segment * Seg1() const
Definition qmpair.h:123
static PairType get_Enum(std::string type)
Definition qmpair.h:73
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:91
PairType pair_type_
Definition qmpair.h:143
void setType(PairType pair_type)
Definition qmpair.h:129
Segment Seg2PbCopy() const
Definition qmpair.cc:37
std::pair< const Segment *, const Segment * > segments_
Definition qmpair.h:139
const Segment * second()
Definition qmpair.h:127
void WriteData(data &d) const
Definition qmpair.cc:70
const Eigen::Vector3d & R() const
Definition qmpair.h:93
static void SetupCptTable(CptTable &table)
Definition qmpair.cc:49
void setJeff2(double Jeff2, QMStateType state)
Definition qmpair.h:113
QMPair(const data &d, const std::vector< Segment > &segments)
Definition qmpair.h:86
double getLambdaO(QMStateType state) const
Definition qmpair.h:99
QMStateCarrierStorage< double > lambda0_
Definition qmpair.h:145
void ReadData(const data &d, const std::vector< Segment > &segments)
Definition qmpair.cc:92
double getdE12(QMStateType state) const
Definition qmpair.h:117
const PairType & getType() const
Definition qmpair.h:130
Index getId() const
Definition qmpair.h:90
double getReorg12(QMStateType state) const
Definition qmpair.h:103
double Dist() const
Definition qmpair.h:94
QMStateCarrierStorage< double > Jeff2_
Definition qmpair.h:146
Storage class for properties of QMStateTypes, which can be used in KMC.
Definition qmstate.h:105
T getValue(QMStateType t) const
Definition qmstate.h:115
void setValue(T value, QMStateType t)
Definition qmstate.h:109
base class for all analysis tools
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26