TBTK
SelfEnergy.h
1 /* Copyright 2017 Kristofer Bj√∂rnson
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
23 #ifndef COM_DAFER45_TBTK_SOLVER_SELF_ENERGY
24 #define COM_DAFER45_TBTK_SOLVER_SELF_ENERGY
25 
26 #include "TBTK/BrillouinZone.h"
27 #include "TBTK/IndexedDataTree.h"
30 #include "TBTK/Solver/Solver.h"
31 
32 namespace TBTK{
33 namespace Solver{
34 
35 class SelfEnergy : public Solver{
36 public:
38  SelfEnergy(
39  const MomentumSpaceContext &momentumSpaceContext,
40  const Property::InteractionVertex &interactionVertex
41  );
42 
44  ~SelfEnergy();
45 
48 
53 
55  void init();
56 
59 /* void setSelfEnergyEnergies(
60  const std::vector<std::complex<double>> &selfEnergyEnergies
61  );*/
62 
64 /* std::vector<std::complex<double>> calculateSelfEnergy(
65  const std::vector<double> &k,
66  const std::vector<int> &orbitalIndices
67  );*/
68 
70  std::vector<std::complex<double>> calculateSelfEnergy(
71  const Index &index,
72  const std::vector<std::complex<double>> &energies
73  );
74 
76  std::vector<std::complex<double>> calculateSelfEnergySelfConsistently(
77  unsigned int numMatsubaraFrequencies,
78  const std::vector<std::complex<double>> &energies
79  );
80 
82 // void setU(std::complex<double> U);
83 
85 // void setUp(std::complex<double> Up);
86 
88 // void setJ(std::complex<double> J);
89 
91 // void setJp(std::complex<double> Jp);
92 private:
94  const MomentumSpaceContext &momentumSpaceContext;
95 
97  const Property::InteractionVertex &interactionVertex;
98 
100  int *kMinusQLookupTable;
101 
104  void generateKMinusQLookupTable();
105 
107  template<bool useKPlusKLookupTable>
108  int getKMinusQLinearIndex(
109  unsigned int meshIndex,
110  const std::vector<double> &k,
111  int kLinearIndex
112  ) const;
113 
115 // std::vector<std::complex<double>> selfEnergyEnergies;
116 
118  bool isInitialized;
119 
121 /* template<bool singleSelfEnergyEnergy>
122  void selfEnergyMainLoop(
123  const std::vector<double> &k,
124  const std::vector<int> &orbitalIndices,
125  std::vector<std::complex<double>> &result
126  );*/
127 
129  template<bool singleSelfEnergyEnergy>
130  void selfEnergyMainLoop(
131  const Index &index,
132  const std::vector<std::complex<double>> &energies,
133  std::vector<std::complex<double>> &result
134  );
135 
137 // std::complex<double> U, Up, J, Jp;
138 };
139 
141 ) const{
142  return momentumSpaceContext;
143 }
144 
146 ) const{
147  return interactionVertex;
148 }
149 
150 /*inline void SelfEnergy::setSelfEnergyEnergies(
151  const std::vector<std::complex<double>> &selfEnergyEnergies
152 ){
153  this->selfEnergyEnergies = selfEnergyEnergies;
154 }*/
155 
156 /*inline void SelfEnergy::setU(std::complex<double> U){
157  this->U = U;
158 }
159 
160 inline void SelfEnergy::setUp(std::complex<double> Up){
161  this->Up = Up;
162 }
163 
164 inline void SelfEnergy::setJ(std::complex<double> J){
165  this->J = J;
166 }
167 
168 inline void SelfEnergy::setJp(std::complex<double> Jp){
169  this->Jp = Jp;
170 }*/
171 
172 }; //End of namespace Solver
173 }; //End of namespace TBTK
174 
175 #endif
Base class for Solvers.
Definition: Solver.h:32
const MomentumSpaceContext & getMomentumSpaceContext() const
Definition: SelfEnergy.h:140
std::vector< std::complex< double > > calculateSelfEnergy(const Index &index, const std::vector< std::complex< double >> &energies)
Property container for the Susceptibility.
Definition: InteractionVertex.h:36
Brillouin zone.
Property container for density.
Data structure for storing data associated with an index.
SelfEnergy(const MomentumSpaceContext &momentumSpaceContext, const Property::InteractionVertex &interactionVertex)
Definition: MomentumSpaceContext.h:32
Base class for Solvers.
Definition: SelfEnergy.h:35
Flexible physical index.
Definition: Index.h:69
Definition: ModelFactory.h:35
Property container for an InteractionVertex.
std::vector< std::complex< double > > calculateSelfEnergySelfConsistently(unsigned int numMatsubaraFrequencies, const std::vector< std::complex< double >> &energies)
const Property::InteractionVertex & getInteractionVertex() const
Definition: SelfEnergy.h:145