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 calculateCoefficients (std::vector< Index > &to, Index from, std::complex< double > *coefficients, int numCoefficients, double broadening=0.000001)

void calculateCoefficients (Index to, Index from, std::complex< double > *coefficients, int numCoefficients, double broadening=0.000001)

void calculateCoefficientsGPU (std::vector< Index > &to, Index from, std::complex< double > *coefficients, int numCoefficients, double broadening=0.000001)

void calculateCoefficientsGPU (Index to, Index from, std::complex< double > *coefficients, int numCoefficients, double broadening=0.000001)

void calculateCoefficientsWithCutoff (Index to, Index from, std::complex< double > *coefficients, int numCoefficients, double componentCutoff, double broadening=0.000001)

void generateLookupTable (int numCoefficeints, int energyResolution, double lowerBound=-1., double upperBound=1.)

void destroyLookupTable ()

bool getLookupTableIsGenerated ()

void destroyLookupTableGPU ()

std::complex< double > * generateGreensFunction (std::complex< double > *coefficients, int numCoefficients, int energyResolution, double lowerBound=-1., double upperBound=1., Type type=Type::Retarded)

std::complex< double > * generateGreensFunction (std::complex< double > *coefficients, Type type=Type::Retarded)

std::complex< double > * generateGreensFunctionGPU (std::complex< double > *coefficients, Type type=Type::Retarded)

std::complex< double > getMonolopoulosABCDamping (double distanceToEdge, double boundarySize, double e=1., double c=2.62)

void setDamping (std::complex< double > *damping)

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. 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.

## Constructor & Destructor Documentation

 TBTK::Solver::ChebyshevExpander::ChebyshevExpander ( )

Constructor.

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

Destructor.

## Member Function Documentation

 void TBTK::Solver::ChebyshevExpander::calculateCoefficients ( std::vector< Index > & to, Index from, std::complex< double > * coefficients, int numCoefficients, double broadening = 0.000001 )

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

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.
 void TBTK::Solver::ChebyshevExpander::calculateCoefficients ( Index to, Index from, std::complex< double > * coefficients, int numCoefficients, double broadening = 0.000001 )

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

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.
 void TBTK::Solver::ChebyshevExpander::calculateCoefficientsGPU ( std::vector< Index > & to, Index from, std::complex< double > * coefficients, int numCoefficients, double broadening = 0.000001 )

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

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.
 void TBTK::Solver::ChebyshevExpander::calculateCoefficientsGPU ( Index to, Index from, std::complex< double > * coefficients, int numCoefficients, double broadening = 0.000001 )

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

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.
 void TBTK::Solver::ChebyshevExpander::calculateCoefficientsWithCutoff ( Index to, Index from, std::complex< double > * coefficients, int numCoefficients, double componentCutoff, double broadening = 0.000001 )

Experimental.

 void TBTK::Solver::ChebyshevExpander::destroyLookupTable ( )

Free memory allocated by ChebyshevExpander::generateLookupTable().

 void TBTK::Solver::ChebyshevExpander::destroyLookupTableGPU ( )

Free memory allocated on GPU with ChebyshevExpander::loadLookupTableGPU()

 std::complex* TBTK::Solver::ChebyshevExpander::generateGreensFunction ( std::complex< double > * coefficients, int numCoefficients, int energyResolution, double lowerBound = -1., double upperBound = 1., Type type = Type::Retarded )

Genererate Green's function. Does not use 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. numCoefficeints Number of coefficients in coefficients. energyResolution Number of elements in greensFunction. lowerBound Lower bound, has to be larger or equal to -scaleFactor set by setScaleFactor (default value 1). upperBound Upper bound, has to be smaller or equal to scaleFactor setBy setScaleFactor (default value 1).
 std::complex* TBTK::Solver::ChebyshevExpander::generateGreensFunction ( std::complex< double > * coefficients, Type type = Type::Retarded )

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

 std::complex* TBTK::Solver::ChebyshevExpander::generateGreensFunctionGPU ( std::complex< double > * coefficients, Type type = Type::Retarded )

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

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

 void TBTK::Solver::ChebyshevExpander::generateLookupTable ( int numCoefficeints, int energyResolution, double lowerBound = -1., double upperBound = 1. )

Generate lokup table for quicker generation of multiple Green's functions. Required if evaluation is to be performed on GPU.

Parameters
 numCoefficeints Number of coefficients used in Chebyshev lowerBound Lower bound, has to be larger or equal to -scaleFactor set by setScaleFactor (default value 1). upperBound Upper bound, has to be smaller or equal to scaleFactor setBy setScaleFactor (default value 1). expansion.
 bool TBTK::Solver::ChebyshevExpander::getLookupTableIsGenerated ( )
inline

Returns true if a lookup table has been generated.

inline

Returns true if the lookup table has been loaded to the GPU.

 std::complex TBTK::Solver::ChebyshevExpander::getMonolopoulosABCDamping ( double distanceToEdge, double boundarySize, double e = 1., double c = 2.62 )

Damping potential based on J. Chem. Phys. 117, 9552 (2002).

Parameters
 distanceToEdge Distance from edge to the point at which to calculate the damping factor. boundarySize Size of the boundary region. b Tuning parameter for optimizing the potential c Tuning parameter for optimizing the potential
Returns
exp(-gamma), where gamma = 0 in the interior, infty outside the edge, and determined by the function described in J. Chem. Phys. 117, 9552 (2002), inside the boundary region.
 double TBTK::Solver::ChebyshevExpander::getScaleFactor ( )
inline

Get scale factor.

Load lookup table generated by ChebyshevExpander::generateLookupTable onto GPU.

 void TBTK::Solver::ChebyshevExpander::setDamping ( std::complex< double > * damping )
inline

Set damping mask. The damping mask will be used as prefactor in the modified Chebyshev expansion used for implementing absorbing boundary conditions. If set to NULL (default), no damping term will be applied.

 virtual void TBTK::Solver::ChebyshevExpander::setModel ( Model & model )
virtual

Overrides Solver::setModel().

Reimplemented from TBTK::Solver::Solver.

 void TBTK::Solver::ChebyshevExpander::setScaleFactor ( double scaleFactor )
inline

Set scale factor.

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