#include <PropertyExtractor.h>
Protected Member Functions  
int  getEnergyResolution () const 
double  getLowerBound () const 
double  getUpperBound () const 
double  getEnergyInfinitesimal () const 
void  calculate (void(*callback)(PropertyExtractor *cb_this, void *memory, const Index &index, int offset), void *memory, Index pattern, const Index &ranges, int currentOffset, int offsetMultiplier) 
template<typename DataType >  
void  calculate (void(*callback)(PropertyExtractor *cb_this, void *memory, const Index &index, int offset), const IndexTree &allIndices, const IndexTree &memoryLayout, Property::AbstractProperty< DataType > &abstractProperty, int *spinIndexHint=nullptr) 
void  ensureCompliantRanges (const Index &pattern, Index &ranges) 
void  getLoopRanges (const Index &pattern, const Index &ranges, int *loopDimensions, int **loopRanges) 
IndexTree  generateIndexTree (std::vector< Index > patterns, const HoppingAmplitudeSet &hoppingAmplitudeSet, bool keepSummationWildcards, bool keepSpinWildcards) 
void  validatePatternsNumComponents (const std::vector< Index > &patterns, unsigned int expectedNumComponentIndices, const std::string &functionName) const 
void  validatePatternsSpecifiers (const std::vector< Index > &patterns, const std::vector< int > specifiers, const std::string &functionName) const 
Protected Attributes  
void *  hint 
The PropertyExtractor extracts is a base class for derived PropertyExtractors that are used to extract common physical properties such as DOS, Density, LDOS, etc. from a Solvers.
TBTK::PropertyExtractor::PropertyExtractor::PropertyExtractor  (  ) 
Constructs a PropertyExtractor::PropertyExtractor.

virtual 
Destructor.

protected 
Loops over range indices and calls the given callback function to calculate the correct quantity. The function recursively calls itself replacing any IDX_SUM_ALL, IDX_X, IDX_Y, and IDX_Z specifiers by actual subindices in the range [0, ranges[s]), where s is the subindex at which the specifier appears. For example, the pattern ranges pair {IDX_SUM_ALL, 2, IDX_X} and {2, 1, 3} will result in the callback being called for {0, 2, 0}, {0, 2, 1}, {0, 2, 2}, {1, 2, 0}, {1, 2, 1}, and {1, 2, 2}. The first and fourth, second and fifth, and third and sixth Index will further be passed to the callback with the same memory offset since their result should be summed.
The memory offset is further calculated by traversing the subindices of the apttern from right to left and multiplying the current offset multiplier by the number of indices in the range size for the given subindex. This results in an offset that places the elements in consequtive order in increasing order of the Index order. Where an Index is considered to come before another Index if the first subindex to differ between two Indices from the left is smaller than the other Index.
callback  A callback function that is called to perform the actual calculation for a given Index. 
memory  Pointer to the memory where the result is to be stored. 
pattern  An Index specifying the pattern for which to perform the calculation. 
ranges  The upper limit (exclusive) for which subindices with wildcard specifiers will be replaced. The lower limit is 0. 
currentOffset  The memory offset calculated for the given pattern Index. Should be zero for the initial call to the function. 
offsetMultiplier  Number indicating the block size associated with increasing the current subindex by one. Should be equal to the number of data elements per Index for the initial call to the function. 

protected 
Loops over the indices satisfying the specified patterns and calls the appropriate callback function to calculate the correct quantity.
callback  A callback function that is called to perform the actual calculation for a given Index. 
allIndices  An IndexTree containing all the Indices for which the callback should be called. 
memoryLayout  The memory layout used for the Property. 
abstractProperty  The Property that is being calculated. 
spinIndexHint  Pointer to a memory location that provides information about which subindex that corresponds to a spin index. If the specification of a spin subindex is not necessary for the given Property, this should be nullptr. 

