TBTK
Need a break? Support the development by playing Polarity Puzzles
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 
39 namespace TBTK{
40 namespace PropertyExtractor{
41 
56 public:
61 
67 
72  double getEigenValue(int state);
73 
79  const std::complex<double> getAmplitude(int state, const Index &index);
80 
94  std::vector<Index> patterns,
95  std::vector<Subindex> states
96  );
97 
99 /* Property::GreensFunction* calculateGreensFunction(
100  Index to,
101  Index from,
102  Property::GreensFunction::Type type = Property::GreensFunction::Type::Retarded
103  );*/
104 
107  const std::vector<Index> &patterns,
109  = Property::GreensFunction::Type::Retarded
110  );
111 
113  virtual Property::DOS calculateDOS();
114 
116  virtual std::complex<double> calculateExpectationValue(
117  Index to,
118  Index from
119  );
120 
123  Index pattern,
124  Index ranges
125  );
126 
129  std::vector<Index> patterns
130  );
131 
134  Index pattern,
135  Index ranges
136  );
137 
140  std::vector<Index> patterns
141  );
142 
145  Index pattern,
146  Index ranges
147  );
148 
151  std::vector<Index> patterns
152  );
153 
156  Index pattern,
157  Index ranges
158  );
159 
162  std::vector<Index> patterns
163  );
164 
166  virtual double calculateEntropy();
167 private:
170  static void calculateWaveFunctionsCallback(
171  PropertyExtractor *cb_this,
172  Property::Property &property,
173  const Index &index,
174  int offset,
175  Information &information
176  );
177 
180  static void calculateGreensFunctionCallback(
181  PropertyExtractor *cb_this,
182  Property::Property &property,
183  const Index &index,
184  int offset,
185  Information &information
186  );
187 
189  static void calculateDensityCallback(
190  PropertyExtractor *cb_this,
191  Property::Property &property,
192  const Index &index,
193  int offset,
194  Information &information
195  );
196 
198  static void calculateMAGCallback(
199  PropertyExtractor *cb_this,
200  Property::Property &property,
201  const Index &index,
202  int offset,
203  Information &information
204  );
205 
208  static void calculateLDOSCallback(
209  PropertyExtractor *cb_this,
210  Property::Property &property,
211  const Index &index,
212  int offset,
213  Information &information
214  );
215 
218  static void calculateSP_LDOSCallback(
219  PropertyExtractor *cb_this,
220  Property::Property &property,
221  const Index &index,
222  int offset,
223  Information &information
224  );
225 
227  Solver::Diagonalizer &solver;
228 
230  virtual const Solver::Solver& getSolver() const;
231 };
232 
233 inline double Diagonalizer::getEigenValue(int state){
234  return solver.getEigenValue(state);
235 }
236 
237 inline const std::complex<double> Diagonalizer::getAmplitude(
238  int state,
239  const Index &index
240 ){
241  return solver.getAmplitude(state, index);
242 }
243 
244 inline const Solver::Solver& Diagonalizer::getSolver() const{
245  return solver;
246 }
247 
248 }; //End of namespace PropertyExtractor
249 }; //End of namespace TBTK
250 
251 #endif
double getEigenValue(int state)
Definition: Diagonalizer.h:233
Base class for Solvers.
Definition: Solver.h:42
Type
Definition: GreensFunction.h:47
Property container for the local density of states (LDOS).
Definition: LDOS.h:48
Property container for eigen values.
Definition: EigenValues.h:46
Property container for magnetization.
Definition: Magnetization.h:44
Property container for eigen values.
const std::complex< double > getAmplitude(int state, const Index &index)
Definition: Diagonalizer.h:237
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:219
Diagonalizer(Solver::Diagonalizer &solver)
Solves a Model using diagonalization.
Definition: Diagonalizer.h:52
Generates IndexTrees to be used as loop ranges and memory layout for Properties in the PropertyExtrac...
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:211
Property container for density.
Property::WaveFunctions calculateWaveFunctions(std::vector< Index > patterns, std::vector< Subindex > states)
Property container for the Green&#39;s function.
Property container for magnetization.
Abstract Property class.
Definition: Property.h:36
Physical index.
Definition: Index.h:44
Base class for PropertyExtractors.
Definition: PropertyExtractor.h:64
Extracts physical properties from the Solver::Diagonalizer.
Definition: Diagonalizer.h:55
Definition: Boolean.h:32
Property container for wave function.
Definition: WaveFunctions.h:45
Property container for spin-polarized local density of states (spin-polarized LDOS).
Definition: SpinPolarizedLDOS.h:46
Property container for density.
Definition: Density.h:43
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:48
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:44