#include <AmplitudeSet.h>
An AmplitudeSet is a container for HoppingAmplitudes . The structure contains the root node for the tree structure in which the HoppingAmplitudes are stored, as well as functions for adding and accessing HoppingAmplitudes. Once all HoppingAmplitudes have been added to the AmplitudeSet, the construct method has to be called in order to construct an appropriate Hilbert space. The AmplitudeSet is most importantly used by the Model to store the Hamiltonian.
| TBTK::AmplitudeSet::AmplitudeSet |
( |
| ) |
|
| TBTK::AmplitudeSet::~AmplitudeSet |
( |
| ) |
|
| void TBTK::AmplitudeSet::construct |
( |
| ) |
|
|
inline |
| void TBTK::AmplitudeSet::constructCOO |
( |
| ) |
|
Construct Hamiltonian on COO format.
| void TBTK::AmplitudeSet::destructCOO |
( |
| ) |
|
Destruct Hamiltonian on COO format.
| int TBTK::AmplitudeSet::getBasisIndex |
( |
const Index & |
index | ) |
const |
|
inline |
Get Hilbert space index corresponding to given 'from'-index.
- Parameters
-
| index | 'From'-index to get Hilbert space index for. |
| int TBTK::AmplitudeSet::getBasisSize |
( |
| ) |
const |
|
inline |
Get size of Hilbert space.
| const int * TBTK::AmplitudeSet::getCOOColIndices |
( |
| ) |
const |
|
inline |
Get col indices on COO format.
| const int * TBTK::AmplitudeSet::getCOORowIndices |
( |
| ) |
const |
|
inline |
Get row indices on COO format.
| const std::complex< double > * TBTK::AmplitudeSet::getCOOValues |
( |
| ) |
const |
|
inline |
Get row indices on COO format.
Get all HoppingAmplitudes with given 'from'-index.
- Parameters
-
| index | 'From'-index to get HoppingAmplitudes for. |
| bool TBTK::AmplitudeSet::getIsConstructed |
( |
| ) |
const |
|
inline |
Returns true if the Hilbert space basis has been constructed.
Returns an iterator for iterating through HoppingAmplitudes . The iterator is restricted to the subspace for which the 'from'-index starts with the indices in the argument 'subspace'.
| int TBTK::AmplitudeSet::getNumMatrixElements |
( |
| ) |
const |
Get number of matrix elements in the Hamiltonian corresponding to the AmplitudeSet.
| bool TBTK::AmplitudeSet::isProperSubspace |
( |
const Index & |
subspace | ) |
|
|
inline |
Returns true if the subspace is a proper subspace. That is, if all indices starting with the indices in 'subspace' only are connected to other indices with the same initial subspace indices.
| void TBTK::AmplitudeSet::print |
( |
| ) |
|
Print tree structure. Mainly for debuging.
| void TBTK::AmplitudeSet::reconstructCOO |
( |
| ) |
|
Reconstruct Hamiltonian on COO format. Only has any effect if a Hamiltonian on COO format already is constructed. Is necessary to reflect changes in the Hamiltonain due to changes in values returned by HoppingAmplitude-callback functions. The function is intended to be called by the Model whenever it is notified of possible changes in values returned by the callback-functions.
| void TBTK::AmplitudeSet::sort |
( |
| ) |
|
|
inline |
| void TBTK::AmplitudeSet::tabulate |
( |
std::complex< double > ** |
amplitudes, |
|
|
int ** |
indices, |
|
|
int * |
numHoppingAmplitudes, |
|
|
int * |
maxIndexSize |
|
) |
| const |
Tabulates HoppingAmplitudes to make them possible to export.
- Parameters
-
| amplitudes | Pointer to amplitude table pointer. Memory will be allocated and has to be freed by the user. The array will contain all the HoppingAmplitude values when the function returns. |
| table | Pointer to index table pointer. Memory will be allocated and has to be freed by the user. The array will contain the 'to'- and 'from'-indices for the corresponding HoppingAmplitude values in amplitudes. The values are stored sequentially using the format [to0] [padding] [from0] [padding] [to1] ..., where the padding is added to align 'to'- and 'from'-indices in memory in case multiple index sizes are encounterd. The number of padding elements will be zero for indices of size maxIndexSize and the padding value is -1. The total array size is 2*numHoppingAmplitudes*maxIndexSize. |
| numHoppingAmplitudes | Pointer to int that will contain the number of HoppingAMplitudes when the function returns. |
| maxIndexSize | Pointer to int that will contain the maximum number of subindices encountered. |
Root node for the tree structure in which HoppingAmplitudes are stored.
The documentation for this class was generated from the following files: