TBTK
TBTK::Solver::ChebyshevExpander Class Reference

Solves a Model using the Chebyshev method. More...

#include <ChebyshevExpander.h>

Inheritance diagram for TBTK::Solver::ChebyshevExpander:

## Public Types

enum  Type { Advanced, Retarded, Principal, NonPrincipal }

## Public Member Functions

ChebyshevExpander ()

virtual ~ChebyshevExpander ()

virtual void setModel (Model &model)

void setScaleFactor (double scaleFactor)

double getScaleFactor ()

void setNumCoefficients (int numCoefficients)

int getNumCoefficients () const

void setEnergyResolution (int energyResolution)

int getEnergyResolution () const

void setLowerBound (double lowerBound)

double getLowerBound () const

void setUpperBound (double upperBound)

double getUpperBound () const

void setCalculateCoefficientsOnGPU (bool calculateCoefficientsOnGPU)

bool getCalculateCoefficientsOnGPU () const

void setGenerateGreensFunctionsOnGPU (bool generateGreensFunctionsOnGPU)

bool getGenerateGreensFunctionsOnGPU () const

void setUseLookupTable (bool useLookupTable)

bool getUseLookupTable () const

std::vector< std::vector< std::complex< double > > > calculateCoefficients (std::vector< Index > &to, Index from)

std::vector< std::complex< double > > calculateCoefficients (Index to, Index from)

std::vector< std::complex< double > > generateGreensFunction (const std::vector< std::complex< double >> &coefficients, Type type=Type::Retarded)

Public Member Functions inherited from TBTK::Solver::Solver
Solver ()

virtual ~Solver ()

ModelgetModel ()

const ModelgetModel () const

Public Member Functions inherited from TBTK::Communicator
Communicator (bool verbose)

void setVerbose (bool verbose)

bool getVerbose () const

Static Public Member Functions inherited from TBTK::Communicator
static void setGlobalVerbose (bool globalVerbose)

static bool getGlobalVerbose ()

## Detailed Description

Solves a Model using the Chebyshev method.

The ChebyshevExpander can be used to calculate Green's function for a given Model using an expansion of the form

$$G_{\mathbf{i}\mathbf{j}}(E) = \frac{1}{\sqrt{s^2 - E^2}} \sum_{m=0}^{\infty} \frac{b_{\mathbf{i}\mathbf{j}}^{(m)}}{1 + \delta_{0m}} F(m\textrm{acos}(E/s)),$$

where $$F(x)$$ is one of the functions $$\cos(x)$$, $$\sin(x)$$, $$e^{ix}$$, and $$e^{-ix}$$. The implementation is based on PhysRevLett.105.167006. The ChebyshevExpander can be run on CPU, GPU, or a mixture of both. The calculation of Chebyshev coefficients scales as $$O(n)$$ with each of the following: dimension of the Hilbert space and number of Chebyshev coefficients. The generation of Green's functions scales as $$O(n)$$ with the following: Number of coefficients, energy resolution, and the number of Green's functions.

## Member Enumeration Documentation

 strong

Enum class describing the type of Green's function to calculate.

## Constructor & Destructor Documentation

 TBTK::Solver::ChebyshevExpander::ChebyshevExpander ( )
 virtual TBTK::Solver::ChebyshevExpander::~ChebyshevExpander ( )
virtual

Destructor.

## Member Function Documentation

 std::vector > > TBTK::Solver::ChebyshevExpander::calculateCoefficients ( std::vector< Index > & to, Index from )

Calculates the Chebyshev coefficients for $$G_{ij}(E)$$, where $$i = \textrm{to}$$ is a set of indices and $$j = \textrm{from}$$.

Parameters
 to vector of 'to'-indeces, or $$i$$'s. from 'From'-index, or $$j$$. coefficients Pointer to array able to hold numCoefficients $$\times$$toIndeices.size() coefficients. numCoefficients Number of coefficients to calculate for each to-index. broadening Broadening to use in convolusion of coefficients to remedy Gibb's osciallations.
 std::vector< std::complex< double > > TBTK::Solver::ChebyshevExpander::calculateCoefficients ( Index to, Index from )
inline

Calculates the Chebyshev coefficients for $$G_{ij}(E)$$, where $$i = \textrm{to}$$ and $$j = \textrm{from}$$.

Parameters
 to 'To'-index, or $$i$$. from 'From'-index, or $$j$$. coefficients Pointer to array able to hold numCoefficients coefficients. numCoefficients Number of coefficients to calculate. broadening Broadening to use in convolusion of coefficients to remedy Gibb's osciallations.
 std::vector< std::complex< double > > TBTK::Solver::ChebyshevExpander::generateGreensFunction ( const std::vector< std::complex< double >> & coefficients, Type type = Type::Retarded )
