TBTK
Need a break? Support the development by playing Polarity Puzzles
Susceptibility.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 
17 
24 #ifndef COM_DAFER45_TBTK_SOLVER_SUSCEPTIBILITY
25 #define COM_DAFER45_TBTK_SOLVER_SUSCEPTIBILITY
26 
27 #include "TBTK/RPA/MomentumSpaceContext.h"
28 
29 #include <complex>
30 #include <vector>
31 
32 namespace TBTK{
33 namespace Solver{
34 
35 class Susceptibility : public Solver{
36 public:
43  enum Algorithm {
44  Lindhard = 0,
45  Matsubara = 1,
46  RPA = 2
47  };
48 
50  Susceptibility(
51  Algorithm algorithm,
52  const RPA::MomentumSpaceContext &momentumSpaceContext
53  );
54 
56  virtual ~Susceptibility();
57 
59  virtual std::vector<std::complex<double>> calculateSusceptibility(
60  const Index &index,
61  const std::vector<std::complex<double>> &energies
62  ) = 0;
63 
64  const RPA::MomentumSpaceContext& getMomentumSpaceContext() const;
65 
67  Algorithm getAlgorithm() const;
68 
78  void setEnergiesAreInversionSymmetric(
79  bool energiesAreInversionSymmetric
80  );
81 
84  bool getEnergiesAreInversionSymmetric() const;
85 private:
87  Algorithm algorithm;
88 
92  bool energiesAreInversionSymmetric;
93 
95  const RPA::MomentumSpaceContext *momentumSpaceContext;
96 };
97 
98 inline const RPA::MomentumSpaceContext& Susceptibility::getMomentumSpaceContext(
99 ) const{
100  return *momentumSpaceContext;
101 }
102 
103 inline Susceptibility::Algorithm Susceptibility::getAlgorithm() const{
104  return algorithm;
105 }
106 
107 inline void Susceptibility::setEnergiesAreInversionSymmetric(
108  bool energiesAreInversionSymmetric
109 ){
110  this->energiesAreInversionSymmetric = energiesAreInversionSymmetric;
111 }
112 
113 inline bool Susceptibility::getEnergiesAreInversionSymmetric(
114 ) const{
115  return energiesAreInversionSymmetric;
116 }
117 
118 }; //End of namespace Solver
119 }; //End of namespace TBTK
120 
121 #endif
122 
Definition: Boolean.h:32