TBTK
Need a break? Support the development by playing Polarity Puzzles
ExactDiagonalizer.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_PROPERTY_EXTRACTOR_EXACT_DIAGONALIZER
25 #define COM_DAFER45_TBTK_PROPERTY_EXTRACTOR_EXACT_DIAGONALIZER
26 
27 #include "TBTK/Solver/ExactDiagonalizer.h"
30 
31 #include <complex>
32 
33 namespace TBTK{
34 namespace PropertyExtractor{
35 
36 class ExactDiagonalizer : public PropertyExtractor{
37 public:
39  ExactDiagonalizer(Solver::ExactDiagonalizer &edSolver);
40 
42  ~ExactDiagonalizer();
43 
45  Property::GreensFunction* calculateGreensFunction(
46  Index to,
47  Index from,
48  Property::GreensFunction::Type type = Property::GreensFunction::Type::Retarded
49  );
50 
52  virtual std::complex<double> calculateExpectationValue(
53  Index to,
54  Index from
55  );
56 
58  virtual Property::Density calculateDensity(
59  Index pattern,
60  Index ranges
61  );
62 
64  virtual Property::Magnetization calculateMagnetization(
65  Index pattern,
66  Index ranges
67  );
68 
70  virtual Property::LDOS calculateLDOS(Index pattern, Index ranges);
71 
73  virtual Property::SpinPolarizedLDOS calculateSpinPolarizedLDOS(
74  Index pattern,
75  Index ranges
76  );
77 private:
79  Solver::ExactDiagonalizer *edSolver;
80 
82  virtual const Solver::Solver& getSolver() const;
83 
85  static void calculateDensityCallback(
86  PropertyExtractor *cb_this,
87  Property::Property &property,
88  const Index &index,
89  int offset,
90  Information &information
91  );
92 
95  static void calculateMagnetizationCallback(
96  PropertyExtractor *cb_this,
97  Property::Property &property,
98  const Index &index,
99  int offset,
100  Information &information
101  );
102 
105  static void calculateLDOSCallback(
106  PropertyExtractor *cb_this,
107  Property::Property &property,
108  const Index &index,
109  int offset,
110  Information &information
111  );
112 
115  static void calculateSpinPolarizedLDOSCallback(
116  PropertyExtractor *cb_this,
117  Property::Property &property,
118  const Index &index,
119  int offset,
120  Information &information
121  );
122 };
123 
124 inline const Solver::Solver& ExactDiagonalizer::getSolver() const{
125  return *edSolver;
126 }
127 
128 }; //End of namespace PropertyExtractor
129 }; //End of namespace TBTK
130 
131 #endif
132 
TBTK::Property::GreensFunction::Type
Type
Definition: GreensFunction.h:47
PropertyExtractor.h
Generates IndexTrees to be used as loop ranges and memory layout for Properties in the PropertyExtrac...
GreensFunction.h
Property container for the Green's function.