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:
50 
52  virtual ~Diagonalizer();
53 
55  void saveEigenValues(
56  std::string path = "./",
57  std::string filename = "EV.dat"
58  );
59 
63  std::complex<double> **amplitudes,
64  int **indices,
65  int *numHoppingAmplitudes,
66  int *maxIndexSize
67  );
68 
71 
73  double getEigenValue(int state);
74 
79  const std::complex<double> getAmplitude(int state, const Index &index);
80 
83  std::initializer_list<Index> patterns,
84  std::initializer_list<int> states
85  );
86 
88 /* Property::GreensFunction* calculateGreensFunction(
89  Index to,
90  Index from,
91  Property::GreensFunction::Type type = Property::GreensFunction::Type::Retarded
92  );*/
93 
95  virtual Property::DOS calculateDOS();
96 
98  virtual std::complex<double> calculateExpectationValue(
99  Index to,
100  Index from
101  );
102 
105  Index pattern,
106  Index ranges
107  );
108 
111  std::initializer_list<Index> patterns
112  );
113 
116  Index pattern,
117  Index ranges
118  );
119 
122  std::initializer_list<Index> patterns
123  );
124 
127  Index pattern,
128  Index ranges
129  );
130 
133  std::initializer_list<Index> patterns
134  );
135 
138  Index pattern,
139  Index ranges
140  );
141 
144  std::initializer_list<Index> patterns
145  );
146 
148  virtual double calculateEntropy();
149 private:
152  static void calculateWaveFunctionsCallback(
153  PropertyExtractor *cb_this,
154  void *waveFunctions,
155  const Index &index,
156  int offset
157  );
158 
160  static void calculateDensityCallback(
161  PropertyExtractor *cb_this,
162  void *density,
163  const Index &index,
164  int offset
165  );
166 
168  static void calculateMAGCallback(
169  PropertyExtractor *cb_this,
170  void *mag,
171  const Index &index,
172  int offset
173  );
174 
177  static void calculateLDOSCallback(
178  PropertyExtractor *cb_this,
179  void *ldos,
180  const Index &index,
181  int offset
182  );
183 
186  static void calculateSP_LDOSCallback(
187  PropertyExtractor *cb_this,
188  void *sp_ldos,
189  const Index &index,
190  int offset
191  );
192 
194  Solver::Diagonalizer *dSolver;
195 };
196 
197 inline double Diagonalizer::getEigenValue(int state){
198  return dSolver->getEigenValue(state);
199 }
200 
201 inline const std::complex<double> Diagonalizer::getAmplitude(
202  int state,
203  const Index &index
204 ){
205  return dSolver->getAmplitude(state, index);
206 }
207 
208 }; //End of namespace PropertyExtractor
209 }; //End of namespace TBTK
210 
211 #endif
double getEigenValue(int state)
Definition: Diagonalizer.h:197
Property container for local density of states (LDOS).
Definition: LDOS.h:33
Property container for eigen values..
Definition: EigenValues.h:32
void saveEigenValues(std::string path="./", std::string filename="EV.dat")
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:201
Property container for local density of states (LDOS).
virtual std::complex< double > calculateExpectationValue(Index to, Index from)
Diagonalizer(Solver::Diagonalizer &dSolver)
virtual Property::LDOS calculateLDOS(Index pattern, Index ranges)
const double getEigenValue(int state)
Definition: Diagonalizer.h:154
Solves a Model using diagonalization.
Definition: Diagonalizer.h:42
Base class PropertyExtractors.
Property::EigenValues getEigenValues()
Property container for spin-polarized local density of states (spin-polarized LDOS).
void getTabulatedHoppingAmplitudeSet(std::complex< double > **amplitudes, int **indices, int *numHoppingAmplitudes, int *maxIndexSize)
const std::complex< double > getAmplitude(int state, const Index &index)
Definition: Diagonalizer.h:146
Property container for density.
Property container for Green&#39;s function.
Property container for magnetization.
Flexible physical index.
Definition: Index.h:70
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::WaveFunctions calculateWaveFunctions(std::initializer_list< Index > patterns, std::initializer_list< int > states)
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()