TBTK
ChebyshevExpander.h
1 /* Copyright 2016 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 
23 #ifndef COM_DAFER45_TBTK_C_PROPERTY_EXTRACTOR
24 #define COM_DAFER45_TBTK_C_PROPERTY_EXTRACTOR
25 
26 #include "TBTK/Solver/ChebyshevExpander.h"
27 #include "TBTK/Property/Density.h"
29 #include "TBTK/Property/LDOS.h"
33 
34 #include <initializer_list>
35 #include <iostream>
36 
37 namespace TBTK{
38 namespace PropertyExtractor{
39 
42 public:
46  int numCoefficients,
47  bool useGPUToCalculateCoefficients,
48  bool useGPUToGenerateGreensFunctions,
49  bool useLookupTable = true
50  );
51 
53  virtual ~ChebyshevExpander();
54 
56  virtual void setEnergyWindow(
57  double lowerBound,
58  double upperBound,
60  );
61 
63 // Property::GreensFunction* calculateGreensFunction(
65  Index to,
66  Index from,
67  Property::GreensFunction::Type type = Property::GreensFunction::Type::Retarded
68  );
69 
72  std::initializer_list<std::initializer_list<Index>> patterns,
73  Property::GreensFunction::Type type = Property::GreensFunction::Type::Retarded
74  );
75 
77 // Property::GreensFunction** calculateGreensFunctions(
79  std::vector<Index> &to,
80  Index from,
81  Property::GreensFunction::Type type = Property::GreensFunction::Type::Retarded
82  );
83 
85  virtual std::complex<double> calculateExpectationValue(
86  Index to,
87  Index from
88  );
89 
92  Index pattern,
93  Index ranges
94  );
95 
98  std::initializer_list<Index> patterns
99  );
100 
103  Index pattern,
104  Index ranges
105  );
106 
109  std::initializer_list<Index> patterns
110  );
111 
113  virtual Property::LDOS calculateLDOS(Index pattern, Index ranges);
114 
117  std::initializer_list<Index> pattern
118  );
119 
122  Index pattern,
123  Index ranges
124  );
125 
128  std::initializer_list<Index> pattern
129  );
130 private:
132  Solver::ChebyshevExpander *cSolver;
133 
135  int numCoefficients;
136 
138  bool useLookupTable;
139 
142  bool useGPUToCalculateCoefficients;
143 
146  bool useGPUToGenerateGreensFunctions;
147 
150  static void calculateDensityCallback(
151  PropertyExtractor *cb_this,
152  void *density,
153  const Index &index,
154  int offset
155  );
156 
159  static void calculateMAGCallback(
160  PropertyExtractor *cb_this,
161  void *density,
162  const Index &index,
163  int offset
164  );
165 
168  static void calculateLDOSCallback(
169  PropertyExtractor *cb_this,
170  void *ldos,
171  const Index &index,
172  int offset
173  );
174 
177  static void calculateSP_LDOSCallback(
178  PropertyExtractor *cb_this,
179  void *sp_ldos,
180  const Index &index,
181  int offset
182  );
183 
185  void ensureLookupTableIsReady();
186 };
187 
188 }; //End of namespace PropertyExtractor
189 }; //End of namespace TBTK
190 
191 #endif
Type
Definition: GreensFunction.h:39
Property container for local density of states (LDOS).
Definition: LDOS.h:33
double upperBound
Definition: PropertyExtractor.h:245
Definition: ChebyshevExpander.h:41
virtual Property::SpinPolarizedLDOS calculateSpinPolarizedLDOS(Index pattern, Index ranges)
Property container for magnetization.
Definition: Magnetization.h:35
virtual std::complex< double > calculateExpectationValue(Index to, Index from)
Property container for local density of states (LDOS).
Solves a Model using the Chebyshev method.
Definition: ChebyshevExpander.h:51
int energyResolution
Definition: PropertyExtractor.h:233
double lowerBound
Definition: PropertyExtractor.h:239
Base class PropertyExtractors.
Property container for spin-polarized local density of states (spin-polarized LDOS).
ChebyshevExpander(Solver::ChebyshevExpander &cSolver, int numCoefficients, bool useGPUToCalculateCoefficients, bool useGPUToGenerateGreensFunctions, bool useLookupTable=true)
Property container for density.
Property container for Green&#39;s function.
virtual Property::Magnetization calculateMagnetization(Index pattern, Index ranges)
Property::GreensFunction calculateGreensFunctions(std::vector< Index > &to, Index from, Property::GreensFunction::Type type=Property::GreensFunction::Type::Retarded)
virtual Property::Density calculateDensity(Index pattern, Index ranges)
Property container for magnetization.
Flexible physical index.
Definition: Index.h:70
Definition: PropertyExtractor.h:44
Definition: ModelFactory.h:35
Property container for spin-polarized local density of states (spin-polarized LDOS).
Definition: SpinPolarizedLDOS.h:37
Property container for density.
Definition: Density.h:33
virtual void setEnergyWindow(double lowerBound, double upperBound, int energyResolution)
virtual Property::LDOS calculateLDOS(Index pattern, Index ranges)
Property::GreensFunction calculateGreensFunction(Index to, Index from, Property::GreensFunction::Type type=Property::GreensFunction::Type::Retarded)
Property container for Green&#39;s function.
Definition: GreensFunction.h:36