virtual 
Calculate the density. This function should be overriden by those deriving classes that provide support for calculating the density. By default the PropertyExtractor prints an error message that the given property is not supported.
pattern  Specifies the index pattern for which to calculate the density. For example, assume that the index scheme is {x, y, z, spin}. {ID_X, 5, 10, IDX_SUM_ALL} will calculate the density for each x along (y,z)=(5,10) by summing over spin. Similarly {ID_X, 5, IDX_Y, IDX_SUM_ALL} will return a two dimensional density for all x and z and y = 5. Note that IDX_X IDX_Y, and IDX_Z refers to the first, second, and third index used by the routine to create a one, two, or threedimensional output, rather than being tied to the x, y, and z used as physical subindices. 
ranges  Speifies the number of elements for each subindex. Is ignored for indices specified with positive integers in the pattern, but is used to loop from 0 to the value in ranges for IDX_X, IDX_Y, IDX_Z, and IDX_SUM_ALL. Appropriate ranges corresponding to the two pattern examples above are {SIZE_X, 1, 1, NUM_SPINS} and {SIZE_X, 1, SIZE_Z, NUM_SPINS}, respectively. 
Reimplemented in TBTK::PropertyExtractor::Diagonalizer, TBTK::PropertyExtractor::ChebyshevExpander, TBTK::PropertyExtractor::Greens, and TBTK::PropertyExtractor::ExactDiagonalizer.

virtual 
Calculate the density. This function should be overriden by those deriving classes that provide support for calculating the density. By default the PropertyExtractor prints an error message that the given property is not supported.
patterns  A list of patterns that will be matched against the Indices in the Model to determine which Indices for which to calculate the Density. 
Reimplemented in TBTK::PropertyExtractor::BlockDiagonalizer, TBTK::PropertyExtractor::Diagonalizer, TBTK::PropertyExtractor::ChebyshevExpander, and TBTK::PropertyExtractor::Greens.

virtual 
Calculate the density of states. This function should be overriden by those deriving classes that provide support for calculating the density of states. By default the PropertyExtractor prints an error message that the given property is not supported.
Reimplemented in TBTK::PropertyExtractor::BlockDiagonalizer, TBTK::PropertyExtractor::Diagonalizer, and TBTK::PropertyExtractor::ArnoldiIterator.

virtual 
Calculate the entropy. This function should be overriden by those deriving classes that provide support for calculating the entropy. By default the PropertyExtractor prints an error message that the given property is not supported.
Reimplemented in TBTK::PropertyExtractor::BlockDiagonalizer, and TBTK::PropertyExtractor::Diagonalizer.

virtual 
Calculate the expectation value \(\langle c_{to}^{\dagger}c_{from}\). This function should be overriden by those deriving classes that provide support for calculating the expecation value. By default the PropertyExtractor prints an error message that the given property is not supported.
to  The Index on the left operator. 
from  The index on the right operator. 
Reimplemented in TBTK::PropertyExtractor::BlockDiagonalizer, TBTK::PropertyExtractor::Diagonalizer, TBTK::PropertyExtractor::ChebyshevExpander, and TBTK::PropertyExtractor::ExactDiagonalizer.

virtual 
Calculate the local density of states. This function should be overriden by those deriving classes that provide support for calculating the local density of states. By default the PropertyExtractor prints an error message that the given property is not supported.
pattern  Specifies the index pattern for which to calculate the LDOS. For example, assume that the index scheme is {x, y, z, spin}. {ID_X, 5, 10, IDX_SUM_ALL} will calculate the LDOS for each x along (y,z)=(5,10) by summing over spin. Similarly {ID_X, 5, IDX_Y, IDX_SUM_ALL} will return a two dimensional LDOS for all x and z and y = 5. Note that IDX_X, IDX_Y, and IDX_Z refers to the first, second, and third index used by the routine to create a one, two, or threedimensional output, rather than being tied to the x, y, and z used as physical subindices. 
ranges  Speifies the number of elements for each subindex. Is ignored for indices specified with positive integers in the pattern, but is used to loop from 0 to the value in ranges for IDX_X, IDX_Y, IDX_Z, and IDX_SUM_ALL. Appropriate ranges corresponding to the two pattern examples above are {SIZE_X, 1, 1, NUM_SPINS} and {SIZE_X, 1, SIZE_Z, NUM_SPINS}, respectively. 
Reimplemented in TBTK::PropertyExtractor::Diagonalizer, TBTK::PropertyExtractor::ChebyshevExpander, TBTK::PropertyExtractor::ArnoldiIterator, and TBTK::PropertyExtractor::ExactDiagonalizer.