inline

Genererate Green's function. Uses lookup table generated by ChebyshevExpander::generateLookupTable. Runs on CPU.

Parameters
 greensFunction Pointer to array able to hold Green's function. Has to be able to hold energyResolution elements. coefficients Chebyshev coefficients calculated by ChebyshevExpander::calculateCoefficients.

numCoefficients and energyResolution are here the values specified in the call to ChebyshevExpander::generateLookupTable

inline

Get the broadening to use in convolusion of coefficients to remedy Gibb's osciallations.

Returns
 bool TBTK::Solver::ChebyshevExpander::getCalculateCoefficientsOnGPU ( ) const
inline

Get whether Chebyshev coefficients are set to be calculated on GPU.

Returns
True if GPU is used.
 int TBTK::Solver::ChebyshevExpander::getEnergyResolution ( ) const
inline

Get the number of energy point to use when generating Green's functions.

Returns
 bool TBTK::Solver::ChebyshevExpander::getGenerateGreensFunctionsOnGPU ( ) const
inline

Get whether Green's functions are set to be generated on GPU.

Returns
True if GPU is used.
 double TBTK::Solver::ChebyshevExpander::getLowerBound ( ) const
inline

Get the lower bound to use for the energy when generating the Green's function.

Returns
The lower bound for the energy.
 int TBTK::Solver::ChebyshevExpander::getNumCoefficients ( ) const
inline

Get the number of Chebyshev coefficients to use during calculations.

Returns
The number of Chebyshev coefficients.
 double TBTK::Solver::ChebyshevExpander::getScaleFactor ( )
inline

Get scale factor.

Returns
The scale factor that is used to rescale the Hamiltonian.
 double TBTK::Solver::ChebyshevExpander::getUpperBound ( ) const
inline

Get the upper bound to use for the energy when generating the Green's function.

Returns
The upper bound for the energy.
 bool TBTK::Solver::ChebyshevExpander::getUseLookupTable ( ) const
inline

Set whether a lookup table should be used to when generating Green's functions.

Returns
True if a lookup table is used.
inline

Set the broadening to use in convolusion of coefficients to remedy Gibb's osciallations.

Parameters
 void TBTK::Solver::ChebyshevExpander::setCalculateCoefficientsOnGPU ( bool calculateCoefficientsOnGPU )
inline

Set whether Chebyshev coefficients should be calculated on GPU. The default value is false.

Parameters
 calculateCoefficientsOnGPU True to use GPU, false to use CPU.
 void TBTK::Solver::ChebyshevExpander::setEnergyResolution ( int energyResolution )
inline

Set the number of energy point to use when generating Green's functions. The default value is 1000.

Parameters
 void TBTK::Solver::ChebyshevExpander::setGenerateGreensFunctionsOnGPU ( bool generateGreensFunctionsOnGPU )
inline

Set whether Green's functions should be generated on GPU. The default value is false.

Parameters
 generateGreensFunctionsOnGPU True to use GPU, false to use CPU.
 void TBTK::Solver::ChebyshevExpander::setLowerBound ( double lowerBound )
inline

Set the lower bound to use for the energy when generating the Green's function. The default value is -1.

Parameters
 lowerBound The lower bound for the energy.
 virtual void TBTK::Solver::ChebyshevExpander::setModel ( Model & model )
virtual

Overrides Solver::setModel().

Reimplemented from TBTK::Solver::Solver.

 void TBTK::Solver::ChebyshevExpander::setNumCoefficients ( int numCoefficients )
inline

Set the number of Chebyshev coefficients to use during calculations. The default value is 1000.

Parameters
 numCoefficients The number of Chebyshev coefficients.
 void TBTK::Solver::ChebyshevExpander::setScaleFactor ( double scaleFactor )
inline

Sets the scale factor that rescales the Hamiltonian to ensure that the energy spectrum of the Hamiltonian is bounded on the interval (-1, 1).

Parameters
 scaleFactor The scale factor.
 void TBTK::Solver::ChebyshevExpander::setUpperBound ( double upperBound )
inline

Set the upper bound to use for the energy when generating the Green's function. The default value is 1.

Parameters
 upperBound The upper bound for the energy.
 void TBTK::Solver::ChebyshevExpander::setUseLookupTable ( bool useLookupTable )
inline

Set whether a lookup table should be used to when generating Green's functions.

Parameters
 useLookupTable True to use a lookup table.

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