TBTK
Need a break? Support the development by playing Polarity Puzzles
BlockDiagonalizer.h
Go to the documentation of this file.
1 /* Copyright 2017 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_BLOCK_DIAGONALIZER
24 #define COM_DAFER45_TBTK_PROPERTY_EXTRACTOR_BLOCK_DIAGONALIZER
25 
26 #include "TBTK/Solver/BlockDiagonalizer.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 
55 public:
60 
69 
79  double getEigenValue(int state) const;
80 
88  double getEigenValue(const Index &blockIndex, int state) const;
89 
97  const std::complex<double> getAmplitude(int state, const Index &index);
98 
107  const std::complex<double> getAmplitude(
108  const Index &blockIndex,
109  int state,
110  const Index &intraBlockIndex
111  ) const;
112 
126  std::vector<Index> patterns,
127  std::vector<Subindex> states
128  );
129 
140  std::vector<Index> patterns,
142  = Property::GreensFunction::Type::Retarded
143  );
144 
146  virtual Property::DOS calculateDOS();
147 
149  virtual std::complex<double> calculateExpectationValue(
150  Index to,
151  Index from
152  );
153 
156  std::vector<Index> patterns
157  );
158 
161  std::vector<Index> patterns
162  );
163 
166  std::vector<Index> patterns
167  );
168 
171  std::vector<Index> patterns
172  );
173 
175  virtual double calculateEntropy();
176 private:
179  static void calculateWaveFunctionsCallback(
180  PropertyExtractor *cb_this,
181  Property::Property &property,
182  const Index &index,
183  int offset,
184  Information &information
185  );
186 
189  static void calculateGreensFunctionCallback(
190  PropertyExtractor *cb_this,
191  Property::Property &property,
192  const Index &index,
193  int offset,
194  Information &information
195  );
196 
198  static void calculateDensityCallback(
199  PropertyExtractor *cb_this,
200  Property::Property &property,
201  const Index &index,
202  int offset,
203  Information &information
204  );
205 
207  static void calculateMagnetizationCallback(
208  PropertyExtractor *cb_this,
209  Property::Property &property,
210  const Index &index,
211  int offset,
212  Information &information
213  );
214 
217  static void calculateLDOSCallback(
218  PropertyExtractor *cb_this,
219  Property::Property &property,
220  const Index &index,
221  int offset,
222  Information &information
223  );
224 
227  static void calculateSP_LDOSCallback(
228  PropertyExtractor *cb_this,
229  Property::Property &property,
230  const Index &index,
231  int offset,
232  Information &information
233  );
234 
237 
239  virtual const Solver::Solver& getSolver() const;
240 };
241 
242 inline double BlockDiagonalizer::getEigenValue(int state) const{
243  return solver.getEigenValue(state);
244 }
245 
247  const Index &blockIndex,
248  int state
249 ) const{
250  return solver.getEigenValue(blockIndex, state);
251 }
252 
253 inline const std::complex<double> BlockDiagonalizer::getAmplitude(
254  int state,
255  const Index &index
256 ){
257  return solver.getAmplitude(state, index);
258 }
259 
260 inline const std::complex<double> BlockDiagonalizer::getAmplitude(
261  const Index &blockIndex,
262  int state,
263  const Index &intraBlockIndex
264 ) const{
265  return solver.getAmplitude(blockIndex, state, intraBlockIndex);
266 }
267 
268 inline const Solver::Solver& BlockDiagonalizer::getSolver() const{
269  return solver;
270 }
271 
272 }; //End of namespace PropertyExtractor
273 }; //End of namespace TBTK
274 
275 #endif
TBTK::Solver::BlockDiagonalizer::getAmplitude
const std::complex< double > getAmplitude(int state, const Index &index)
Definition: BlockDiagonalizer.h:233
TBTK::PropertyExtractor::BlockDiagonalizer::getAmplitude
const std::complex< double > getAmplitude(int state, const Index &index)
Definition: BlockDiagonalizer.h:253
TBTK::PropertyExtractor::PropertyExtractor::Information
Definition: PropertyExtractor.h:424
TBTK::PropertyExtractor::BlockDiagonalizer::calculateDOS
virtual Property::DOS calculateDOS()
TBTK::Property::DOS
Property container for density of states (DOS).
Definition: DOS.h:48
TBTK::PropertyExtractor::BlockDiagonalizer::getEigenValues
Property::EigenValues getEigenValues()
EigenValues.h
Property container for eigen values.
TBTK::PropertyExtractor::BlockDiagonalizer::calculateEntropy
virtual double calculateEntropy()
TBTK::Property::SpinPolarizedLDOS
Property container for spin-polarized local density of states (spin-polarized LDOS).
Definition: SpinPolarizedLDOS.h:46
TBTK::PropertyExtractor::BlockDiagonalizer::getEigenValue
double getEigenValue(int state) const
Definition: BlockDiagonalizer.h:242
TBTK::PropertyExtractor::BlockDiagonalizer::calculateMagnetization
virtual Property::Magnetization calculateMagnetization(std::vector< Index > patterns)
TBTK::PropertyExtractor::BlockDiagonalizer
Extracts physical properties from the Solver::BlockDiagonalizer.
Definition: BlockDiagonalizer.h:54
TBTK::Solver::BlockDiagonalizer
Solves a block diagonal Model using diagonalization.
Definition: BlockDiagonalizer.h:68
TBTK::Solver::BlockDiagonalizer::getEigenValue
const double getEigenValue(int state)
Definition: BlockDiagonalizer.h:292
TBTK::Property::LDOS
Property container for the local density of states (LDOS).
Definition: LDOS.h:48
TBTK::PropertyExtractor::BlockDiagonalizer::calculateGreensFunction
Property::GreensFunction calculateGreensFunction(std::vector< Index > patterns, Property::GreensFunction::Type type=Property::GreensFunction::Type::Retarded)
TBTK::PropertyExtractor::BlockDiagonalizer::calculateSpinPolarizedLDOS
virtual Property::SpinPolarizedLDOS calculateSpinPolarizedLDOS(std::vector< Index > patterns)
WaveFunctions.h
Property container for wave functions.
TBTK::PropertyExtractor::BlockDiagonalizer::BlockDiagonalizer
BlockDiagonalizer(Solver::BlockDiagonalizer &solver)
TBTK::Property::GreensFunction::Type
Type
Definition: GreensFunction.h:47
PropertyExtractor.h
Generates IndexTrees to be used as loop ranges and memory layout for Properties in the PropertyExtrac...
TBTK::PropertyExtractor::BlockDiagonalizer::calculateWaveFunctions
Property::WaveFunctions calculateWaveFunctions(std::vector< Index > patterns, std::vector< Subindex > states)
TBTK::PropertyExtractor::BlockDiagonalizer::calculateLDOS
virtual Property::LDOS calculateLDOS(std::vector< Index > patterns)
LDOS.h
Property container for local density of states (LDOS).
SpinPolarizedLDOS.h
Property container for spin-polarized local density of states (spin-polarized LDOS).
TBTK::PropertyExtractor::BlockDiagonalizer::calculateExpectationValue
virtual std::complex< double > calculateExpectationValue(Index to, Index from)
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
Density.h
Property container for density.
TBTK::PropertyExtractor::PropertyExtractor
Base class for PropertyExtractors.
Definition: PropertyExtractor.h:64
TBTK::PropertyExtractor::BlockDiagonalizer::calculateDensity
virtual Property::Density calculateDensity(std::vector< Index > patterns)
TBTK::Solver::Solver
Base class for Solvers.
Definition: Solver.h:42
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