TBTK
TBTK::PropertyExtractor::PropertyExtractor Class Reference

#include <PropertyExtractor.h>

Inheritance diagram for TBTK::PropertyExtractor::PropertyExtractor:

## Public Member Functions

PropertyExtractor ()

virtual ~PropertyExtractor ()

virtual void setEnergyWindow (double lowerBound, double upperBound, int energyResolution)

virtual Property::Density calculateDensity (Index pattern, Index ranges)

virtual Property::Density calculateDensity (std::initializer_list< Index > patterns)

virtual Property::Magnetization calculateMagnetization (Index pattern, Index ranges)

virtual Property::Magnetization calculateMagnetization (std::initializer_list< Index > patterns)

virtual Property::LDOS calculateLDOS (Index pattern, Index ranges)

virtual Property::LDOS calculateLDOS (std::initializer_list< Index > patterns)

virtual Property::SpinPolarizedLDOS calculateSpinPolarizedLDOS (Index pattern, Index ranges)

virtual Property::SpinPolarizedLDOS calculateSpinPolarizedLDOS (std::initializer_list< Index > patterns)

virtual std::complex< double > calculateExpectationValue (Index to, Index from)

virtual Property::DOS calculateDOS ()

virtual double calculateEntropy ()

## Protected Member Functions

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 *lDimensions, int **lRanges)

IndexTree generateIndexTree (std::initializer_list< Index > patterns, const HoppingAmplitudeSet &hoppingAmplitudeSet, bool keepSumationWildcards, bool keepSpinWildcards)

## Protected Attributes

int energyResolution

double lowerBound

double upperBound

void * hint

## Static Protected Attributes

static constexpr int ENERGY_RESOLUTION = 1000

static constexpr double LOWER_BOUND = -1.

static constexpr double UPPER_BOUND = 1.

## Detailed Description

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.

## Constructor & Destructor Documentation

 TBTK::PropertyExtractor::PropertyExtractor::PropertyExtractor ( )

Constructor.

 virtual TBTK::PropertyExtractor::PropertyExtractor::~PropertyExtractor ( )
virtual

Destructor.

## Member Function Documentation

 void TBTK::PropertyExtractor::PropertyExtractor::calculate ( void(*)(PropertyExtractor *cb_this, void *memory, const Index &index, int offset) callback, void * memory, Index pattern, const Index & ranges, int currentOffset, int offsetMultiplier )
protected

Loops over range indices and calls the appropriate callback function to calculate the correct quantity.

template<typename DataType >
 void TBTK::PropertyExtractor::PropertyExtractor::calculate ( void(*)(PropertyExtractor *cb_this, void *memory, const Index &index, int offset) callback, const IndexTree & allIndices, const IndexTree & memoryLayout, Property::AbstractProperty< DataType > & abstractProperty, int * spinIndexHint = nullptr )
protected

Loops over the indices satisfying the specified patterns and calls the appropriate callback function to calculate the correct quantity.

 virtual Property::Density TBTK::PropertyExtractor::PropertyExtractor::calculateDensity ( Index pattern, Index ranges )
virtual

Calculate density.

Parameters
 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 three-dimensional 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.
Returns
A density array with size equal to the number of points included by specified patter-range combination.
 virtual Property::Density TBTK::PropertyExtractor::PropertyExtractor::calculateDensity ( std::initializer_list< Index > patterns )
virtual

Calculate density.

 virtual Property::DOS TBTK::PropertyExtractor::PropertyExtractor::calculateDOS ( )
virtual

Calculate density of states.

 virtual double TBTK::PropertyExtractor::PropertyExtractor::calculateEntropy ( )
virtual
 virtual std::complex TBTK::PropertyExtractor::PropertyExtractor::calculateExpectationValue ( Index to, Index from )
virtual

Calculate expectation value.

 virtual Property::LDOS TBTK::PropertyExtractor::PropertyExtractor::calculateLDOS ( Index pattern, Index ranges )
virtual

Calculate local density of states.