virtual 
Calculate the local density of states. This function should be overriden by those deriving classes that provide support for calculating the local density of states. By default the PropertyExtractor prints an error message that the given property is not supported.
patterns  A list of patterns that will be matched against the Indices in the Model to determine which Indices for which to calculate the local density of states. 
Reimplemented in TBTK::PropertyExtractor::BlockDiagonalizer, TBTK::PropertyExtractor::Diagonalizer, TBTK::PropertyExtractor::ChebyshevExpander, TBTK::PropertyExtractor::ArnoldiIterator, and TBTK::PropertyExtractor::Greens.

virtual 
Calculate the magnetization. This function should be overriden by those deriving classes that provide support for calculating the magnetization. By default the PropertyExtractor prints an error message that the given property is not supported.
pattern  Specifies the index pattern for which to calculate the magnetization. For example, assume that the index scheme is {x, y, z, spin}. {ID_X, 5, 10, IDX_SPIN} will calculate the magnetization for each x along (y,z)=(5,10). Similarly {ID_X, 5, IDX_Y, IDX_SPIN} will return a two dimensional magnetiation for all x and z and y = 5. Note that IDX_X, IDX_Y, and IDX_Z refers to the first, second, and third index used by the routine to create a one, two, or threedimensional output, rather than being tied to the x, y, and z used as physical subindices. 
ranges  Speifies the number of elements for each subindex. Is ignored for indices specified with positive integers in the pattern, but is used to loop from 0 to the value in ranges for IDX_X, IDX_Y, IDX_Z, and IDX_SUM_ALL. Appropriate ranges corresponding to the two pattern examples above are {SIZE_X, 1, 1, NUM_SPINS} and {SIZE_X, 1, SIZE_Z, NUM_SPINS}, respectively. 
\[ \left[\begin{array}{cc} 0 & 1\\ 2 & 3 \end{array}\right] = \left[\begin{array}{cc} \langle c_{i\uparrow}^{\dagger}c_{i\uparrow}\rangle & \langle c_{i\uparrow}^{\dagger}c_{i\downarrow}\rangle\\ \langle c_{i\downarrow}^{\dagger}c_{u\uparrow}\rangle & \langle c_{i\downarrow}^{\dagger}c_{i\downarrow}\rangle \end{array}\right]. \]
Reimplemented in TBTK::PropertyExtractor::Diagonalizer, TBTK::PropertyExtractor::ChebyshevExpander, and TBTK::PropertyExtractor::ExactDiagonalizer.

virtual 
Calculate the Magnetization. This function should be overriden by those deriving classes that provide support for calculating the magnetization. By default the PropertyExtractor prints an error message that the given property is not supported.
patterns  A list of patterns that will be matched against the Indices in the Model to determine which Indices for which to calculate the Magnetization. 
Reimplemented in TBTK::PropertyExtractor::BlockDiagonalizer, TBTK::PropertyExtractor::Diagonalizer, and TBTK::PropertyExtractor::ChebyshevExpander.

virtual 
Calculate the spinpolarized local density of states. This function should be overriden by those deriving classes that provide support for calculating the spinpolarized local density of states. By default the PropertyExtractor prints an error message that the given property is not supported.
pattern  Specifies the index pattern for which to calculate the spinpolarized LDOS. For example, assume that the index scheme is {x, y, z, spin}. {ID_X, 5, 10, IDX_SPIN} will calculate the spinpolarized LDOS for each x along (y,z)=(5,10). Similarly {ID_X, 5, IDX_Y, IDX_SPIN} will return a two dimensional spinpolarized LDOS for all x and z and y = 5. Note that IDX_X, IDX_Y, and IDX_Z refers to the first, second, and third index used by the routine to create a one, two, or threedimensional output, rather than being tied to the x, y, and z used as physical subindices. 
ranges  Speifies the number of elements for each subindex. Is ignored for indices specified with positive integers in the pattern, but is used to loop from 0 to the value in ranges for IDX_X, IDX_Y, IDX_Z, and IDX_SUM_ALL. Appropriate ranges corresponding to the two pattern examples above are {SIZE_X, 1, 1, NUM_SPINS} and {SIZE_X, 1, SIZE_Z, NUM_SPINS}, respectively. 
\[ \left[\begin{array}{cc} 0 & 1\\ 2 & 3 \end{array}\right] = \left[\begin{array}{cc} \rho_{i\uparrow i\uparrow}(E) & \rho_{i\uparrow i\downarrow}(E)\\ \rho_{i\downarrow i\uparrow}(E) & \rho_{i\downarrow i\downarrow}(E)\\ \end{array}\right], \]
where\[ \rho_{i\sigma i\sigma'}(E) = \sum_{E_n}\langle\Psi_nc_{i\sigma}^{\dagger}c_{i\sigma'}\Psi_n\rangle\delta(E  E_n) . \]
Reimplemented in TBTK::PropertyExtractor::Diagonalizer, TBTK::PropertyExtractor::ChebyshevExpander, TBTK::PropertyExtractor::ArnoldiIterator, and TBTK::PropertyExtractor::ExactDiagonalizer.

