NanoStructures  1.0
DMFT solver for layered, strongly correlated nanostructures
dmft.h
1 #ifndef DMFT_H
2 #define DMFT_H
3 
4 #include "../math/cfunction.h"
5 #include "../utils/complex.h"
6 #include "dos.h"
7 
8 namespace config {
9  class Configuration;
10 }
11 
12 namespace dmft {
13 class DMFT
14 {
15 public:
16  DMFT();
17 
18  void configure(config::Configuration& configuration);
19 
20  //getters and setters
21  void setU(double U) { m_U = U; }
22  void setMu(double mu) { m_mu = mu; }
23  void setT(double T) { m_T = T; }
24  void setDelta(double delta) { m_delta = delta; }
25  void setTolerance(double tolerance) { m_tolerance = tolerance; }
26  void setMaxIterations(int maxIterations) { m_maxIterations = maxIterations; }
27  inline double getT() { return m_T; }
28  inline double getU() { return m_U; }
29  inline double getMu() { return m_mu; }
30  inline double getDelta() { return m_delta; }
31  inline double getScaling() { return m_scaling; }
32  void setStartWithDelta(bool startWithDelta) { m_startWithDelta = startWithDelta; }
33  void setScaling(double scaling) { m_scaling = scaling; }
34  math::CFunction getSelfEnergy() { return m_selfEnergy; }
35  math::CFunction getGreensFunction() { return m_greenFunction; }
36  math::CFunction getHybridizationFunction() { return m_effectiveMedium; }
37  void setSelfEnergy(const math::CFunction& selfEnergy) { m_selfEnergy = selfEnergy; }
38  void setGreensFunction(const math::CFunction& G) { m_greenFunction = G; }
39  void setHybridizationFunction(const math::CFunction& delta) { m_effectiveMedium = delta; }
40  void solve(std::string outputDirectory = "");
41  ~DMFT();
42 protected:
43 
44  inline static double gReal(double epsk, int nOmega, double omega, std::complex<double> fomega, void * params) {
45  DMFT* dmft = static_cast<DMFT*>(params);
46  std::complex<double> G = 1.0 / (omega + I * dmft->getDelta() - fomega - (epsk - dmft->getU()/2.0 - dmft->getMu()));
47  return G.real() * dos::rho3(epsk);
48  }
49 
50  inline static double gImag(double epsk, int nOmega, double omega, std::complex<double> fomega, void * params) {
51  DMFT* dmft = static_cast<DMFT*>(params);
52  std::complex<double> G = 1.0 / (omega + I * dmft->getDelta() - fomega - (epsk - dmft->getU()/2.0 - dmft->getMu()));
53  return G.imag() * dos::rho3(epsk);
54  }
55 
56  inline static double fReal(double epsk, int nOmega, double omega, std::complex<double> fomega, void * params) {
57  DMFT* dmft = static_cast<DMFT*>(params);
58  std::complex<double> G = 1.0 / (omega + I * dmft->getDelta() - fomega - (epsk - dmft->getU()/2.0 - dmft->getMu()));
59  std::complex<double> F = fomega * G + 1.0;
60  return F.real() * dos::rho3(epsk);
61  }
62 
63  inline static double fImag(double epsk, int nOmega, double omega, std::complex<double> fomega, void * params) {
64  DMFT* dmft = static_cast<DMFT*>(params);
65  std::complex<double> G = 1.0 / (omega + I * dmft->getDelta() - fomega - (epsk - dmft->getU()/2.0 - dmft->getMu()));
66  std::complex<double> F = fomega * G + 1.0;
67  return F.imag() * dos::rho3(epsk);
68  }
69 
70  void calculateGFCF();
71  void calculateGFInt();
72  void calculateFFInt();
73 
74  //helper functions
75  double Im_sqr(double Re, double Im);
76  double Re_sqr(double Re, double Im);
77  double Im_sqrt(double Re, double Im);
78  double Re_sqrt(double Re, double Im);
79  double Im_calc(double Re, double Im);
80  double Re_calc(double Re, double Im);
81 
82  double m_U;
83  double m_T;
84  double m_mu;
85  double m_delta;
86 
87  double m_scaling;
88  double m_tolerance;
89  int m_maxIterations;
90 
91  bool m_startWithDelta;
92 
93  math::CFunction m_selfEnergy;
94  math::CFunction m_greenFunction;
95  math::CFunction m_fFunction;
96  math::CFunction m_effectiveMedium;
97 
98  config::Configuration* m_configuration;
99 };
100 }
101 #endif // DMFT_H
Definition: dmft.h:13
A configuration object which is populated from a configuration file and allows to query and modify co...
Definition: configuration.h:46
Discretized complex-valued function for real arguments.
Definition: cfunction.h:34