votca 2024.2-dev
Loading...
Searching...
No Matches
bse_population.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 */
19
20#pragma once
21#ifndef VOTCA_XTP_BSE_POPULATION_H
22#define VOTCA_XTP_BSE_POPULATION_H
23
24// Local VOTCA includes
25#include "checkpoint.h"
26#include "eigen.h"
27
34namespace votca {
35namespace xtp {
37 Eigen::VectorXd H;
38 Eigen::VectorXd E;
39 double Gs = 0;
40
41 void Initialize(Index size) {
42 H = Eigen::VectorXd::Zero(size);
43 E = Eigen::VectorXd::Zero(size);
44 Gs = 0;
45 }
46
48 w(H, "holeinfo");
49 w(E, "electroninfo");
50 w(Gs, "groundstate");
51 }
52
54 r(H, "holeinfo");
55 r(E, "electroninfo");
56 r(Gs, "groundstate");
57 }
58
59 friend std::ostream& operator<<(std::ostream& out,
60 const BSE_Population& pop) {
61 if (pop.H.size() < 1) {
62 return out;
63 }
64 Eigen::VectorXd diff = pop.H + pop.E;
65 out << "GroundstateCharge:" << pop.Gs << "\n";
66 out << "Index hole electron dQ Qeff\n";
67 for (Index i = 0; i < pop.H.size(); ++i) {
68 out << i << " " << pop.H(i) << " " << pop.E(i) << " " << diff(i) << " "
69 << diff(i) + pop.Gs << "\n";
70 }
71 return out;
72 }
73};
74
75} // namespace xtp
76} // namespace votca
77
78#endif // VOTCA_XTP_BSE_POPULATION_H
base class for all analysis tools
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26
void WriteToCpt(CheckpointWriter &w) const
void ReadFromCpt(CheckpointReader &r)
void Initialize(Index size)
friend std::ostream & operator<<(std::ostream &out, const BSE_Population &pop)