TBTK
Need a break? Support the development by playing Polarity Puzzles
BlockDiagonalizer.h
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
Base class for Solvers.
Definition: Solver.h:42
Property::WaveFunctions calculateWaveFunctions(std::vector< Index > patterns, std::vector< Subindex > states)
Type
Definition: GreensFunction.h:47
Property container for the local density of states (LDOS).
Definition: LDOS.h:48
const std::complex< double > getAmplitude(int state, const Index &index)
Definition: BlockDiagonalizer.h:233
Property container for eigen values.
Definition: EigenValues.h:46
virtual std::complex< double > calculateExpectationValue(Index to, Index from)
virtual Property::LDOS calculateLDOS(std::vector< Index > patterns)
Property container for magnetization.
Definition: Magnetization.h:44
Property container for eigen values.
Extracts physical properties from the Solver::BlockDiagonalizer.
Definition: BlockDiagonalizer.h:54
Property container for local density of states (LDOS).
const double getEigenValue(int state)
Definition: BlockDiagonalizer.h:292
virtual Property::Density calculateDensity(std::vector< Index > patterns)
Generates IndexTrees to be used as loop ranges and memory layout for Properties in the PropertyExtrac...
Property container for spin-polarized local density of states (spin-polarized LDOS).
Property container for density.
Property container for the Green&#39;s function.
const std::complex< double > getAmplitude(int state, const Index &index)
Definition: BlockDiagonalizer.h:253
Property container for magnetization.
double getEigenValue(int state) const
Definition: BlockDiagonalizer.h:242
Abstract Property class.
Definition: Property.h:36
Physical index.
Definition: Index.h:44
Base class for PropertyExtractors.
Definition: PropertyExtractor.h:64
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::Magnetization calculateMagnetization(std::vector< Index > patterns)
Solves a block diagonal Model using diagonalization.
Definition: BlockDiagonalizer.h:68
virtual Property::SpinPolarizedLDOS calculateSpinPolarizedLDOS(std::vector< Index > patterns)
Property container for density of states (DOS).
Definition: DOS.h:48
Property::GreensFunction calculateGreensFunction(std::vector< Index > patterns, Property::GreensFunction::Type type=Property::GreensFunction::Type::Retarded)
BlockDiagonalizer(Solver::BlockDiagonalizer &solver)
Property container for wave functions.
Property container for the Green&#39;s function.
Definition: GreensFunction.h:44