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 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 loadLookupTableGPU ()
 
void destroyLookupTableGPU ()
 
bool getLookupTableIsLoadedGPU ()
 
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
 

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. 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
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::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\).
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::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
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::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\).
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::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<double>* 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
greensFunctionPointer to array able to hold Green's function. Has to be able to hold energyResolution elements.
coefficientsChebyshev coefficients calculated by ChebyshevExpander::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).
std::complex<double>* 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
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

std::complex<double>* 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
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

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
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.
bool TBTK::Solver::ChebyshevExpander::getLookupTableIsGenerated ( )
inline

Returns true if a lookup table has been generated.

bool TBTK::Solver::ChebyshevExpander::getLookupTableIsLoadedGPU ( )
inline

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

std::complex<double> 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
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::Solver::ChebyshevExpander::getScaleFactor ( )
inline

Get scale factor.

void TBTK::Solver::ChebyshevExpander::loadLookupTableGPU ( )

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: