TBTK
TBTK::Solver::ChebyshevExpander Class Reference

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

#include <ChebyshevExpander.h>

Inheritance diagram for TBTK::Solver::ChebyshevExpander:
TBTK::Solver::Solver TBTK::Communicator

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 setBroadening (double broadening)
 
double getBroadening () 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
 

Additional Inherited Members

- 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

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<std::vector<std::complex<double> > > 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
tovector of 'to'-indeces, or \(i\)'s.
from'From'-index, or \(j\).
coefficientsPointer to array able to hold numCoefficients \(\times\)toIndeices.size() coefficients.
numCoefficientsNumber of coefficients to calculate for each to-index.
broadeningBroadening 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\).
coefficientsPointer to array able to hold numCoefficients coefficients.
numCoefficientsNumber of coefficients to calculate.
broadeningBroadening 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
greensFunctionPointer to array able to hold Green's function. Has to be able to hold energyResolution elements.
coefficientsChebyshev coefficients calculated by ChebyshevExpander::calculateCoefficients.

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

double TBTK::Solver::ChebyshevExpander::getBroadening ( ) const
inline

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

Returns
The broadening parameter used.
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
The number of energy points to use.
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.
void TBTK::Solver::ChebyshevExpander::setBroadening ( double  broadening)
inline

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

Parameters
broadeningThe broadening parameter to use.
void TBTK::Solver::ChebyshevExpander::setCalculateCoefficientsOnGPU ( bool  calculateCoefficientsOnGPU)
inline

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

Parameters
calculateCoefficientsOnGPUTrue 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
energyResolutionThe number of energy points to use.
void TBTK::Solver::ChebyshevExpander::setGenerateGreensFunctionsOnGPU ( bool  generateGreensFunctionsOnGPU)
inline

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

Parameters
generateGreensFunctionsOnGPUTrue 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
lowerBoundThe 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
numCoefficientsThe 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
scaleFactorThe 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
upperBoundThe 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
useLookupTableTrue to use a lookup table.

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