TBTK
Need a break? Support the development by playing Polarity Puzzles
MatsubaraSusceptibility.h
1 /* Copyright 2018 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 
25 #ifndef COM_DAFER45_TBTK_PROPERTY_EXTRACTOR_MATSUBARA_SUSCEPTIBILITY
26 #define COM_DAFER45_TBTK_PROPERTY_EXTRACTOR_MATSUBARA_SUSCEPTIBILITY
27 
28 #include "TBTK/Solver/MatsubaraSusceptibility.h"
29 #include "TBTK/Property/Susceptibility.h"
31 
32 #include <complex>
33 
34 namespace TBTK{
35 namespace PropertyExtractor{
36 
39 class MatsubaraSusceptibility : public PropertyExtractor{
40 public:
44  MatsubaraSusceptibility(Solver::MatsubaraSusceptibility &solver);
45 
47  virtual Property::Susceptibility calculateSusceptibility(
48  std::vector<Index> patterns
49  );
50 private:
53  class SusceptibilityBlockInformation : public Information{
54  public:
58  SusceptibilityBlockInformation();
59 
62  void setCalculateSusceptibilityForAllBlocks(
63  bool calculateSusceptibilityForAllBlocks
64  );
65 
68  bool getCalculateSusceptibilityForAllBlocks() const;
69  private:
72  bool calculateSusceptibilityForAllBlocks;
73  };
74 
76  static void calculateSusceptibilityCallback(
77  PropertyExtractor *cb_this,
78  Property::Property &property,
79  const Index &index,
80  int offset,
81  Information &information
82  );
83 
85  Solver::MatsubaraSusceptibility *solver;
86 
88  std::vector<std::complex<double>> energies;
89 
91  virtual const Solver::Solver& getSolver() const;
92 };
93 
94 inline void MatsubaraSusceptibility::SusceptibilityBlockInformation::setCalculateSusceptibilityForAllBlocks(
95  bool calculateSusceptibilityForAllBlocks
96 ){
97  this->calculateSusceptibilityForAllBlocks
98  = calculateSusceptibilityForAllBlocks;
99 }
100 
101 inline bool MatsubaraSusceptibility::SusceptibilityBlockInformation::getCalculateSusceptibilityForAllBlocks(
102 ) const{
103  return calculateSusceptibilityForAllBlocks;
104 }
105 
106 inline const Solver::Solver& MatsubaraSusceptibility::getSolver() const{
107  return *solver;
108 }
109 
110 }; //End of namespace PropertyExtractor
111 }; //End of namespace TBTK
112 
113 #endif
114 
Generates IndexTrees to be used as loop ranges and memory layout for Properties in the PropertyExtrac...
Definition: Boolean.h:32