TBTK
CPropertyExtractor.h
Go to the documentation of this file.
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 "ChebyshevSolver.h"
27 #include "Density.h"
28 #include "Magnetization.h"
29 #include "LDOS.h"
30 #include "SpinPolarizedLDOS.h"
31 
32 #include <iostream>
33 
34 namespace TBTK{
35 
38 public:
41  ChebyshevSolver *cSolver,
42  int numCoefficients,
43  int energyResolution,
44  bool useGPUToCalculateCoefficients,
45  bool useGPUToGenerateGreensFunctions,
46  bool useLookupTable = true,
47  double lowerBound = -1.,
48  double upperBound = 1.
49  );
50 
53 
55  std::complex<double>* calculateGreensFunction(
56  Index to,
57  Index from,
58  ChebyshevSolver::GreensFunctionType type = ChebyshevSolver::GreensFunctionType::Retarded
59  );
60 
62  std::complex<double>* calculateGreensFunctions(
63  std::vector<Index> &to,
64  Index from,
65  ChebyshevSolver::GreensFunctionType type = ChebyshevSolver::GreensFunctionType::Retarded
66  );
67 
69  std::complex<double> calculateExpectationValue(Index to, Index from);
70 
95 // double* calculateDensity(Index pattern, Index ranges);
97 
132 // std::complex<double>* calculateMAG(Index pattern, Index ranges);
134  Index pattern,
135  Index ranges
136  );
137 
161 // double *calculateLDOS(Index pattern, Index ranges);
162  Property::LDOS* calculateLDOS(Index pattern, Index ranges);
163 
204 // std::complex<double> *calculateSP_LDOS(Index pattern, Index ranges);
206  Index pattern,
207  Index ranges
208  );
209 private:
211  ChebyshevSolver *cSolver;
212 
214  int numCoefficients;
215 
217  int energyResolution;
218 
221  double lowerBound;
222 
225  double upperBound;
226 
228  bool useLookupTable;
229 
232  bool useGPUToCalculateCoefficients;
233 
236  bool useGPUToGenerateGreensFunctions;
237 
240  void calculate(
241  void (*callback)(
242  CPropertyExtractor *cb_this,
243  void *memory,
244  const Index &index,
245  int offset
246  ),
247  void *memory,
248  Index pattern,
249  const Index &ranges,
250  int currentOffset,
251  int offsetMultiplier
252  );
253 
256  static void calculateDensityCallback(
257  CPropertyExtractor *cb_this,
258  void *density,
259  const Index &index,
260  int offset
261  );
262 
265  static void calculateMAGCallback(
266  CPropertyExtractor *cb_this,
267  void *density,
268  const Index &index,
269  int offset
270  );
271 
274  static void calculateLDOSCallback(
275  CPropertyExtractor *cb_this,
276  void *ldos,
277  const Index &index,
278  int offset
279  );
280 
283  static void calculateSP_LDOSCallback(
284  CPropertyExtractor *cb_this,
285  void *sp_ldos,
286  const Index &index,
287  int offset
288  );
289 
292  void *hint;
293 
296  void ensureCompliantRanges(const Index &pattern, Index &ranges);
297 
299  void getLoopRanges(
300  const Index &pattern,
301  const Index &ranges,
302  int *lDimensions,
303  int **lRanges
304  );
305 };
306 
307 }; //End of namespace TBTK
308 
309 #endif
Definition: LDOS.h:33
~CPropertyExtractor()
Definition: CPropertyExtractor.cpp:101
Definition: Magnetization.h:35
Definition: ChebyshevSolver.h:43
Property container for local density of states (LDOS)
Property::SpinPolarizedLDOS * calculateSpinPolarizedLDOS(Index pattern, Index ranges)
Definition: CPropertyExtractor.cpp:304
Definition: CPropertyExtractor.h:37
Property::Magnetization * calculateMagnetization(Index pattern, Index ranges)
Definition: CPropertyExtractor.cpp:237
std::complex< double > * calculateGreensFunction(Index to, Index from, ChebyshevSolver::GreensFunctionType type=ChebyshevSolver::GreensFunctionType::Retarded)
Definition: CPropertyExtractor.cpp:106
Property::LDOS * calculateLDOS(Index pattern, Index ranges)
Definition: CPropertyExtractor.cpp:291
CPropertyExtractor(ChebyshevSolver *cSolver, int numCoefficients, int energyResolution, bool useGPUToCalculateCoefficients, bool useGPUToGenerateGreensFunctions, bool useLookupTable=true, double lowerBound=-1., double upperBound=1.)
Definition: CPropertyExtractor.cpp:31
Property container for spin-polarized local density of states (spin-polarized LDOS) ...
Property container for density.
Property::Density * calculateDensity(Index pattern, Index ranges)
Definition: CPropertyExtractor.cpp:221
Property container for magnetization.
Definition: Index.h:44
Definition: AbstractOperator.h:26
Definition: SpinPolarizedLDOS.h:37
Solves a Model using the Chebyshev method.
Definition: Density.h:33
GreensFunctionType
Definition: ChebyshevSolver.h:171
std::complex< double > calculateExpectationValue(Index to, Index from)
Definition: CPropertyExtractor.cpp:168
std::complex< double > * calculateGreensFunctions(std::vector< Index > &to, Index from, ChebyshevSolver::GreensFunctionType type=ChebyshevSolver::GreensFunctionType::Retarded)
Definition: CPropertyExtractor.cpp:117