TBTK Need a break? Support the development by playing Polarity Puzzles
Diagonalizer.h
1 /* Copyright 2016 Kristofer Björnson
2  *
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
8  *
9  * Unless required by applicable law or agreed to in writing, software
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
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
TBTK::PropertyExtractor::PropertyExtractor::Information
Definition: PropertyExtractor.h:424
TBTK::Property::DOS
Property container for density of states (DOS).
Definition: DOS.h:48
TBTK::PropertyExtractor::Diagonalizer::getAmplitude
const std::complex< double > getAmplitude(int state, const Index &index)
Definition: Diagonalizer.h:237
EigenValues.h
Property container for eigen values.
TBTK::Property::SpinPolarizedLDOS
Property container for spin-polarized local density of states (spin-polarized LDOS).
Definition: SpinPolarizedLDOS.h:46
TBTK::Solver::Diagonalizer
Solves a Model using diagonalization.
Definition: Diagonalizer.h:52
TBTK::PropertyExtractor::Diagonalizer::calculateExpectationValue
virtual std::complex< double > calculateExpectationValue(Index to, Index from)
TBTK::PropertyExtractor::Diagonalizer::calculateLDOS
virtual Property::LDOS calculateLDOS(Index pattern, Index ranges)
TBTK::Property::LDOS
Property container for the local density of states (LDOS).
Definition: LDOS.h:48
TBTK::Solver::Diagonalizer::getAmplitude
const std::complex< double > getAmplitude(int state, const Index &index)
Definition: Diagonalizer.h:211
TBTK::PropertyExtractor::Diagonalizer
Extracts physical properties from the Solver::Diagonalizer.
Definition: Diagonalizer.h:55
TBTK::PropertyExtractor::Diagonalizer::getEigenValues
Property::EigenValues getEigenValues()
WaveFunctions.h
Property container for wave functions.
Diagonalizer.h
Solves a Model using diagonalization.
TBTK::Property::GreensFunction::Type
Type
Definition: GreensFunction.h:47
TBTK::PropertyExtractor::Diagonalizer::calculateWaveFunctions
Property::WaveFunctions calculateWaveFunctions(std::vector< Index > patterns, std::vector< Subindex > states)
TBTK::PropertyExtractor::Diagonalizer::Diagonalizer
Diagonalizer(Solver::Diagonalizer &solver)
PropertyExtractor.h
Generates IndexTrees to be used as loop ranges and memory layout for Properties in the PropertyExtrac...
LDOS.h
Property container for local density of states (LDOS).
TBTK::Solver::Diagonalizer::getEigenValue
const double getEigenValue(int state)
Definition: Diagonalizer.h:219
SpinPolarizedLDOS.h
Property container for spin-polarized local density of states (spin-polarized LDOS).
DOS.h
Property container for density of states (DOS).
TBTK::Property::Density
Property container for density.
Definition: Density.h:43
TBTK::Property::GreensFunction
Property container for the Green's function.
Definition: GreensFunction.h:44
Magnetization.h
Property container for magnetization.
GreensFunction.h
Property container for the Green's function.
TBTK::Property::Property
Abstract Property class.
Definition: Property.h:36
TBTK::PropertyExtractor::Diagonalizer::calculateSpinPolarizedLDOS
virtual Property::SpinPolarizedLDOS calculateSpinPolarizedLDOS(Index pattern, Index ranges)
Density.h
Property container for density.
TBTK::PropertyExtractor::PropertyExtractor
Base class for PropertyExtractors.
Definition: PropertyExtractor.h:64
TBTK::PropertyExtractor::Diagonalizer::calculateGreensFunction
Property::GreensFunction calculateGreensFunction(const std::vector< Index > &patterns, Property::GreensFunction::Type type=Property::GreensFunction::Type::Retarded)
TBTK::PropertyExtractor::Diagonalizer::calculateDOS
virtual Property::DOS calculateDOS()
TBTK::PropertyExtractor::Diagonalizer::calculateMagnetization
virtual Property::Magnetization calculateMagnetization(Index pattern, Index ranges)
TBTK::PropertyExtractor::Diagonalizer::calculateEntropy
virtual double calculateEntropy()
TBTK::PropertyExtractor::Diagonalizer::calculateDensity
virtual Property::Density calculateDensity(Index pattern, Index ranges)
TBTK::Solver::Solver
Base class for Solvers.
Definition: Solver.h:42
TBTK::PropertyExtractor::Diagonalizer::getEigenValue
double getEigenValue(int state)
Definition: Diagonalizer.h:233
TBTK::Index
Physical index.
Definition: Index.h:44
TBTK::Property::EigenValues
Property container for eigen values.
Definition: EigenValues.h:46
TBTK::Property::WaveFunctions
Property container for wave function.
Definition: WaveFunctions.h:45
TBTK::Property::Magnetization
Property container for magnetization.
Definition: Magnetization.h:44