23 #ifndef COM_DAFER45_TBTK_PROPERTY_EXTRACTOR_PROPERTY_EXTRACTOR 24 #define COM_DAFER45_TBTK_PROPERTY_EXTRACTOR_PROPERTY_EXTRACTOR 28 #include "TBTK/Property/AbstractProperty.h" 40 namespace PropertyExtractor{
100 int lowerFermionicMatsubaraEnergyIndex,
101 int upperFermionicMatsubaraEnergyIndex,
102 int lowerBosonicMatsubaraEnergyIndex,
103 int upperBosonicMatsubaraEnergyIndex
157 std::vector<Index> patterns
213 std::vector<Index> patterns
258 std::vector<Index> patterns
323 std::vector<Index> patterns
364 unsigned int numSamples,
365 const std::vector<Index> &patterns = {},
366 unsigned int seed = time(
nullptr)
433 void setSpinIndex(
int spinIndex);
439 int getSpinIndex()
const;
448 double getEnergyInfinitesimal()
const;
493 template<
typename DataType>
506 int offsetMultiplier,
524 template<
typename DataType>
560 const Index &pattern,
586 std::vector<Index> patterns,
588 bool keepSummationWildcards,
589 bool keepSpinWildcards
596 static constexpr
int ENERGY_RESOLUTION = 1000;
600 int energyResolution;
603 static constexpr
double LOWER_BOUND = -1.;
610 static constexpr
double UPPER_BOUND = 1.;
617 static constexpr
int LOWER_FERMIONIC_MATSUBARA_ENERGY_INDEX = -1;
621 int lowerFermionicMatsubaraEnergyIndex;
624 static constexpr
int UPPER_FERMIONIC_MATSUBARA_ENERGY_INDEX = 1;
628 int upperFermionicMatsubaraEnergyIndex;
631 static constexpr
int LOWER_BOSONIC_MATSUBARA_ENERGY_INDEX = 0;
635 int lowerBosonicMatsubaraEnergyIndex;
638 static constexpr
int UPPER_BOSONIC_MATSUBARA_ENERGY_INDEX = 0;
642 int upperBosonicMatsubaraEnergyIndex;
645 static constexpr
double ENERGY_INFINITESIMAL = 1e-3;
649 double energyInfinitesimal;
661 energyType == EnergyType::Real,
662 "PropertyExtractor::PropertyExtractor::getEnergyResolution()",
663 "The energy resolution cannot be accessed when the energy type" 665 "Use PropertyExtractor::PropertyExtractor::setEnergyWindow()" 666 <<
" with three arguments if real energies are wanted for the" 667 <<
" PropertyExtractor." 670 return energyResolution;
675 energyType == EnergyType::Real,
676 "PropertyExtractor::PropertyExtractor::getLowerBound()",
677 "The lower bound cannot be accessed when the energy type is" 679 "Use PropertyExtractor::PropertyExtractor::setEnergyWindow()" 680 <<
" with three arguments if real energies are wanted for the" 681 <<
" PropertyExtractor." 689 energyType == EnergyType::Real,
690 "PropertyExtractor::PropertyExtractor::getUpperBound()",
691 "The upper bound cannot be accessed when the energy type is" 693 "Use PropertyExtractor::PropertyExtractor::setEnergyWindow()" 694 <<
" with three arguments if real energies are wanted for the" 695 <<
" PropertyExtractor." 703 energyType == EnergyType::Matsubara,
704 "PropertyExtractor::PropertyExtractor::getLowerFermionicMatsubaraEnergyIndex()",
705 "The lower Fermionic Matsubara energy index cannot be accessed" 706 <<
" when the energy type is real.",
707 "Use PropertyExtractor::PropertyExtractor::setEnergyWindow()" 708 <<
" with four arguments if Matsubara energies are wanted for" 709 <<
" the PropertyExtractor." 712 return lowerFermionicMatsubaraEnergyIndex;
717 energyType == EnergyType::Matsubara,
718 "PropertyExtractor::PropertyExtractor::getUpperFermionicMatsubaraEnergyIndex()",
719 "The upper Fermionic Matsubara energy index cannot be accessed" 720 <<
" when the energy type is real.",
721 "Use PropertyExtractor::PropertyExtractor::setEnergyWindow()" 722 <<
" with four arguments if Matsubara energies are wanted for" 723 <<
" the PropertyExtractor." 726 return upperFermionicMatsubaraEnergyIndex;
731 energyType == EnergyType::Matsubara,
732 "PropertyExtractor::PropertyExtractor::getLowerBosonicMatsubaraEnergyIndex()",
733 "The lower Bosonic Matsubara energy index cannot be accessed" 734 <<
" when the energy type is real.",
735 "Use PropertyExtractor::PropertyExtractor::setEnergyWindow()" 736 <<
" with four arguments if Matsubara energies are wanted for" 737 <<
" the PropertyExtractor." 740 return lowerBosonicMatsubaraEnergyIndex;
745 energyType == EnergyType::Matsubara,
746 "PropertyExtractor::PropertyExtractor::getUpperBosonicMatsubaraEnergyIndex()",
747 "The upper Bosonic Matsubara energy index cannot be accessed" 748 <<
" when the energy type is real.",
749 "Use PropertyExtractor::PropertyExtractor::setEnergyWindow()" 750 <<
" with four arguments if Matsubara energies are wanted for" 751 <<
" the PropertyExtractor." 754 return upperBosonicMatsubaraEnergyIndex;
757 inline double PropertyExtractor::getEnergyInfinitesimal()
const{
758 return energyInfinitesimal;
761 template<
typename DataType>
774 int offsetMultiplier,
778 int currentSubindex = pattern.
getSize()-1;
779 for(; currentSubindex >= 0; currentSubindex--){
780 if(pattern.
at(currentSubindex) < 0)
784 if(currentSubindex == -1){
786 callback(
this, property, pattern, currentOffset, information);
793 "PropertyExtractor::calculate()",
794 "Invalid specifier found at subindex " 795 << currentSubindex <<
".",
796 "Did you mean IDX_SUM_ALL, IDX_X, IDX_Y, or IDX_Z?" 800 int nextOffsetMultiplier = offsetMultiplier;
802 nextOffsetMultiplier *= ranges.
at(currentSubindex);
806 bool isSumIndex =
false;
813 for(
int n = 0; n < ranges.
at(currentSubindex); n++){
814 pattern.
at(currentSubindex) = n;
821 nextOffsetMultiplier,
825 currentOffset += offsetMultiplier;
830 template<
typename DataType>
846 iterator != allIndices.
end();
849 const Index &index = *iterator;
850 std::vector<unsigned int> spinIndices
854 IndexTree::SearchMode::MatchWildcards
856 if(spinIndices.size() != 0){
858 spinIndices.size() == 1,
859 "PropertyExtractor::calculate()",
860 "Several spin indeces found.",
861 "Use IDX_SPIN at most once per pattern to" 862 <<
" indicate spin index." 878 this->spinIndex = spinIndex;
885 inline const Solver::Solver& PropertyExtractor::getSolver()
const{
887 "PropertyExtractor::getSolver()",
888 "Missing implementation of PropertyExtractor::getSolver() in" Base class for Solvers.
Definition: Solver.h:42
Property container for the local density of states (LDOS).
Definition: LDOS.h:48
bool isRangeIndex() const
Definition: Subindex.h:441
HoppingAmplitude container.
Definition: HoppingAmplitudeSet.h:50
Property container for magnetization.
Definition: Magnetization.h:44
Property container for local density of states (LDOS).
ConstIterator cbegin() const
Definition: IndexTree.h:406
Subindex & at(unsigned int n)
Definition: Index.h:474
int getOffset(const Index &index) const
Definition: AbstractProperty.h:587
HoppingAmplitude container.
Property container for spin-polarized local density of states (spin-polarized LDOS).
bool isSummationIndex() const
Definition: Subindex.h:437
Property container for density.
ConstIterator end() const
Definition: IndexTree.h:410
Property container for magnetization.
Real number.
Definition: Real.h:33
Abstract Property class.
Definition: Property.h:36
unsigned int getSize() const
Definition: Index.h:482
Abstract Property class.
Definition: AbstractProperty.h:101
Data structure for mapping physical indices to linear indices.
Definition: IndexTree.h:35
Physical index.
Definition: Index.h:44
Definition: IndexTree.h:297
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).
Property container for density of states (DOS).
Definition: DOS.h:48
std::vector< unsigned int > getSubindicesMatching(int subindexValue, const Index &index, SearchMode searchMode) const