TBTK
Public Types | Public Member Functions | List of all members
TBTK::ChebyshevSolver Class Reference

#include <ChebyshevSolver.h>

Public Types

enum  GreensFunctionType { Advanced, Retarded, Principal, NonPrincipal }
 

Public Member Functions

 ChebyshevSolver ()
 
 ~ChebyshevSolver ()
 
void setModel (Model *model)
 
ModelgetModel ()
 
void setScaleFactor (double scaleFactor)
 
double getScaleFactor ()
 
void calculateCoefficients (std::vector< Index > &to, Index from, std::complex< double > *coefficients, int numCoefficients, double broadening=0.0001)
 
void calculateCoefficients (Index to, Index from, std::complex< double > *coefficients, int numCoefficients, double broadening=0.0001)
 
void calculateCoefficientsGPU (std::vector< Index > &to, Index from, std::complex< double > *coefficients, int numCoefficients, double broadening=0.0001)
 
void calculateCoefficientsGPU (Index to, Index from, std::complex< double > *coefficients, int numCoefficients, double broadening=0.0001)
 
void calculateCoefficientsWithCutoff (Index to, Index from, std::complex< double > *coefficients, int numCoefficients, double componentCutoff, double broadening=0.0001)
 
void generateLookupTable (int numCoefficeints, int energyResolution, double lowerBound=-1., double upperBound=1.)
 
void loadLookupTableGPU ()
 
void destroyLookupTableGPU ()
 
void generateGreensFunction (std::complex< double > *greensFunction, std::complex< double > *coefficients, int numCoefficients, int energyResolution, double lowerBound=-1., double upperBound=1., GreensFunctionType type=GreensFunctionType::Retarded)
 
void generateGreensFunction (std::complex< double > *greensFunction, std::complex< double > *coefficients, GreensFunctionType type=GreensFunctionType::Retarded)
 
void generateGreensFunctionGPU (std::complex< double > *greensFunction, std::complex< double > *coefficients, GreensFunctionType type=GreensFunctionType::Retarded)
 
std::complex< double > getMonolopoulosABCDamping (double distanceToEdge, double boundarySize, double e=1., double c=2.62)
 
void setDamping (std::complex< double > *damping)
 
void setTalkative (bool isTalkative)
 

Detailed Description

The ChebyshevSolver can be used to calculate Green's function for a given Model. The implementation is based on PhysRevLett.105.167006. The ChebyshevSolver 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 used to indicate the type of Green's function to generate.

Constructor & Destructor Documentation

TBTK::ChebyshevSolver::ChebyshevSolver ( )

Constructor.

TBTK::ChebyshevSolver::~ChebyshevSolver ( )

Destructor.

Member Function Documentation

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

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

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

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

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

Experimental.

void TBTK::ChebyshevSolver::destroyLookupTableGPU ( )

Free memory allocated on GPU with ChebyshevSolver::loadLookupTableGPU

void TBTK::ChebyshevSolver::generateGreensFunction ( std::complex< double > *  greensFunction,
std::complex< double > *  coefficients,
int  numCoefficients,
int  energyResolution,
double  lowerBound = -1.,
double  upperBound = 1.,
GreensFunctionType  type = GreensFunctionType::Retarded 
)

Genererate Green's function. Does not use lookup table generated by ChebyshevSolver::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 ChebyshevSolver::calculateCoefficients.
numCoefficeintsNumber of coefficients in coefficients.
energyResolutionNumber of elements in greensFunction.
lowerBoundLower bound, has to be larger or equal to -scaleFactor set by setScaleFactor (default value 1).
upperBoundUpper bound, has to be smaller or equal to scaleFactor setBy setScaleFactor (default value 1).
void TBTK::ChebyshevSolver::generateGreensFunction ( std::complex< double > *  greensFunction,
std::complex< double > *  coefficients,
GreensFunctionType  type = GreensFunctionType::Retarded 
)

Genererate Green's function. Uses lookup table generated by ChebyshevSolver::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 ChebyshevSolver::calculateCoefficients.

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

void TBTK::ChebyshevSolver::generateGreensFunctionGPU ( std::complex< double > *  greensFunction,
std::complex< double > *  coefficients,
GreensFunctionType  type = GreensFunctionType::Retarded 
)

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

Parameters
greensFunctionPointer to array able to hold Green's function. Has to be able to hold energyResolution elements.
coefficientsChebyshev coefficients calculated by ChebyshevSolver::calculateCoefficients.

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

void TBTK::ChebyshevSolver::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
numCoefficeintsNumber of coefficients used in Chebyshev
lowerBoundLower bound, has to be larger or equal to -scaleFactor set by setScaleFactor (default value 1).
upperBoundUpper bound, has to be smaller or equal to scaleFactor setBy setScaleFactor (default value 1). expansion.
Model * TBTK::ChebyshevSolver::getModel ( )
inline

Get model.

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

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

Parameters
distanceToEdgeDistance from edge to the point at which to calculate the damping factor.
boundarySizeSize of the boundary region.
bTuning parameter for optimizing the potential
cTuning 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::ChebyshevSolver::getScaleFactor ( )
inline

Get scale factor.

void TBTK::ChebyshevSolver::loadLookupTableGPU ( )

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

void TBTK::ChebyshevSolver::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.

void TBTK::ChebyshevSolver::setModel ( Model model)

Set model to work on.

void TBTK::ChebyshevSolver::setScaleFactor ( double  scaleFactor)
inline

Set scale factor.


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