![]() |
TBTK
|
Need a break? Support the development by playing Polarity Puzzles![]() |
HoppingAmplitude container. More...
#include <HoppingAmplitudeSet.h>
Classes | |
class | ConstIterator |
class | Iterator |
Public Member Functions | |
HoppingAmplitudeSet () | |
HoppingAmplitudeSet (const std::vector< unsigned int > &capacity) | |
HoppingAmplitudeSet (const std::string &serializeation, Mode mode) | |
virtual | ~HoppingAmplitudeSet () |
void | construct () |
bool | getIsConstructed () const |
int | getFirstIndexInBlock (const Index &blockIndex) const |
int | getLastIndexInBlock (const Index &blockIndex) const |
IndexTree | getIndexTree () const |
IndexTree | getIndexTree (const Index &subspace) const |
SparseMatrix< std::complex< double > > | getSparseMatrix () const |
Iterator | begin () |
ConstIterator | begin () const |
ConstIterator | cbegin () const |
Iterator | begin (const Index &subspace) |
ConstIterator | begin (const Index &subspace) const |
ConstIterator | cbegin (const Index &subspace) const |
Iterator | end () |
ConstIterator | end () const |
ConstIterator | cend () const |
Iterator | end (const Index &subspace) |
ConstIterator | end (const Index &subspace) const |
ConstIterator | cend (const Index &subspace) const |
void | print () |
void | tabulate (std::complex< double > **amplitudes, int **indices, int *numHoppingAmplitudes, int *maxIndexSize) const |
virtual std::string | serialize (Mode mode) const |
unsigned int | getSizeInBytes () const |
![]() | |
template<> | |
std::string | serialize (const bool &data, Mode mode) |
template<> | |
std::string | serialize (const double &data, Mode mode) |
template<> | |
std::string | serialize (const std::complex< double > &data, Mode mode) |
template<> | |
std::string | serialize (const int &data, Mode mode) |
template<> | |
std::string | serialize (const unsigned int &data, Mode mode) |
template<> | |
std::string | serialize (const SpinMatrix &data, Mode mode) |
template<> | |
std::string | serialize (const Statistics &data, Mode mode) |
template<> | |
std::string | serialize (const std::vector< std::complex< double >> &data, Mode mode) |
template<> | |
int | deserialize (const std::string &serialization, Mode mode) |
template<> | |
unsigned int | deserialize (const std::string &serialization, Mode mode) |
template<> | |
double | deserialize (const std::string &serialization, Mode mode) |
template<> | |
std::complex< double > | deserialize (const std::string &serialization, Mode mode) |
template<> | |
SpinMatrix | deserialize (const std::string &serialization, Mode mode) |
template<> | |
Statistics | deserialize (const std::string &serialization, Mode mode) |
template<> | |
std::vector< std::complex< double > > | deserialize (const std::string &serialization, Mode mode) |
Additional Inherited Members | |
![]() | |
enum | Mode { Debug, Binary, XML, JSON } |
![]() | |
static bool | hasID (const std::string &serialization, Mode mode) |
static std::string | getID (const std::string &serialization, Mode mode) |
static std::string | extractComponent (const std::string &serialization, const std::string &containerID, const std::string &componentID, const std::string &componentName, Mode mode) |
![]() | |
static bool | validate (const std::string &serialization, const std::string &id, Mode mode) |
static std::string | getContent (const std::string &serialization, Mode mode) |
static std::vector< std::string > | split (const std::string &content, Mode mode) |
template<typename DataType > | |
static std::enable_if<!std::is_pointer< DataType >::value, std::string >::type | serialize (const DataType &data, Mode mode) |
template<typename DataType > | |
static std::enable_if< std::is_pointer< DataType >::value, std::string >::type | serialize (const DataType &data, Mode mode) |
template<typename DataType > | |
static DataType | deserialize (const std::string &serialization, Mode mode) |
static std::string | extract (const std::string &serialization, Mode mode, std::string component) |
HoppingAmplitude container.
A HoppingAmplitudeSet 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 HoppingAmplitudeSet, the construct method has to be called in order to construct an appropriate Hilbert space. The HoppingAmplitudeSet is most importantly used by the Model to store the Hamiltonian.
TBTK::HoppingAmplitudeSet::HoppingAmplitudeSet | ( | ) |
Constructs a HoppingAmplitudeSet.
TBTK::HoppingAmplitudeSet::HoppingAmplitudeSet | ( | const std::vector< unsigned int > & | capacity | ) |
Constructs a HoppingAmplitudeSet with a preallocated storage structure such that the addition of HoppingAmplitudes with indices that have the same subindex structure as 'capacity', but with smaller subindices will not cause reallocation for the main storage structure. Internal containers for HoppingAmplitudes may still be reallocated.
capacity | 'Index capacity'. |
TBTK::HoppingAmplitudeSet::HoppingAmplitudeSet | ( | const std::string & | serializeation, |
Mode | mode | ||
) |
Constructor. Constructs the HoppingAmplitudeSet from a serialization string.
serialization | Serialization string from which to construct the HoppingAmplitudeSet. |
mode | Mode with which the string has been serialized. |
|
virtual |
Destructor.
|
inline |
Create Iterator.
|
inline |
Create ConstIterator.
|
inline |
Create Iterator for a particular subspace.
|
inline |
Create ConstIterator for a particular subspace.
Index | for the subspace the ConstIterator is to be iterating over. |
|
inline |
Create ConstIterator.
|
inline |
Create ConstIterator for a particular subspace.
Index | for the subspace the ConstIterator is to be iterating over. |
|
inline |
Create ConstIterator pointing to the end.
|
inline |
Create ConstIterator pointing to the end for a particular subspace.
Index | for the subspace the ConstIterator is to be iterating over. |
|
inline |
Construct Hilbert space. No more HoppingAmplitudes should be added after this call.
|
inline |
Create Iterator pointing to the end.
|
inline |
Create ConstIterator pointing to the end.
|
inline |
Create Iterator pointing to the end for a particular subspace.
|
inline |
Create ConstIterator pointing to the end for a particular subspace.
Index | for the subspace the ConstIterator is to be iterating over. |
|
inline |
Get first index in block.
subspaceIndex | The physical Index of the subspace. |
IndexTree TBTK::HoppingAmplitudeSet::getIndexTree | ( | ) | const |
Get an IndexTree containing all the Indices that are contained in the HoppingAmplitudeSet.
Get an IndexTree containing all the Indices that are contained in the given subspace of the HoppingAmplitudeSet.
subspace | The subspaec to get the IndexTree for. |
|
inline |
Check whether the Hilbert space basis has been constructed.
|
inline |
Get last index in block.
subspaceIndex | The physical Index of the subspace. |
|
inline |
Get size in bytes.
|
inline |
Get a sprase matrix corresponding to the HoppingAMplitudeSet. The basis of the matrix is the Hilbert space basis.
void TBTK::HoppingAmplitudeSet::print | ( | ) |
Print tree structure. Mainly for debuging.
|
virtual |
Implements Serializable::serialize().
Reimplemented from TBTK::HoppingAmplitudeTree.
void TBTK::HoppingAmplitudeSet::tabulate | ( | std::complex< double > ** | amplitudes, |
int ** | indices, | ||
int * | numHoppingAmplitudes, | ||
int * | maxIndexSize | ||
) | const |
Tabulates HoppingAmplitudes to make them possible to export.
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. |