24 #ifndef COM_DAFER45_TBTK_LINDHARD_SUSCEPTIBILITY_CALCULATOR
25 #define COM_DAFER45_TBTK_LINDHARD_SUSCEPTIBILITY_CALCULATOR
27 #include "TBTK/RPA/MomentumSpaceContext.h"
28 #include "TBTK/RPA/SusceptibilityCalculator.h"
36 class LindhardSusceptibilityCalculator :
public SusceptibilityCalculator{
39 LindhardSusceptibilityCalculator(
40 const RPA::MomentumSpaceContext &momentumSpaceContext
44 virtual ~LindhardSusceptibilityCalculator();
49 virtual LindhardSusceptibilityCalculator* createSlave();
52 virtual std::complex<double> calculateSusceptibility(
53 const std::vector<double> &k,
54 const std::vector<int> &orbitalIndices,
55 std::complex<double> energy
59 virtual std::vector<std::complex<double>> calculateSusceptibility(
60 const DualIndex &kDual,
61 const std::vector<int> &orbitalIndices
67 void precompute(
unsigned int numWorkers = 129);
71 void setSusceptibilityIsSafeFromPoles(
72 bool susceptibilityIsSafeFromPoles
77 bool getSusceptibilityIsSafeFromPoles()
const;
81 bool susceptibilityIsSafeFromPoles;
84 double *fermiDiracLookupTable;
87 LindhardSusceptibilityCalculator(
88 const RPA::MomentumSpaceContext &momentumSpaceContext,
89 int *kPlusQLookupTable,
90 double *fermiDiracLookupTable
94 std::complex<double> calculateSusceptibilityLindhard(
95 const std::vector<double> &k,
96 const std::vector<int> &orbitalIndices,
97 std::complex<double> energy
101 template<
bool useKPlusQLookupTable,
bool isSafeFromPoles>
102 std::vector<std::complex<double>> calculateSusceptibilityLindhard(
103 const DualIndex &kDual,
104 const std::vector<int> &orbitalIndices
109 std::complex<double> getPoleTimesTwoFermi(
110 std::complex<double> energy,
113 double chemicalPotential,
115 int kPlusQLinearIndex,
116 unsigned int meshPoint,
119 unsigned int numOrbitals
123 inline void LindhardSusceptibilityCalculator::setSusceptibilityIsSafeFromPoles(
124 bool susceptibilityIsSafeFromPoles
126 this->susceptibilityIsSafeFromPoles = susceptibilityIsSafeFromPoles;
129 inline bool LindhardSusceptibilityCalculator::getSusceptibilityIsSafeFromPoles()
const{
130 return susceptibilityIsSafeFromPoles;