24 #ifndef COM_DAFER45_TBTK_ELECTRON_FLUCTUATION_VERTEX_CALCULATOR
25 #define COM_DAFER45_TBTK_ELECTRON_FLUCTUATION_VERTEX_CALCULATOR
27 #include "TBTK/BrillouinZone.h"
29 #include "TBTK/RPA/RPASusceptibilityCalculator.h"
33 class ElectronFluctuationVertexCalculator{
36 ElectronFluctuationVertexCalculator(
37 const RPA::MomentumSpaceContext &momentumSpaceContext
41 ~ElectronFluctuationVertexCalculator();
46 ElectronFluctuationVertexCalculator* createSlave();
49 const RPA::MomentumSpaceContext& getMomentumSpaceContext()
const;
53 enum class EnergyType {Real, Imaginary, Complex};
56 void setEnergyType(EnergyType energyType);
59 EnergyType getEnergyType()
const;
64 const std::vector<std::complex<double>> &energies
75 void setEnergiesAreInversionSymmetric(
76 bool energiesAreInversionSymmetric
80 bool getEnergiesAreInversionSymmetric()
const;
83 std::vector<std::complex<double>> calculateSelfEnergyVertex(
84 const std::vector<double> &k,
85 const std::vector<int> &orbitalIndices
89 void setU(std::complex<double> U);
92 void setUp(std::complex<double> Up);
95 void setJ(std::complex<double> J);
98 void setJp(std::complex<double> Jp);
102 void generateInteractionAmplitudes();
105 void saveSusceptibilities(
const std::string &filename)
const;
108 void loadSusceptibilities(
const std::string &filename);
111 RPASusceptibilityCalculator *rpaSusceptibilityCalculator;
114 EnergyType energyType;
117 std::vector<std::complex<double>> energies;
123 IndexedDataTree<SerializableVector<std::complex<double>>> vertexTree;
126 std::complex<double> U, Up, J, Jp;
129 std::vector<InteractionAmplitude> u1;
130 std::vector<InteractionAmplitude> u2;
131 std::vector<InteractionAmplitude> u3;
135 bool interactionAmplitudesAreGenerated;
138 ElectronFluctuationVertexCalculator(
139 RPASusceptibilityCalculator &rpaSusceptibilityCalculator
143 inline const RPA::MomentumSpaceContext& ElectronFluctuationVertexCalculator::getMomentumSpaceContext(
145 return rpaSusceptibilityCalculator->getMomentumSpaceContext();
148 inline void ElectronFluctuationVertexCalculator::setEnergyType(
149 EnergyType energyType
151 this->energyType = energyType;
153 case EnergyType::Real:
154 rpaSusceptibilityCalculator->setEnergyType(
155 RPASusceptibilityCalculator::EnergyType::Real
158 case EnergyType::Imaginary:
159 rpaSusceptibilityCalculator->setEnergyType(
160 RPASusceptibilityCalculator::EnergyType::Imaginary
163 case EnergyType::Complex:
164 rpaSusceptibilityCalculator->setEnergyType(
165 RPASusceptibilityCalculator::EnergyType::Complex
170 "ElectronFluctuationVertexCalculator::setEnergyType()",
171 "Unknown energy type.",
172 "This should never happen, contact the developer."
177 inline ElectronFluctuationVertexCalculator::EnergyType ElectronFluctuationVertexCalculator::getEnergyType(
182 inline void ElectronFluctuationVertexCalculator::setEnergies(
183 const std::vector<std::complex<double>> &energies
185 this->energies = energies;
188 rpaSusceptibilityCalculator->setEnergies(energies);
191 inline void ElectronFluctuationVertexCalculator::setEnergiesAreInversionSymmetric(
192 bool energiesAreInversionSymmetric
194 rpaSusceptibilityCalculator->setEnergiesAreInversionSymmetric(
195 energiesAreInversionSymmetric
199 inline bool ElectronFluctuationVertexCalculator::getEnergiesAreInversionSymmetric(
201 return rpaSusceptibilityCalculator->getEnergiesAreInversionSymmetric();
204 inline void ElectronFluctuationVertexCalculator::setU(std::complex<double> U){
206 rpaSusceptibilityCalculator->setU(U);
208 interactionAmplitudesAreGenerated =
false;
211 inline void ElectronFluctuationVertexCalculator::setUp(std::complex<double> Up){
213 rpaSusceptibilityCalculator->setUp(Up);
215 interactionAmplitudesAreGenerated =
false;
218 inline void ElectronFluctuationVertexCalculator::setJ(std::complex<double> J){
220 rpaSusceptibilityCalculator->setJ(J);
222 interactionAmplitudesAreGenerated =
false;
225 inline void ElectronFluctuationVertexCalculator::setJp(std::complex<double> Jp){
227 rpaSusceptibilityCalculator->setJp(Jp);
229 interactionAmplitudesAreGenerated =
false;
232 inline void ElectronFluctuationVertexCalculator::saveSusceptibilities(
233 const std::string &filename
235 rpaSusceptibilityCalculator->saveSusceptibilities(filename);
238 inline void ElectronFluctuationVertexCalculator::loadSusceptibilities(
239 const std::string &filename
241 rpaSusceptibilityCalculator->loadSusceptibilities(filename);