TBTK
Diagonalizer.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_PROPERTY_EXTRACTOR_DIAGONALIZER
24 #define COM_DAFER45_TBTK_PROPERTY_EXTRACTOR_DIAGONALIZER
25 
26 #include "TBTK/Solver/Diagonalizer.h"
27 #include "TBTK/Property/DOS.h"
28 #include "TBTK/Property/Density.h"
31 #include "TBTK/Property/LDOS.h"
36 
37 #include <complex>
38 //#include <initializer_list>
39 
40 namespace TBTK{
41 namespace PropertyExtractor{
42 
47 public:
52 
54 // virtual ~Diagonalizer();
55 
57 /* void saveEigenValues(
58  std::string path = "./",
59  std::string filename = "EV.dat"
60  );*/
61 
64 /* void getTabulatedHoppingAmplitudeSet(
65  std::complex<double> **amplitudes,
66  int **indices,
67  int *numHoppingAmplitudes,
68  int *maxIndexSize
69  );*/
70 
76 
81  double getEigenValue(int state);
82 
88  const std::complex<double> getAmplitude(int state, const Index &index);
89 
103 // std::initializer_list<Index> patterns,
104  std::vector<Index> patterns,
105  std::vector<int> states
106  );
107 
109 /* Property::GreensFunction* calculateGreensFunction(
110  Index to,
111  Index from,
112  Property::GreensFunction::Type type = Property::GreensFunction::Type::Retarded
113  );*/
114 
117 // std::initializer_list<Index> patterns,
118  const std::vector<Index> &patterns,
120  = Property::GreensFunction::Type::Retarded
121  );
122 
124  virtual Property::DOS calculateDOS();
125 
127  virtual std::complex<double> calculateExpectationValue(
128  Index to,
129  Index from
130  );
131 
134  Index pattern,
135  Index ranges
136  );
137 
140 // std::initializer_list<Index> patterns
141  std::vector<Index> patterns
142  );
143 
146  Index pattern,
147  Index ranges
148  );
149 
152 // std::initializer_list<Index> patterns
153  std::vector<Index> patterns
154  );
155 
158  Index pattern,
159  Index ranges
160  );
161 
164 // std::initializer_list<Index> patterns
165  std::vector<Index> patterns
166  );
167 
170  Index pattern,
171  Index ranges
172  );
173 
176 // std::initializer_list<Index> patterns
177  std::vector<Index> patterns
178  );
179 
181  virtual double calculateEntropy();
182 private:
185  static void calculateWaveFunctionsCallback(
186  PropertyExtractor *cb_this,
187  void *waveFunctions,
188  const Index &index,
189  int offset
190  );
191 
194  static void calculateGreensFunctionCallback(
195  PropertyExtractor *cb_this,
196  void *greensFunction,
197  const Index &index,
198  int offset
199  );
200 
202  static void calculateDensityCallback(
203  PropertyExtractor *cb_this,
204  void *density,
205  const Index &index,
206  int offset
207  );
208 
210  static void calculateMAGCallback(
211  PropertyExtractor *cb_this,
212  void *mag,
213  const Index &index,
214  int offset
215  );
216 
219  static void calculateLDOSCallback(
220  PropertyExtractor *cb_this,
221  void *ldos,
222  const Index &index,
223  int offset
224  );
225 
228  static void calculateSP_LDOSCallback(
229  PropertyExtractor *cb_this,
230  void *sp_ldos,
231  const Index &index,
232  int offset
233  );
234 
236  Solver::Diagonalizer *dSolver;
237 };
238 
239 inline double Diagonalizer::getEigenValue(int state){
240  return dSolver->getEigenValue(state);
241 }
242 
243 inline const std::complex<double> Diagonalizer::getAmplitude(
244  int state,
245  const Index &index
246 ){
247  return dSolver->getAmplitude(state, index);
248 }
249 
250 }; //End of namespace PropertyExtractor
251 }; //End of namespace TBTK
252 
253 #endif
double getEigenValue(int state)
Definition: Diagonalizer.h:239
Type
Definition: GreensFunction.h:39
Property container for local density of states (LDOS).
Definition: LDOS.h:33
Property container for eigen values..
Definition: EigenValues.h:32
Property container for magnetization.
Definition: Magnetization.h:35
Property container for eigen values.
const std::complex< double > getAmplitude(int state, const Index &index)
Definition: Diagonalizer.h:243
Property container for local density of states (LDOS).
virtual std::complex< double > calculateExpectationValue(Index to, Index from)
virtual Property::LDOS calculateLDOS(Index pattern, Index ranges)
const double getEigenValue(int state)
Definition: Diagonalizer.h:190
Diagonalizer(Solver::Diagonalizer &solver)
Solves a Model using diagonalization.
Definition: Diagonalizer.h:42
Base class PropertyExtractors.
Property::WaveFunctions calculateWaveFunctions(std::vector< Index > patterns, std::vector< int > states)
Property::EigenValues getEigenValues()
Property container for spin-polarized local density of states (spin-polarized LDOS).
const std::complex< double > getAmplitude(int state, const Index &index)
Definition: Diagonalizer.h:182
Property container for density.
Property container for the Green&#39;s function.
Property container for magnetization.
Flexible physical index.
Definition: Index.h:69
Definition: PropertyExtractor.h:44
Definition: Diagonalizer.h:46
Definition: ModelFactory.h:35
Property container for wave function.
Definition: WaveFunctions.h:34
Property container for spin-polarized local density of states (spin-polarized LDOS).
Definition: SpinPolarizedLDOS.h:37
Property container for density.
Definition: Density.h:33
Property container for density of states (DOS).
virtual Property::SpinPolarizedLDOS calculateSpinPolarizedLDOS(Index pattern, Index ranges)
Property container for density of states (DOS).
Definition: DOS.h:32
Property::GreensFunction calculateGreensFunction(const std::vector< Index > &patterns, Property::GreensFunction::Type type=Property::GreensFunction::Type::Retarded)
virtual Property::Magnetization calculateMagnetization(Index pattern, Index ranges)
Property container for wave functions.
virtual Property::Density calculateDensity(Index pattern, Index ranges)
virtual Property::DOS calculateDOS()
Property container for the Green&#39;s function.
Definition: GreensFunction.h:36