Parameters
 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 three-dimensional 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.
Returns
A density array with size equal to the number of points included by specified patter-range combination.
 virtual Property::LDOS TBTK::PropertyExtractor::PropertyExtractor::calculateLDOS ( std::initializer_list< Index > patterns )
virtual

Calculate local density of states.

 virtual Property::Magnetization TBTK::PropertyExtractor::PropertyExtractor::calculateMagnetization ( Index pattern, Index ranges )
virtual

Calculate magnetization.

Parameters
 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 three-dimensional 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.
Returns
A magnetization array with size equal to four times the number of points included by specified patter-range combination. The four entries are

$\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].$

 virtual Property::Magnetization TBTK::PropertyExtractor::PropertyExtractor::calculateMagnetization ( std::initializer_list< Index > patterns )
virtual

Calculate Magnetization.

 virtual Property::SpinPolarizedLDOS TBTK::PropertyExtractor::PropertyExtractor::calculateSpinPolarizedLDOS ( Index pattern, Index ranges )
virtual

Calculate spin-polarized local density of states.

Parameters
 pattern Specifies the index pattern for which to calculate the spin-polarized LDOS. For example, assume that the index scheme is {x, y, z, spin}. {ID_X, 5, 10, IDX_SPIN} will calculate the spin-polarized LDOS for each x along (y,z)=(5,10). Similarly {ID_X, 5, IDX_Y, IDX_SPIN} will return a two dimensional spin-polarized 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 three-dimensional 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.
Returns
A spin-polarized LDOS array with size equal to four times the number of points included by specified patter-range combination. The four entries are

$\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_n|c_{i\sigma}^{\dagger}c_{i\sigma'}|\Psi_n\rangle\delta(E - E_n) .$

 virtual Property::SpinPolarizedLDOS TBTK::PropertyExtractor::PropertyExtractor::calculateSpinPolarizedLDOS ( std::initializer_list< Index > patterns )
virtual

Calculate spin-polarized local density of states.

 void TBTK::PropertyExtractor::PropertyExtractor::ensureCompliantRanges ( const Index & pattern, Index & ranges )
protected

Ensure that range indices are on compliant format. (Set range to one for indices with non-negative pattern value.)

 IndexTree TBTK::PropertyExtractor::PropertyExtractor::generateIndexTree ( std::initializer_list< Index > patterns, const HoppingAmplitudeSet & hoppingAmplitudeSet, bool keepSumationWildcards, bool keepSpinWildcards )
protected

Generate IndexTree.

 void TBTK::PropertyExtractor::PropertyExtractor::getLoopRanges ( const Index & pattern, const Index & ranges, int * lDimensions, int ** lRanges )
protected

Extract ranges for loop indices.

 virtual void TBTK::PropertyExtractor::PropertyExtractor::setEnergyWindow ( double lowerBound, double upperBound, int energyResolution )
virtual

Set the energy window used for energy dependent quantities.

Reimplemented in TBTK::PropertyExtractor::ChebyshevExpander.

## Member Data Documentation

 constexpr int TBTK::PropertyExtractor::PropertyExtractor::ENERGY_RESOLUTION = 1000
staticprotected

Default energy resolution.

 int TBTK::PropertyExtractor::PropertyExtractor::energyResolution
protected

Energy resolution used for energy dependent quantities.

 void* TBTK::PropertyExtractor::PropertyExtractor::hint
protected

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

 constexpr double TBTK::PropertyExtractor::PropertyExtractor::LOWER_BOUND = -1.
staticprotected

Default lower bound.

 double TBTK::PropertyExtractor::PropertyExtractor::lowerBound
protected

Lower bound used for energy dependent quantities.

 constexpr double TBTK::PropertyExtractor::PropertyExtractor::UPPER_BOUND = 1.
staticprotected

Default upper bound.

 double TBTK::PropertyExtractor::PropertyExtractor::upperBound
protected

Upper bound used for energy dependent quantities.

The documentation for this class was generated from the following file: