Go to the documentation of this file.
23 #ifndef COM_DAFER45_TBTK_HOPPING_AMPLITUDE_SET
24 #define COM_DAFER45_TBTK_HOPPING_AMPLITUDE_SET
146 template<
bool isConstIterator>
151 typedef typename std::conditional<
155 >::type HoppingAmplitudeReferenceType;
161 HoppingAmplitudeReferenceType
operator*();
164 bool operator==(
const _Iterator &rhs)
const;
170 int getMinBasisIndex()
const;
173 int getMaxBasisIndex()
const;
176 int getNumBasisIndices()
const;
180 typedef typename std::conditional<
184 >::type HoppingAmplitudeTreeIteratorType;
188 typedef typename std::conditional<
192 >::type HoppingAmplitudeTreePointerType;
196 HoppingAmplitudeTreeIteratorType iterator;
206 HoppingAmplitudeTreePointerType hoppingAmplitudeTree,
218 ) : _Iterator<false>(hoppingAmplitudeTree,
end){};
232 ) : _Iterator<true>(hoppingAmplitudeTree,
end){};
249 ConstIterator
begin()
const;
255 ConstIterator
cbegin()
const;
272 ConstIterator
begin(
const Index &subspace)
const;
292 ConstIterator
end()
const;
298 ConstIterator
cend()
const;
305 Iterator
end(
const Index &subspace);
314 ConstIterator
end(
const Index &subspace)
const;
323 ConstIterator
cend(
const Index &subspace)
const;
353 std::complex<double> **amplitudes,
355 int *numHoppingAmplitudes,
373 "HoppingAmplitudeSet::construct()",
374 "HoppingAmplitudeSet is already constructed.",
379 isConstructed =
true;
383 return isConstructed;
387 const Index &blockIndex
393 const Index &blockIndex
402 "HoppingAmplitudeSet::getSparseMatrix()",
403 "HoppingAmplitudeSet has to be constructed first.",
419 (*iterator).getAmplitude()
432 return ConstIterator(
this);
440 const Index &subspace
446 const Index &subspace
452 const Index &subspace
462 return ConstIterator(
this,
true);
470 const Index &subspace
476 const Index &subspace
482 const Index &subspace
487 template<
bool isConstIterator>
488 inline bool HoppingAmplitudeSet::_Iterator<isConstIterator>::operator==(
491 return iterator == rhs.iterator;
494 template<
bool isConstIterator>
495 inline bool HoppingAmplitudeSet::_Iterator<isConstIterator>::operator!=(
498 return iterator != rhs.iterator;
508 template<
bool isConstIterator>
509 inline void HoppingAmplitudeSet::_Iterator<isConstIterator>::operator++(){
513 template<
bool isConstIterator>
514 inline typename HoppingAmplitudeSet::_Iterator<
516 >::HoppingAmplitudeReferenceType HoppingAmplitudeSet::_Iterator<
522 template<
bool isConstIterator>
523 inline int HoppingAmplitudeSet::_Iterator<isConstIterator>::getMinBasisIndex()
const{
524 return iterator.getMinBasisIndex();
527 template<
bool isConstIterator>
528 inline int HoppingAmplitudeSet::_Iterator<isConstIterator>::getMaxBasisIndex()
const{
529 return iterator.getMaxBasisIndex();
532 template<
bool isConstIterator>
533 inline int HoppingAmplitudeSet::_Iterator<isConstIterator>::getNumBasisIndices()
const{
534 return iterator.getNumBasisIndices();
537 template<
bool isConstIterator>
538 inline HoppingAmplitudeSet::_Iterator<isConstIterator>::_Iterator(
539 HoppingAmplitudeTreePointerType hoppingAmplitudeTree,
545 hoppingAmplitudeTree->end()
546 : hoppingAmplitudeTree->begin()
HoppingAmplitudeTree * getSubTree(const Index &subspace)
ConstIterator cend() const
Definition: HoppingAmplitudeSet.h:465
Iterator begin()
Definition: HoppingAmplitudeSet.h:427
bool isProperSubspace(const Index &subspace) const
Definition: SparseMatrix.h:35
void add(unsigned int row, unsigned int col, const DataType &value)
Definition: SparseMatrix.h:563
virtual ~HoppingAmplitudeSet()
IndexTree getSubspaceIndices() const
int getLastIndexInBlock(const Index &blockIndex) const
Definition: HoppingAmplitudeSet.h:392
Index getPhysicalIndex(int basisIndex) const
Definition: HoppingAmplitudeSet.h:227
int getLastIndexInSubspace(const Index &subspaceIndex) const
Definition: HoppingAmplitudeTree.h:516
HoppingAmplitude container.
Definition: HoppingAmplitudeSet.h:50
void construct()
Definition: SparseMatrix.h:780
const std::vector< HoppingAmplitude > & getHoppingAmplitudes(Index index) const
Definition: Serializable.h:43
IndexTree getIndexTree() const
Index getSubspaceIndex(const Index &index) const
void generateBasisIndices()
bool getIsConstructed() const
Definition: HoppingAmplitudeSet.h:382
void add(HoppingAmplitude ha)
bool operator!=(const IndexTree &lhs, const IndexTree &rhs)
Definition: IndexTree.h:391
virtual std::string serialize(Mode mode) const
Abstract base class for serializable objects.
Node in tree used by HoppingAmplitudeSet to store HoppingAmplitudes .
Definition: HoppingAmplitudeTree.h:40
std::vector< Index > getIndexList(const Index &pattern) const
int getFirstIndexInSubspace(const Index &subspaceIndex) const
Definition: HoppingAmplitudeTree.h:500
void tabulate(std::complex< double > **amplitudes, int **indices, int *numHoppingAmplitudes, int *maxIndexSize) const
int getBasisIndex(const Index &index) const
Definition: HoppingAmplitudeTree.h:313
std::vector< Index > getIndexListMultiplePatterns(const std::vector< Index > &patterns) const
Hopping amplitude from state 'from' to state 'to'.
Definition: HoppingAmplitude.h:53
unsigned int getSizeInBytes() const
Definition: HoppingAmplitudeTree.h:556
Data structure for mapping physical indices to linear indices.
Definition: IndexTree.h:35
Node in tree used by HoppingAmplitudeSet to store HoppingAmplitudes .
Hopping amplitude from state 'from' to state 'to'.
int getBasisSize() const
Definition: HoppingAmplitudeTree.h:496
ConstIterator cbegin() const
Definition: HoppingAmplitudeSet.h:435
Iterator end()
Definition: HoppingAmplitudeSet.h:457
const Vector2d operator*(double lhs, const Vector2d &rhs)
Definition: Vector2d.h:129
void construct()
Definition: HoppingAmplitudeSet.h:370
Definition: HoppingAmplitudeTree.h:327
Mode
Definition: Serializable.h:47
Definition: HoppingAmplitudeSet.h:213
Physical index.
Definition: Index.h:44
SparseMatrix< std::complex< double > > getSparseMatrix() const
Definition: HoppingAmplitudeSet.h:398
int getFirstIndexInBlock(const Index &blockIndex) const
Definition: HoppingAmplitudeSet.h:386
Data structure for mapping physical indices to a linear index.
unsigned int getSizeInBytes() const
Definition: HoppingAmplitudeSet.h:501