TBTK
ElectronFluctuationVertex.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_ELECTRON_FLUCTUATION_VERTEX
24 #define COM_DAFER45_TBTK_SOLVER_ELECTRON_FLUCTUATION_VERTEX
25 
26 #include "TBTK/BrillouinZone.h"
27 #include "TBTK/IndexedDataTree.h"
28 #include "TBTK/Property/Susceptibility.h"
30 //#include "TBTK/RPA/RPASusceptibilityCalculator.h"
31 
32 namespace TBTK{
33 namespace Solver{
34 
36 public:
39  const MomentumSpaceContext &momentumSpaceContext,
40  const Property::Susceptibility &chargeSusceptibility,
41  const Property::Susceptibility &spinSusceptibility
42  );
43 
45 // ~ElectronFluctuationVertexCalculator();
46 
50 // ElectronFluctuationVertexCalculator* createSlave();
51 
54 
57 
60 
63 // enum class EnergyType {Real, Imaginary, Complex};
64 
66 // void setEnergyType(EnergyType energyType);
67 
69 // EnergyType getEnergyType() const;
70 
73 /* void setEnergies(
74  const std::vector<std::complex<double>> &energies
75  );*/
76 
85 /* void setEnergiesAreInversionSymmetric(
86  bool energiesAreInversionSymmetric
87  );*/
88 
90 // bool getEnergiesAreInversionSymmetric() const;
91 
93 /* std::vector<std::complex<double>> calculateSelfEnergyVertex(
94  const std::vector<double> &k,
95  const std::vector<int> &orbitalIndices
96  );*/
97 
99  std::vector<std::complex<double>> calculateSelfEnergyVertex(
100  const Index &index
101  );
102 
104  void setU(std::complex<double> U);
105 
107  void setUp(std::complex<double> Up);
108 
110  void setJ(std::complex<double> J);
111 
113  void setJp(std::complex<double> Jp);
114 
118 
120 // void saveSusceptibilities(const std::string &filename) const;
121 
123 // void loadSusceptibilities(const std::string &filename);
124 private:
126 // RPASusceptibilityCalculator *rpaSusceptibilityCalculator;
127 
129  const MomentumSpaceContext &momentumSpaceContext;
130 
132  const Property::Susceptibility &chargeSusceptibility;
133 
135  const Property::Susceptibility &spinSusceptibility;
136 
138 // EnergyType energyType;
139 
141 // std::vector<std::complex<double>> energies;
142 
144  bool isInitialized;
145 
147 // IndexedDataTree<SerializableVector<std::complex<double>>> vertexTree;
148 
150  std::complex<double> U, Up, J, Jp;
151 
153  std::vector<InteractionAmplitude> u1;
154  std::vector<InteractionAmplitude> u2;
155  std::vector<InteractionAmplitude> u3;
156 
159  bool interactionAmplitudesAreGenerated;
160 
162 /* ElectronFluctuationVertexCalculator(
163  RPASusceptibilityCalculator &rpaSusceptibilityCalculator
164  );*/
165 };
166 
167 inline const MomentumSpaceContext&
169  return momentumSpaceContext;
170 }
171 
172 inline const Property::Susceptibility&
174  return chargeSusceptibility;
175 }
176 
177 inline const Property::Susceptibility&
179  return spinSusceptibility;
180 }
181 
182 /*inline void ElectronFluctuationVertexCalculator::setEnergyType(
183  EnergyType energyType
184 ){
185  this->energyType = energyType;
186  switch(energyType){
187  case EnergyType::Real:
188  rpaSusceptibilityCalculator->setEnergyType(
189  RPASusceptibilityCalculator::EnergyType::Real
190  );
191  break;
192  case EnergyType::Imaginary:
193  rpaSusceptibilityCalculator->setEnergyType(
194  RPASusceptibilityCalculator::EnergyType::Imaginary
195  );
196  break;
197  case EnergyType::Complex:
198  rpaSusceptibilityCalculator->setEnergyType(
199  RPASusceptibilityCalculator::EnergyType::Complex
200  );
201  break;
202  default:
203  TBTKExit(
204  "ElectronFluctuationVertexCalculator::setEnergyType()",
205  "Unknown energy type.",
206  "This should never happen, contact the developer."
207  );
208  }
209 }
210 
211 inline ElectronFluctuationVertexCalculator::EnergyType ElectronFluctuationVertexCalculator::getEnergyType(
212 ) const{
213  return energyType;
214 }
215 
216 inline void ElectronFluctuationVertexCalculator::setEnergies(
217  const std::vector<std::complex<double>> &energies
218 ){
219  this->energies = energies;
220  vertexTree.clear();
221 
222  rpaSusceptibilityCalculator->setEnergies(energies);
223 }
224 
225 inline void ElectronFluctuationVertexCalculator::setEnergiesAreInversionSymmetric(
226  bool energiesAreInversionSymmetric
227 ){
228  rpaSusceptibilityCalculator->setEnergiesAreInversionSymmetric(
229  energiesAreInversionSymmetric
230  );
231 }
232 
233 inline bool ElectronFluctuationVertexCalculator::getEnergiesAreInversionSymmetric(
234 ) const{
235  return rpaSusceptibilityCalculator->getEnergiesAreInversionSymmetric();
236 }*/
237 
238 inline void ElectronFluctuationVertex::setU(std::complex<double> U){
239  this->U = U;
240  interactionAmplitudesAreGenerated = false;
241 }
242 
243 inline void ElectronFluctuationVertex::setUp(std::complex<double> Up){
244  this->Up = Up;
245  interactionAmplitudesAreGenerated = false;
246 }
247 
248 inline void ElectronFluctuationVertex::setJ(std::complex<double> J){
249  this->J = J;
250  interactionAmplitudesAreGenerated = false;
251 }
252 
253 inline void ElectronFluctuationVertex::setJp(std::complex<double> Jp){
254  this->Jp = Jp;
255  interactionAmplitudesAreGenerated = false;
256 }
257 
258 /*inline void ElectronFluctuationVertexCalculator::saveSusceptibilities(
259  const std::string &filename
260 ) const{
261  rpaSusceptibilityCalculator->saveSusceptibilities(filename);
262 }
263 
264 inline void ElectronFluctuationVertexCalculator::loadSusceptibilities(
265  const std::string &filename
266 ){
267  rpaSusceptibilityCalculator->loadSusceptibilities(filename);
268 }*/
269 
270 }; //End of namespace Solver
271 }; //End of namespace TBTK
272 
273 #endif
Base class for Solvers.
Definition: Solver.h:32
void setJp(std::complex< double > Jp)
Definition: ElectronFluctuationVertex.h:253
const Property::Susceptibility & getChargeSusceptibility() const
Definition: ElectronFluctuationVertex.h:173
Definition: ElectronFluctuationVertex.h:35
const MomentumSpaceContext & getMomentumSpaceContext() const
Definition: ElectronFluctuationVertex.h:168
Brillouin zone.
ElectronFluctuationVertex(const MomentumSpaceContext &momentumSpaceContext, const Property::Susceptibility &chargeSusceptibility, const Property::Susceptibility &spinSusceptibility)
Property container for density.
Data structure for storing data associated with an index.
const Property::Susceptibility & getSpinSusceptibility() const
Definition: ElectronFluctuationVertex.h:178
Definition: MomentumSpaceContext.h:32
void setJ(std::complex< double > J)
Definition: ElectronFluctuationVertex.h:248
Flexible physical index.
Definition: Index.h:69
Definition: ModelFactory.h:35
Property container for the Susceptibility.
Definition: Susceptibility.h:36
void setUp(std::complex< double > Up)
Definition: ElectronFluctuationVertex.h:243
void setU(std::complex< double > U)
Definition: ElectronFluctuationVertex.h:238
std::vector< std::complex< double > > calculateSelfEnergyVertex(const Index &index)