|
TBTK
|
#include <ChebyshevSolver.h>
Public Types | |
| enum | GreensFunctionType { Advanced, Retarded, Principal, NonPrincipal } |
Public Member Functions | |
| ChebyshevSolver () | |
| ~ChebyshevSolver () | |
| void | setModel (Model *model) |
| Model * | getModel () |
| 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) |
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
with each of the following: dimension of the Hilbert space and number of Chebyshev coefficients. The generation of Green's functions scales as
with the following: Number of coefficients, energy resolution, and the number of Green's functions.
|
strong |
Enum used to indicate the type of Green's function to generate.
| TBTK::ChebyshevSolver::ChebyshevSolver | ( | ) |
Constructor.
| TBTK::ChebyshevSolver::~ChebyshevSolver | ( | ) |
Destructor.
| 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
, where
is a set of indices and
. Runs on CPU.
| to | vector of 'to'-indeces, or 's. |
| from | 'From'-index, or . |
| coefficients | Pointer to array able to hold numCoefficients 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::ChebyshevSolver::calculateCoefficients | ( | Index | to, |
| Index | from, | ||
| std::complex< double > * | coefficients, | ||
| int | numCoefficients, | ||
| double | broadening = 0.0001 |
||
| ) |
Calculates the Chebyshev coefficients for
, where
and
. Runs on CPU.
| to | 'To'-index, or . |
| from | 'From'-index, or . |
| 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::ChebyshevSolver::calculateCoefficientsGPU | ( | std::vector< Index > & | to, |
| Index | from, | ||
| std::complex< double > * | coefficients, | ||
| int | numCoefficients, | ||
| double | broadening = 0.0001 |
||
| ) |
Calculates the Chebyshev coefficients for
, where
is a set of indices and
. Runs on GPU.
| to | vector of 'to'-indeces, or 's. |
| from | 'From'-index, or . |
| coefficients | Pointer to array able to hold numCoefficients 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::ChebyshevSolver::calculateCoefficientsGPU | ( | Index | to, |
| Index | from, | ||
| std::complex< double > * | coefficients, | ||
| int | numCoefficients, | ||
| double | broadening = 0.0001 |
||
| ) |
Calculates the Chebyshev coefficients for
, where
and
. Runs on GPU.
| to | 'To'-index, or . |
| from | 'From'-index, or . |
| 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::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.
| greensFunction | Pointer to array able to hold Green's function. Has to be able to hold energyResolution elements. |
| coefficients | Chebyshev coefficients calculated by ChebyshevSolver::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). |
| 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.
| greensFunction | Pointer to array able to hold Green's function. Has to be able to hold energyResolution elements. |
| coefficients | Chebyshev 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.
| greensFunction | Pointer to array able to hold Green's function. Has to be able to hold energyResolution elements. |
| coefficients | Chebyshev 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.
| 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. |
|
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).
| 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 |
|
inline |
Get scale factor.
| void TBTK::ChebyshevSolver::loadLookupTableGPU | ( | ) |
Load lookup table generated by ChebyshevSolver::generateLookupTable onto GPU.
|
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.
|
inline |
Set scale factor.
1.8.11