virtual 
Calculate the spinpolarized local density of states. This function should be overriden by those deriving classes that provide support for calculating the spinpolarized local density of states. By default the PropertyExtractor prints an error message that the given property is not supported.
patterns  A list of patterns that will be matched against the Indices in the Model to determine which Indices for which to calculate the spinpolarized local density of states. 
Reimplemented in TBTK::PropertyExtractor::BlockDiagonalizer, TBTK::PropertyExtractor::Diagonalizer, TBTK::PropertyExtractor::ChebyshevExpander, and TBTK::PropertyExtractor::ArnoldiIterator.

protected 
Ensure that range indices are on compliant format. I.e., sets the range to one for indices with nonnegative pattern value.
pattern  The pattern. 
ranges  The ranges that will have its subindices set to one for every pattern subindex that is non negative. 

protected 
Generate an IndexTree containing all the Indices in the HoppingAmplitudeSet that matches the given patterns. Before being added to the IndexTree, the Indices may be modified to replace subindices by their corresponding pattern value. I.e. A summation or spin subindex may still be labeld such in the IndexTree depending on the flags that are passed to the function.
The pattern can also be a compund Index consisting of two Indices, in which case the pattern matching is applied to each component Index separately.
patterns  List of patterns to match against. 
The  HoppingAmplitudeSet cntaining all the Indices that will be matched against the patterns. 
keepSummationWildcards  If true, summation wildcards in the pattern will be preserved in the IndexTree. 
keepSpinWildcards  If true, spin wildcards in the pattern will be preserved in the IndexTree. 

inlineprotected 
Get the energy resolution.

protected 
Extract ranges for loop indices. The subindices with IDX_X, IDX_Y and IDX_Z are identified and counted and an array of the same size as the number of loop indices is created and filled with the ranges for the corrsponding loop subindices.
pattern  A pattern. 
ranges  The ranges for the given pattern. 
loopDimensions  Pointer to int that will hold the number of loop dimensions after the call has completed. 
loopRanges  *loopRange will point to an array of size *loopDimensions that contain the ranges for the loop subindices. 

inlineprotected 
Get lower bound for the energy window.

inlineprotected 
Get the upper bound for the energy window.

virtual 
Set the size of the energy infinitesimal that can be used to add for example an \(i\delta\) term to the denominator of the Green's function.
energyInfinitesimal  The energy infinitesimal \(\delta\). 

virtual 
Set the energy window used for energy dependent quantities.
lowerBound  The lower bound for the energy window. 
upperBound  The upper bound for the energy window. 
energyResolution  The number of energy points used to resolve the energy window. 
Reimplemented in TBTK::PropertyExtractor::BlockDiagonalizer, TBTK::PropertyExtractor::ChebyshevExpander, TBTK::PropertyExtractor::Greens, TBTK::PropertyExtractor::ElectronFluctuationVertex, TBTK::PropertyExtractor::LindhardSusceptibility, TBTK::PropertyExtractor::RPASusceptibility, and TBTK::PropertyExtractor::SelfEnergy.

inlineprotected 
Check that a given set of patterns has the correct number of component Indices per pattern. Prints error message if not.
patterns  List of patterns to check. 
numComponents  The expected number of component Indices . 
functionName  String that should contain the name of the function from which the function is called. Is used to print an error message if the validation fails. 

inlineprotected 
Check that a given set of patterns only has nonnegative subindices or one of the allowed subindex specifiers. Prints error message if not.
patterns  List of patterns to check. 
numComponents  The allowed subindex specifiers. 
functionName  String that should contain the name of the function from which the function is called. Is used to print an error message if the validation fails. 

protected 
Hint used to pass information between calculate[Property] and calculate[Property]Callback.